]> granicus.if.org Git - strace/commitdiff
Replace return 1 ioctl sub-decoder hack with proper flag
authorEugene Syromyatnikov <evgsyr@gmail.com>
Mon, 14 Aug 2017 17:25:13 +0000 (19:25 +0200)
committerEugene Syromyatnikov <evgsyr@gmail.com>
Mon, 28 Aug 2017 00:33:20 +0000 (02:33 +0200)
* defs.h (RVAL_IOCTL_PARSED): Introduce new flag for ioctl sub-decoders
* to signalise that they have successfully printed argument.
* ioctl.c (SYS_FUNC(ioctl)): Check for RVAL_IOCTL_PARSED flag, remove
un-set it before returning the value.
* block.c: Use RVAL_IOCTL_PARSED instead of 1.
* btrfs.c: Likewise.
* dm.c: Likewise.
* evdev.c: Likewise.
* file_ioctl.c: Likewise.
* fs_x_ioctl.c: Likewise.
* hdio.c: Likewise.
* loop.c: Likewise.
* mtd.c: Likewise.
* nsfs.c: Likewise.
* print_sg_req_info.c: Likewise.
* ptp.c: Likewise.
* rtc.c: Likewise.
* scsi.c: Likewise.
* sg_io_v3.c: Likewise.
* sg_io_v4.c: Likewise.
* sock.c: Likewise.
* term.c: Likewise.
* ubi.c: Likewise.
* userfaultfd.c: Likewise.
* v4l2.c: Likewise.

23 files changed:
block.c
btrfs.c
defs.h
dm.c
evdev.c
file_ioctl.c
fs_x_ioctl.c
hdio.c
ioctl.c
loop.c
mtd.c
nsfs.c
print_sg_req_info.c
ptp.c
rtc.c
scsi.c
sg_io_v3.c
sg_io_v4.c
sock.c
term.c
ubi.c
userfaultfd.c
v4l2.c

diff --git a/block.c b/block.c
index 486c6df01214ae062ab8e726968796ae0e9bee99..06c5004c284580afe36ee1b8494861cbb673d7f5 100644 (file)
--- a/block.c
+++ b/block.c
@@ -265,5 +265,5 @@ MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp,
                return RVAL_DECODED;
        }
 
-       return RVAL_DECODED | 1;
+       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 }
diff --git a/btrfs.c b/btrfs.c
index 3c48e798f8703e713278936dcbf245547c5d1e1b..f4487d63429ea0ef5971ad21e415e44d549894d0 100644 (file)
--- a/btrfs.c
+++ b/btrfs.c
@@ -1345,6 +1345,6 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl,
        default:
                return RVAL_DECODED;
        };
-       return RVAL_DECODED | 1;
+       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 }
 #endif /* HAVE_LINUX_BTRFS_H */
diff --git a/defs.h b/defs.h
index f82eef15eeacf1f5e95a6bf1240e2ab94e6770f1..72bee85e194570658d3bcc79805425a36dbedaf0 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -307,6 +307,8 @@ extern const struct xlat whence_codes[];
 #define RVAL_NONE      040     /* Print nothing */
 
 #define RVAL_DECODED   0100    /* syscall decoding finished */
+/* ioctl sub-parser successfully parsed (and printed) the argument */
+#define RVAL_IOCTL_PARSED 0200
 
 #define IOCTL_NUMBER_UNKNOWN 0
 #define IOCTL_NUMBER_HANDLED 1
diff --git a/dm.c b/dm.c
index 327a5e1abce383836633e1fa4e4203b06bac188a..03216eb3c0c9950ebc92c9df3b51fa546236492d 100644 (file)
--- a/dm.c
+++ b/dm.c
@@ -479,7 +479,7 @@ dm_known_ioctl(struct tcb *const tcp, const unsigned int code,
        }
 
        if (exiting(tcp) && syserror(tcp) && !ioc_changed)
-               return 1;
+               return RVAL_IOCTL_PARSED;
 
        /*
         * device mapper code uses %d in some places and %u in another, but
@@ -553,7 +553,7 @@ dm_known_ioctl(struct tcb *const tcp, const unsigned int code,
 
  skip:
        tprints("}");
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 int
diff --git a/evdev.c b/evdev.c
index 983bf1488681dc8f3ab01c412c66e87688d4370f..252fe5cba2f0b64cca6f1d460c8d39e90aed0dc4 100644 (file)
--- a/evdev.c
+++ b/evdev.c
@@ -83,7 +83,7 @@ ff_effect_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
        struct_ff_effect ffe;
 
        if (umove_or_printaddr(tcp, arg, &ffe))
-               return 1;
+               return RVAL_IOCTL_PARSED;
 
        tprints("{type=");
        printxval(evdev_ff_types, ffe.type, "FF_???");
@@ -94,7 +94,7 @@ ff_effect_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
 
        if (abbrev(tcp)) {
                tprints("...}");
-               return 1;
+               return RVAL_IOCTL_PARSED;
        }
 
        tprintf("trigger={button=%" PRIu16
@@ -150,7 +150,7 @@ ff_effect_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
 
        tprints("}");
 
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 static int
@@ -184,7 +184,7 @@ abs_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
                tprints("}");
        }
 
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 static int
@@ -200,7 +200,7 @@ keycode_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
                tprints("]");
        }
 
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 # ifdef EVIOCGKEYCODE_V2
@@ -212,7 +212,7 @@ keycode_V2_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
        struct input_keymap_entry ike;
 
        if (umove_or_printaddr(tcp, arg, &ike))
-               return 1;
+               return RVAL_IOCTL_PARSED;
 
        tprintf("{flags=%" PRIu8
                ", len=%" PRIu8 ", ",
@@ -237,7 +237,7 @@ keycode_V2_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
 
        tprints("}");
 
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 # endif /* EVIOCGKEYCODE_V2 */
 
@@ -258,7 +258,7 @@ getid_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
                        id.product,
                        id.version);
 
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 static int
@@ -276,7 +276,7 @@ decode_bitset(struct tcb *const tcp, const kernel_ulong_t arg,
        char decoded_arg[size];
 
        if (umove_or_printaddr(tcp, arg, &decoded_arg))
-               return 1;
+               return RVAL_IOCTL_PARSED;
 
        tprints("[");
 
@@ -300,7 +300,7 @@ decode_bitset(struct tcb *const tcp, const kernel_ulong_t arg,
 
        tprints("]");
 
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 # ifdef EVIOCGMTSLOTS
@@ -313,13 +313,13 @@ mtslots_ioctl(struct tcb *const tcp, const unsigned int code,
        const size_t size = _IOC_SIZE(code) / sizeof(int);
        if (!size) {
                printaddr(arg);
-               return 1;
+               return RVAL_IOCTL_PARSED;
        }
 
        int buffer[size];
 
        if (umove_or_printaddr(tcp, arg, &buffer))
-               return 1;
+               return RVAL_IOCTL_PARSED;
 
        tprints("{code=");
        printxval(evdev_mtslots, buffer[0], "ABS_MT_???");
@@ -332,7 +332,7 @@ mtslots_ioctl(struct tcb *const tcp, const unsigned int code,
 
        tprints("]}");
 
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 # endif /* EVIOCGMTSLOTS */
 
@@ -342,7 +342,7 @@ repeat_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
 {
        tprints(", ");
        printpair_int(tcp, arg, "%u");
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 # endif /* EVIOCGREP || EVIOCSREP */
 
@@ -386,14 +386,14 @@ bit_ioctl(struct tcb *const tcp, const unsigned int ev_nr,
                case EV_PWR:
                        tprints(", ");
                        printnum_int(tcp, arg, "%d");
-                       return 1;
+                       return RVAL_IOCTL_PARSED;
                case EV_FF_STATUS:
                        return decode_bitset(tcp, arg, evdev_ff_status,
                                             FF_STATUS_MAX, "FF_STATUS_???");
                default:
                        tprints(", ");
                        printaddr(arg);
-                       return 1;
+                       return RVAL_IOCTL_PARSED;
        }
 }
 
@@ -406,11 +406,11 @@ evdev_read_ioctl(struct tcb *const tcp, const unsigned int code,
                case EVIOCGVERSION:
                        tprints(", ");
                        printnum_int(tcp, arg, "%#x");
-                       return 1;
+                       return RVAL_IOCTL_PARSED;
                case EVIOCGEFFECTS:
                        tprints(", ");
                        printnum_int(tcp, arg, "%u");
-                       return 1;
+                       return RVAL_IOCTL_PARSED;
                case EVIOCGID:
                        return getid_ioctl(tcp, arg);
 # ifdef EVIOCGREP
@@ -439,7 +439,7 @@ evdev_read_ioctl(struct tcb *const tcp, const unsigned int code,
                                printaddr(arg);
                        else
                                printstrn(tcp, arg, tcp->u_rval);
-                       return 1;
+                       return RVAL_IOCTL_PARSED;
 # ifdef EVIOCGPROP
                case _IOC_NR(EVIOCGPROP(0)):
                        return decode_bitset(tcp, arg, evdev_prop,
@@ -492,18 +492,18 @@ evdev_write_ioctl(struct tcb *const tcp, const unsigned int code,
                        return ff_effect_ioctl(tcp, arg);
                case EVIOCRMFF:
                        tprintf(", %d", (int) arg);
-                       return 1;
+                       return RVAL_IOCTL_PARSED;
                case EVIOCGRAB:
 # ifdef EVIOCREVOKE
                case EVIOCREVOKE:
 # endif
                        tprintf(", %" PRI_klu, arg);
-                       return 1;
+                       return RVAL_IOCTL_PARSED;
 # ifdef EVIOCSCLOCKID
                case EVIOCSCLOCKID:
                        tprints(", ");
                        printnum_int(tcp, arg, "%u");
-                       return 1;
+                       return RVAL_IOCTL_PARSED;
 # endif
        }
 
index cc2378f63d1826b686f469516cc9d517f20eec09..2391431e2b5f12bf5fa84cc8f9ab5297c5032beb 100644 (file)
@@ -245,5 +245,5 @@ file_ioctl(struct tcb *const tcp, const unsigned int code,
                return RVAL_DECODED;
        };
 
-       return RVAL_DECODED | 1;
+       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 }
index 2fa30f56d60f49a2bc522c2b39b20c9499148101..0c8f60e132b3494df9034d30d931d012f2958103 100644 (file)
@@ -62,5 +62,5 @@ fs_x_ioctl(struct tcb *const tcp, const unsigned int code,
                return RVAL_DECODED;
        }
 
-       return RVAL_DECODED | 1;
+       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 }
diff --git a/hdio.c b/hdio.c
index 6e256d94bfb154296d14f9a5d8d63635a7ced5fa..a987ad01503c30af62e25d1376352051c5ab18aa 100644 (file)
--- a/hdio.c
+++ b/hdio.c
@@ -60,5 +60,5 @@ MPERS_PRINTER_DECL(int, hdio_ioctl, struct tcb *const tcp,
                return RVAL_DECODED;
        }
 
-       return RVAL_DECODED | 1;
+       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 }
diff --git a/ioctl.c b/ioctl.c
index a10c80b8fd8f0b0717aeec5d90389ea37aa78e66..280bc24d8d5542b7096643c2f1ea36017f94de89 100644 (file)
--- a/ioctl.c
+++ b/ioctl.c
@@ -227,28 +227,31 @@ ioctl_decode_command_number(struct tcb *tcp)
 /**
  * Decode arg parameter of the ioctl call.
  *
- * @return There are two bits of the return value important for the purposes of
+ * @return There are two flags of the return value important for the purposes of
  *         processing by SYS_FUNC(ioctl):
- *          - 1 - indicates that ioctl decoder code has printed arg parameter.
+ *          - RVAL_IOCTL_PARSED - indicates that ioctl decoder code has printed
+ *                                arg parameter.
  *          - RVAL_DECODED - indicates that decoding is done.
  *         As a result, the following behaviour is expected:
  *          - on entering:
  *            - 0 - decoding should be continued on exiting;
  *            - RVAL_DECODED - decoding on exiting is not needed and generic
  *                             handler should print arg value;
- *            - 1 | RVAL_DECODED - decoding on exiting is not needed and decoder
- *                                 has printed arg value.
+ *            - RVAL_IOCTL_PARSED | RVAL_DECODED - decoding on exiting is not
+ *                                                needed and decoder
+ *                                                has printed arg value.
  *          - on exiting:
  *            - 0 - generic handler should print arg value.
- *            - 1 - decoder has printed arg value.
+ *            - RVAL_IOCTL_PARSED - decoder has printed arg value.
  *
- *         Note that it makes no sense to return just 1 (without RVAL_DECODED)
- *         on entering, or 1 | RVAL_DECODED on exiting, but, of course, it is
- *         not prohibited (for example, it may be useful in cases where the
- *         return path is common on entering and on exiting the syscall).
+ *         Note that it makes no sense to return just RVAL_IOCTL_PARSED
+ *         on entering, or RVAL_IOCTL_PARSED | RVAL_DECODED on exiting, but,
+ *         of course, it is not prohibited (for example, it may be useful
+ *         in cases where the return path is common on entering and on exiting
+ *         the syscall).
  *
- *         SYS_FUNC(ioctl) clears bit 0 and passes all other bits of
- *         ioctl_decode return value unchanged.
+ *         SYS_FUNC(ioctl) clears RVAL_IOCTL_PARSED flag and passes all other
+ *         bits of ioctl_decode return value unchanged.
  */
 static int
 ioctl_decode(struct tcb *tcp)
@@ -345,10 +348,10 @@ SYS_FUNC(ioctl)
                ret = ioctl_decode(tcp) | RVAL_DECODED;
        }
 
-       if ((ret & RVAL_DECODED) && !(ret & 1))
+       if ((ret & RVAL_DECODED) && !(ret & RVAL_IOCTL_PARSED))
                tprintf(", %#" PRI_klx, tcp->u_arg[2]);
 
-       ret &= ~1;
+       ret &= ~RVAL_IOCTL_PARSED;
 
        return ret;
 }
diff --git a/loop.c b/loop.c
index e30b7ce59b4a6a36b867f56f41dacd62a8d4d3f3..9ed8a3e87493d178cb64c1d814425a2226eb8591 100644 (file)
--- a/loop.c
+++ b/loop.c
@@ -196,5 +196,5 @@ MPERS_PRINTER_DECL(int, loop_ioctl,
                return RVAL_DECODED;
        }
 
-       return RVAL_DECODED | 1;
+       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 }
diff --git a/mtd.c b/mtd.c
index b0468595a5167e97bf298a62a3c24ed2208ad063..cd6584bf34a787398cdbcbc6c459b0122c7db573 100644 (file)
--- a/mtd.c
+++ b/mtd.c
@@ -360,5 +360,5 @@ MPERS_PRINTER_DECL(int, mtd_ioctl, struct tcb *const tcp,
                return RVAL_DECODED;
        }
 
-       return RVAL_DECODED | 1;
+       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 }
diff --git a/nsfs.c b/nsfs.c
index 1048f9a7f71b4ac3a74cc7cd7d613de4ed51f2f3..2b39eaf80e6b8d7a16002a50adbd616342b5fbbd 100644 (file)
--- a/nsfs.c
+++ b/nsfs.c
@@ -37,7 +37,7 @@ nsfs_ioctl(struct tcb *tcp, unsigned int code, kernel_ulong_t arg)
        switch (code) {
        case NS_GET_USERNS:
        case NS_GET_PARENT:
-               return 1 + RVAL_FD + RVAL_DECODED;
+               return RVAL_IOCTL_PARSED | RVAL_FD | RVAL_DECODED;
        case NS_GET_NSTYPE:
                if (entering(tcp))
                        return 0;
@@ -46,10 +46,10 @@ nsfs_ioctl(struct tcb *tcp, unsigned int code, kernel_ulong_t arg)
                        outstr = xlookup(setns_types, tcp->u_rval);
                        if (outstr) {
                                tcp->auxstr = outstr;
-                               return 1 + RVAL_STR;
+                               return RVAL_IOCTL_PARSED | RVAL_STR;
                        }
                }
-               return 1;
+               return RVAL_IOCTL_PARSED;
        case NS_GET_OWNER_UID:
                if (entering(tcp))
                        return 0;
@@ -58,7 +58,7 @@ nsfs_ioctl(struct tcb *tcp, unsigned int code, kernel_ulong_t arg)
                        printuid("[", uid);
                        tprints("]");
                }
-               return 1;
+               return RVAL_IOCTL_PARSED;
        default:
                return RVAL_DECODED;
        }
index cb34d4fdd1cbd5d5fd9f938d762a189235e1ccfa..c3bdba93c19a9c309977a9a3dd789f85cf429b93 100644 (file)
@@ -68,7 +68,7 @@ MPERS_PRINTER_DECL(int, decode_sg_req_info,
                tprintf(", duration=%u}", info.duration);
        }
 
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 #endif /* HAVE_SCSI_SG_H */
diff --git a/ptp.c b/ptp.c
index 6d3ddd8ac6ceaa576577d6ca563c2360a1296cdd..97853d89103a74547952bd3754edc84874605787 100644 (file)
--- a/ptp.c
+++ b/ptp.c
@@ -136,5 +136,5 @@ ptp_ioctl(struct tcb *const tcp, const unsigned int code,
                return RVAL_DECODED;
        }
 
-       return RVAL_DECODED | 1;
+       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 }
diff --git a/rtc.c b/rtc.c
index 43ea946651eb3e8bd2018c3a11dfa1361507fce1..38c1e4249677ae5599406581a5b0cf92ec4530d3 100644 (file)
--- a/rtc.c
+++ b/rtc.c
@@ -150,5 +150,5 @@ MPERS_PRINTER_DECL(int, rtc_ioctl, struct tcb *const tcp,
                return RVAL_DECODED;
        }
 
-       return RVAL_DECODED | 1;
+       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 }
diff --git a/scsi.c b/scsi.c
index 43b829a325184019cd71320ec051b5296787631f..343bd00ff878986a35cb6c86b05b02e0ceed309d 100644 (file)
--- a/scsi.c
+++ b/scsi.c
@@ -46,7 +46,7 @@ decode_sg_io(struct tcb *const tcp, const uint32_t iid,
                        return decode_sg_io_v4(tcp, arg);
                default:
                        tprintf("[%u]", iid);
-                       return RVAL_DECODED | 1;
+                       return RVAL_DECODED | RVAL_IOCTL_PARSED;
        }
 
 }
@@ -78,7 +78,7 @@ decode_sg_scsi_id(struct tcb *const tcp, const kernel_ulong_t arg)
                        id.h_cmd_per_lun,
                        id.d_queue_depth);
        }
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 #endif /* HAVE_SCSI_SG_H */
@@ -179,5 +179,5 @@ scsi_ioctl(struct tcb *const tcp, const unsigned int code,
                return RVAL_DECODED;
        }
 
-       return RVAL_DECODED | 1;
+       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 }
index 1be078fb8e2d26ba9efef1514e74bab60baf42b0..f4d4be51975354fcc1aa9655bf37ad498166b87a 100644 (file)
@@ -78,7 +78,7 @@ decode_request(struct tcb *const tcp, const kernel_ulong_t arg)
        if (umoven_or_printaddr(tcp, arg + skip_iid, sizeof(sg_io) - skip_iid,
                                &sg_io.dxfer_direction)) {
                tprints("}");
-               return RVAL_DECODED | 1;
+               return RVAL_DECODED | RVAL_IOCTL_PARSED;
        }
 
        PRINT_FIELD_XVAL("", sg_io, dxfer_direction, sg_io_dxfer_direction,
@@ -117,12 +117,12 @@ decode_response(struct tcb *const tcp, const kernel_ulong_t arg)
                if (entering_sg_io->dxfer_direction == SG_DXFER_FROM_DEV)
                        PRINT_FIELD_PTR(", ", *entering_sg_io, dxferp);
                PRINT_FIELD_PTR(", ", *entering_sg_io, sbp);
-               return 1;
+               return RVAL_IOCTL_PARSED;
        }
 
        if (sg_io.interface_id != entering_sg_io->interface_id) {
                PRINT_FIELD_U(" => ", sg_io, interface_id);
-               return 1;
+               return RVAL_IOCTL_PARSED;
        }
 
        if (sg_io.dxfer_direction == SG_DXFER_FROM_DEV ||
@@ -155,7 +155,7 @@ decode_response(struct tcb *const tcp, const kernel_ulong_t arg)
        PRINT_FIELD_U(", ", sg_io, duration);
        PRINT_FIELD_FLAGS(", ", sg_io, info, sg_io_info, "SG_INFO_???");
 
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 #else /* !HAVE_SCSI_SG_H */
@@ -164,7 +164,7 @@ static int
 decode_request(struct tcb *const tcp, const kernel_ulong_t arg)
 {
        tprints("{interface_id='S', ...}");
-       return RVAL_DECODED | 1;
+       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 }
 
 static int
index 48442f2a61b8d3c5b6e36e23cc21643e835668e1..f3e88f0935ae5dd49483ec7e7a965af7faa051e2 100644 (file)
@@ -64,7 +64,7 @@ decode_request(struct tcb *const tcp, const kernel_ulong_t arg)
        if (umoven_or_printaddr(tcp, arg + skip_iid, sizeof(sg_io) - skip_iid,
                                &sg_io.protocol)) {
                tprints("}");
-               return RVAL_DECODED | 1;
+               return RVAL_DECODED | RVAL_IOCTL_PARSED;
        }
 
        PRINT_FIELD_XVAL("", sg_io, protocol, bsg_protocol, "BSG_PROTOCOL_???");
@@ -111,12 +111,12 @@ decode_response(struct tcb *const tcp, const kernel_ulong_t arg)
                /* print i/o fields fetched on entering syscall */
                PRINT_FIELD_X(", ", *entering_sg_io, response);
                PRINT_FIELD_X(", ", *entering_sg_io, din_xferp);
-               return 1;
+               return RVAL_IOCTL_PARSED;
        }
 
        if (sg_io.guard != entering_sg_io->guard) {
                PRINT_FIELD_U(" => ", sg_io, guard);
-               return 1;
+               return RVAL_IOCTL_PARSED;
        }
 
        PRINT_FIELD_U(", ", sg_io, response_len);
@@ -138,7 +138,7 @@ decode_response(struct tcb *const tcp, const kernel_ulong_t arg)
        PRINT_FIELD_D(", ", sg_io, dout_resid);
        PRINT_FIELD_X(", ", sg_io, generated_tag);
 
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 #else /* !HAVE_LINUX_BSG_H */
@@ -147,7 +147,7 @@ static int
 decode_request(struct tcb *const tcp, const kernel_ulong_t arg)
 {
        tprints("{guard='Q', ...}");
-       return RVAL_DECODED | 1;
+       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 }
 
 static int
diff --git a/sock.c b/sock.c
index c6bb65520a556b440761ec180b99d557f3c6ed05..840b76eaa87a9d042b2ece1dacf5c6985ce33cf5 100644 (file)
--- a/sock.c
+++ b/sock.c
@@ -198,7 +198,7 @@ decode_ifconf(struct tcb *const tcp, const kernel_ulong_t addr)
                        tprints("}");
                }
 
-               return RVAL_DECODED | 1;
+               return RVAL_DECODED | RVAL_IOCTL_PARSED;
        }
 
        if (entering(tcp)) {
@@ -237,7 +237,7 @@ decode_ifconf(struct tcb *const tcp, const kernel_ulong_t addr)
 
        tprints("}");
 
-       return RVAL_DECODED | 1;
+       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 }
 
 MPERS_PRINTER_DECL(int, sock_ioctl,
@@ -371,5 +371,5 @@ MPERS_PRINTER_DECL(int, sock_ioctl,
                return RVAL_DECODED;
        }
 
-       return RVAL_DECODED | 1;
+       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 }
diff --git a/term.c b/term.c
index 9a5d62d9dba6c700ea7e04488f8561904df2ebc7..a52298c90d9d248031ac77902080388faad53b4e 100644 (file)
--- a/term.c
+++ b/term.c
@@ -286,5 +286,5 @@ term_ioctl(struct tcb *const tcp, const unsigned int code,
                return RVAL_DECODED;
        }
 
-       return RVAL_DECODED | 1;
+       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 }
diff --git a/ubi.c b/ubi.c
index 6611bd46cd21218f3fdf759913b7d3ad4ea2ba12..ab4f5ea0cde13b04434401ec6426607ead76b1ad 100644 (file)
--- a/ubi.c
+++ b/ubi.c
@@ -196,5 +196,5 @@ ubi_ioctl(struct tcb *const tcp, const unsigned int code,
                return RVAL_DECODED;
        }
 
-       return RVAL_DECODED | 1;
+       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 }
index 150d98fbde36e5b4b4d49fad53af6fa8a9c5e2ef..94ed20a26aa0663ea6e47b0d33fbeaa297d7a9f6 100644 (file)
@@ -114,7 +114,7 @@ uffdio_ioctl(struct tcb *const tcp, const unsigned int code,
                if (entering(tcp)) {
                        tprints(", ");
                        if (umove_or_printaddr(tcp, arg, &uc))
-                               return RVAL_DECODED | 1;
+                               return RVAL_DECODED | RVAL_IOCTL_PARSED;
                        PRINT_FIELD_X("{", uc, dst);
                        PRINT_FIELD_X(", ", uc, src);
                        PRINT_FIELD_X(", ", uc, len);
@@ -138,7 +138,7 @@ uffdio_ioctl(struct tcb *const tcp, const unsigned int code,
                if (entering(tcp)) {
                        tprints(", ");
                        if (umove_or_printaddr(tcp, arg, &ur))
-                               return RVAL_DECODED | 1;
+                               return RVAL_DECODED | RVAL_IOCTL_PARSED;
                        PRINT_FIELD_UFFDIO_RANGE("{", ur, range);
                        PRINT_FIELD_FLAGS(", ", ur, mode,
                                          uffd_register_mode_flags,
@@ -176,7 +176,7 @@ uffdio_ioctl(struct tcb *const tcp, const unsigned int code,
                if (entering(tcp)) {
                        tprints(", ");
                        if (umove_or_printaddr(tcp, arg, &uz))
-                               return RVAL_DECODED | 1;
+                               return RVAL_DECODED | RVAL_IOCTL_PARSED;
                        PRINT_FIELD_UFFDIO_RANGE("{", uz, range);
                        PRINT_FIELD_FLAGS(", ", uz, mode, uffd_zeropage_flags,
                                          "UFFDIO_ZEROPAGE_???");
@@ -196,6 +196,6 @@ uffdio_ioctl(struct tcb *const tcp, const unsigned int code,
                return RVAL_DECODED;
        }
 
-       return RVAL_DECODED | 1;
+       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 }
 #endif /* HAVE_LINUX_USERFAULTFD_H */
diff --git a/v4l2.c b/v4l2.c
index a025620e769a81f09ec0069f512f9f9d4113ab12..8b839b5732cc4b9834202fddb8af3982d2391ab1 100644 (file)
--- a/v4l2.c
+++ b/v4l2.c
@@ -146,7 +146,7 @@ print_v4l2_capability(struct tcb *const tcp, const kernel_ulong_t arg)
                return 0;
        tprints(", ");
        if (umove_or_printaddr(tcp, arg, &caps))
-               return 1;
+               return RVAL_IOCTL_PARSED;
        PRINT_FIELD_CSTRING("{", caps, driver);
        PRINT_FIELD_CSTRING(", ", caps, card);
        PRINT_FIELD_CSTRING(", ", caps, bus_info);
@@ -162,7 +162,7 @@ print_v4l2_capability(struct tcb *const tcp, const kernel_ulong_t arg)
                   "V4L2_CAP_???");
 #endif
        tprints("}");
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 #include "xlat/v4l2_buf_types.h"
@@ -176,7 +176,7 @@ print_v4l2_fmtdesc(struct tcb *const tcp, const kernel_ulong_t arg)
        if (entering(tcp)) {
                tprints(", ");
                if (umove_or_printaddr(tcp, arg, &f))
-                       return RVAL_DECODED | 1;
+                       return RVAL_DECODED | RVAL_IOCTL_PARSED;
                tprintf("{index=%u, type=", f.index);
                printxval(v4l2_buf_types, f.type, "V4L2_BUF_TYPE_???");
                return 0;
@@ -191,7 +191,7 @@ print_v4l2_fmtdesc(struct tcb *const tcp, const kernel_ulong_t arg)
                print_pixelformat(f.pixelformat);
        }
        tprints("}");
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 #include "xlat/v4l2_fields.h"
@@ -354,14 +354,14 @@ print_v4l2_format(struct tcb *const tcp, const kernel_ulong_t arg,
        if (entering(tcp)) {
                tprints(", ");
                if (umove_or_printaddr(tcp, arg, &f))
-                       return RVAL_DECODED | 1;
+                       return RVAL_DECODED | RVAL_IOCTL_PARSED;
                tprints("{type=");
                printxval(v4l2_buf_types, f.type, "V4L2_BUF_TYPE_???");
                if (is_get)
                        return 0;
                if (!print_v4l2_format_fmt(tcp, ", ", &f)) {
                        tprints("}");
-                       return RVAL_DECODED | 1;
+                       return RVAL_DECODED | RVAL_IOCTL_PARSED;
                }
 
                return 0;
@@ -372,7 +372,7 @@ print_v4l2_format(struct tcb *const tcp, const kernel_ulong_t arg,
 
        tprints("}");
 
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 #include "xlat/v4l2_memories.h"
@@ -386,7 +386,7 @@ print_v4l2_requestbuffers(struct tcb *const tcp, const kernel_ulong_t arg)
                tprints(", ");
 
                if (umove_or_printaddr(tcp, arg, &reqbufs))
-                       return RVAL_DECODED | 1;
+                       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 
                tprintf("{type=");
                printxval(v4l2_buf_types, reqbufs.type, "V4L2_BUF_TYPE_???");
@@ -408,7 +408,7 @@ print_v4l2_requestbuffers(struct tcb *const tcp, const kernel_ulong_t arg)
 
        tprints("}");
 
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 #include "xlat/v4l2_buf_flags.h"
@@ -422,7 +422,7 @@ print_v4l2_buffer(struct tcb *const tcp, const unsigned int code,
        if (entering(tcp)) {
                tprints(", ");
                if (umove_or_printaddr(tcp, arg, &b))
-                       return RVAL_DECODED | 1;
+                       return RVAL_DECODED | RVAL_IOCTL_PARSED;
                tprints("{type=");
                printxval(v4l2_buf_types, b.type, "V4L2_BUF_TYPE_???");
                if (code != VIDIOC_DQBUF)
@@ -456,7 +456,7 @@ print_v4l2_buffer(struct tcb *const tcp, const unsigned int code,
 
        tprints("}");
 
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 static int
@@ -472,7 +472,7 @@ print_v4l2_framebuffer(struct tcb *const tcp, const kernel_ulong_t arg)
                tprints("}");
        }
 
-       return RVAL_DECODED | 1;
+       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 }
 
 static int
@@ -486,7 +486,7 @@ print_v4l2_buf_type(struct tcb *const tcp, const kernel_ulong_t arg)
                printxval(v4l2_buf_types, type, "V4L2_BUF_TYPE_???");
                tprints("]");
        }
-       return RVAL_DECODED | 1;
+       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 }
 
 #include "xlat/v4l2_streaming_capabilities.h"
@@ -501,7 +501,7 @@ print_v4l2_streamparm(struct tcb *const tcp, const kernel_ulong_t arg,
        if (entering(tcp)) {
                tprints(", ");
                if (umove_or_printaddr(tcp, arg, &s))
-                       return RVAL_DECODED | 1;
+                       return RVAL_DECODED | RVAL_IOCTL_PARSED;
                tprints("{type=");
                printxval(v4l2_buf_types, s.type, "V4L2_BUF_TYPE_???");
                switch (s.type) {
@@ -513,12 +513,12 @@ print_v4l2_streamparm(struct tcb *const tcp, const kernel_ulong_t arg,
                                break;
                        default:
                                tprints("}");
-                               return RVAL_DECODED | 1;
+                               return RVAL_DECODED | RVAL_IOCTL_PARSED;
                }
        } else {
                if (syserror(tcp) || umove(tcp, arg, &s) < 0) {
                        tprints("}");
-                       return 1;
+                       return RVAL_IOCTL_PARSED;
                }
                tprints(is_get ? ", " : " => ");
        }
@@ -554,7 +554,7 @@ print_v4l2_streamparm(struct tcb *const tcp, const kernel_ulong_t arg,
        }
        if (exiting(tcp))
                tprints("}");
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 static int
@@ -565,7 +565,7 @@ print_v4l2_standard(struct tcb *const tcp, const kernel_ulong_t arg)
        if (entering(tcp)) {
                tprints(", ");
                if (umove_or_printaddr(tcp, arg, &s))
-                       return RVAL_DECODED | 1;
+                       return RVAL_DECODED | RVAL_IOCTL_PARSED;
                tprintf("{index=%u", s.index);
 
                return 0;
@@ -580,7 +580,7 @@ print_v4l2_standard(struct tcb *const tcp, const kernel_ulong_t arg)
 
        tprints("}");
 
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 #include "xlat/v4l2_input_types.h"
@@ -593,7 +593,7 @@ print_v4l2_input(struct tcb *const tcp, const kernel_ulong_t arg)
        if (entering(tcp)) {
                tprints(", ");
                if (umove_or_printaddr(tcp, arg, &i))
-                       return RVAL_DECODED | 1;
+                       return RVAL_DECODED | RVAL_IOCTL_PARSED;
                tprintf("{index=%u", i.index);
 
                return 0;
@@ -607,7 +607,7 @@ print_v4l2_input(struct tcb *const tcp, const kernel_ulong_t arg)
 
        tprints("}");
 
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 #include "xlat/v4l2_control_ids.h"
@@ -621,7 +621,7 @@ print_v4l2_control(struct tcb *const tcp, const kernel_ulong_t arg,
        if (entering(tcp)) {
                tprints(", ");
                if (umove_or_printaddr(tcp, arg, &c))
-                       return RVAL_DECODED | 1;
+                       return RVAL_DECODED | RVAL_IOCTL_PARSED;
                tprints("{id=");
                printxval(v4l2_control_ids, c.id, "V4L2_CID_???");
                if (!is_get)
@@ -636,7 +636,7 @@ print_v4l2_control(struct tcb *const tcp, const kernel_ulong_t arg,
 
        tprints("}");
 
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 #include "xlat/v4l2_tuner_types.h"
@@ -652,7 +652,7 @@ print_v4l2_tuner(struct tcb *const tcp, const kernel_ulong_t arg,
        if (entering(tcp)) {
                tprints(", ");
                if (umove_or_printaddr(tcp, arg, &c))
-                       return RVAL_DECODED | 1;
+                       return RVAL_DECODED | RVAL_IOCTL_PARSED;
                tprintf("{index=%u", c.index);
                if (is_get)
                        return 0;
@@ -660,7 +660,7 @@ print_v4l2_tuner(struct tcb *const tcp, const kernel_ulong_t arg,
        } else {
                if (syserror(tcp) || umove(tcp, arg, &c) < 0) {
                        tprints("}");
-                       return 1;
+                       return RVAL_IOCTL_PARSED;
                }
                tprints(is_get ? ", " : " => ");
        }
@@ -682,7 +682,7 @@ print_v4l2_tuner(struct tcb *const tcp, const kernel_ulong_t arg,
 
        if (exiting(tcp))
                tprints("}");
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 #include "xlat/v4l2_control_types.h"
@@ -696,12 +696,12 @@ print_v4l2_queryctrl(struct tcb *const tcp, const kernel_ulong_t arg)
        if (entering(tcp)) {
                tprints(", ");
                if (umove_or_printaddr(tcp, arg, &c))
-                       return RVAL_DECODED | 1;
+                       return RVAL_DECODED | RVAL_IOCTL_PARSED;
                tprints("{id=");
        } else {
                if (syserror(tcp) || umove(tcp, arg, &c) < 0) {
                        tprints("}");
-                       return 1;
+                       return RVAL_IOCTL_PARSED;
                }
                if (get_tcb_priv_ulong(tcp))
                        tprints(" => ");
@@ -729,7 +729,7 @@ print_v4l2_queryctrl(struct tcb *const tcp, const kernel_ulong_t arg)
                printflags(v4l2_control_flags, c.flags, "V4L2_CTRL_FLAG_???");
                tprints("}");
        }
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 static int
@@ -740,7 +740,7 @@ print_v4l2_cropcap(struct tcb *const tcp, const kernel_ulong_t arg)
        if (entering(tcp)) {
                tprints(", ");
                if (umove_or_printaddr(tcp, arg, &c))
-                       return RVAL_DECODED | 1;
+                       return RVAL_DECODED | RVAL_IOCTL_PARSED;
                tprints("{type=");
                printxval(v4l2_buf_types, c.type, "V4L2_BUF_TYPE_???");
 
@@ -758,7 +758,7 @@ print_v4l2_cropcap(struct tcb *const tcp, const kernel_ulong_t arg)
 
        tprints("}");
 
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 
 static int
@@ -770,7 +770,7 @@ print_v4l2_crop(struct tcb *const tcp, const kernel_ulong_t arg,
        if (entering(tcp)) {
                tprints(", ");
                if (umove_or_printaddr(tcp, arg, &c))
-                       return RVAL_DECODED | 1;
+                       return RVAL_DECODED | RVAL_IOCTL_PARSED;
                tprints("{type=");
                printxval(v4l2_buf_types, c.type, "V4L2_BUF_TYPE_???");
                if (is_get)
@@ -783,7 +783,7 @@ print_v4l2_crop(struct tcb *const tcp, const kernel_ulong_t arg,
 
        tprints("}");
 
-       return RVAL_DECODED | 1;
+       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 }
 
 #ifdef VIDIOC_S_EXT_CTRLS
@@ -818,14 +818,14 @@ print_v4l2_ext_controls(struct tcb *const tcp, const kernel_ulong_t arg,
        if (entering(tcp)) {
                tprints(", ");
                if (umove_or_printaddr(tcp, arg, &c))
-                       return RVAL_DECODED | 1;
+                       return RVAL_DECODED | RVAL_IOCTL_PARSED;
                tprints("{ctrl_class=");
                printxval(v4l2_control_classes, c.ctrl_class,
                          "V4L2_CTRL_CLASS_???");
                tprintf(", count=%u", c.count);
                if (!c.count) {
                        tprints("}");
-                       return RVAL_DECODED | 1;
+                       return RVAL_DECODED | RVAL_IOCTL_PARSED;
                }
                if (is_get)
                        return 0;
@@ -833,7 +833,7 @@ print_v4l2_ext_controls(struct tcb *const tcp, const kernel_ulong_t arg,
        } else {
                if (umove(tcp, arg, &c) < 0) {
                        tprints("}");
-                       return 1;
+                       return RVAL_IOCTL_PARSED;
                }
                tprints(is_get ? ", " : " => ");
        }
@@ -850,7 +850,7 @@ print_v4l2_ext_controls(struct tcb *const tcp, const kernel_ulong_t arg,
 
        if (exiting(tcp) || fail) {
                tprints("}");
-               return RVAL_DECODED | 1;
+               return RVAL_DECODED | RVAL_IOCTL_PARSED;
        }
 
        /* entering */
@@ -869,7 +869,7 @@ print_v4l2_frmsizeenum(struct tcb *const tcp, const kernel_ulong_t arg)
        if (entering(tcp)) {
                tprints(", ");
                if (umove_or_printaddr(tcp, arg, &s))
-                       return RVAL_DECODED | 1;
+                       return RVAL_DECODED | RVAL_IOCTL_PARSED;
                tprintf("{index=%u, pixel_format=", s.index);
                print_pixelformat(s.pixel_format);
                return 0;
@@ -894,7 +894,7 @@ print_v4l2_frmsizeenum(struct tcb *const tcp, const kernel_ulong_t arg)
                }
        }
        tprints("}");
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 #endif /* VIDIOC_ENUM_FRAMESIZES */
 
@@ -909,7 +909,7 @@ print_v4l2_frmivalenum(struct tcb *const tcp, const kernel_ulong_t arg)
        if (entering(tcp)) {
                tprints(", ");
                if (umove_or_printaddr(tcp, arg, &f))
-                       return RVAL_DECODED | 1;
+                       return RVAL_DECODED | RVAL_IOCTL_PARSED;
                tprintf("{index=%u, pixel_format=", f.index);
                print_pixelformat(f.pixel_format);
                tprintf(", width=%u, height=%u", f.width, f.height);
@@ -938,7 +938,7 @@ print_v4l2_frmivalenum(struct tcb *const tcp, const kernel_ulong_t arg)
 
        tprints("}");
 
-       return 1;
+       return RVAL_IOCTL_PARSED;
 }
 #endif /* VIDIOC_ENUM_FRAMEINTERVALS */
 
@@ -954,7 +954,7 @@ print_v4l2_create_buffers(struct tcb *const tcp, const kernel_ulong_t arg)
        if (entering(tcp)) {
                tprints(", ");
                if (umove_or_printaddr(tcp, arg, &b))
-                       return RVAL_DECODED | 1;
+                       return RVAL_DECODED | RVAL_IOCTL_PARSED;
                tprintf("{count=%u, memory=", b.count);
                printxval(v4l2_memories, b.memory, "V4L2_MEMORY_???");
                tprints(", format={type=");
@@ -967,12 +967,12 @@ print_v4l2_create_buffers(struct tcb *const tcp, const kernel_ulong_t arg)
        }
 
        if (syserror(tcp) || umove(tcp, arg, &b))
-               return 1;
+               return RVAL_IOCTL_PARSED;
 
        sprintf(outstr, fmt, b.index, b.count);
        tcp->auxstr = outstr;
 
-       return 1 | RVAL_STR;
+       return RVAL_IOCTL_PARSED | RVAL_STR;
 }
 #endif /* VIDIOC_CREATE_BUFS */
 
@@ -1086,5 +1086,5 @@ MPERS_PRINTER_DECL(int, v4l2_ioctl, struct tcb *const tcp,
                return RVAL_DECODED;
        }
 
-       return RVAL_DECODED | 1;
+       return RVAL_DECODED | RVAL_IOCTL_PARSED;
 }