4275 Commits

Author SHA1 Message Date
a95c3e515f Fix printing of invalid flags argument of perf_event_open syscall
* numa.c (SYS_FUNC(perf_event_open)): Print 5th argument of syscall
using printflags_long.
2016-05-16 23:48:05 +00:00
30dc5418a3 or1k: fix printing of invalid 1st argument of or1k_atomic syscall
* or1k_atomic.c (SYS_FUNC(or1k_atomic)): Print 1st argument using
printxval_long.
2016-05-16 23:48:05 +00:00
0da9b0e3b2 Fix printing of invalid flags argument of get_mempolicy syscall
* numa.c (SYS_FUNC(get_mempolicy)): Print 5th argument of syscall
using printxval_long.
2016-05-16 23:48:05 +00:00
3a0fa5c619 Fix printing of invalid mode argument of mbind syscall
* numa.c (SYS_FUNC(mbind)): Print 3rd argument of syscall
using printxval_long.
* tests/mbind.c (main): Update.
2016-05-16 23:48:05 +00:00
942da9c895 Fix printing of invalid argument of MTDFILEMODE ioctl
* mtd.c (mtd_ioctl): Print 3rd argument of MTDFILEMODE ioctl
using printflags_long.
2016-05-16 23:48:05 +00:00
412ec9480c Fix printing of invalid flags argument of mount syscall
* mount.c (SYS_FUNC(mount)): Print 1st argument using printflags_long.
2016-05-16 23:48:05 +00:00
1168114879 Fix printing of invalid arguments of memory mapping related syscalls
* mem.c (print_mmap): Print 3rd and 4th arguments of syscall
using printflags_long.
(SYS_FUNC(mprotect)): Print 3rd argument of syscall using
printflags_long.
(SYS_FUNC(mremap)): Print 4th argument of syscall using printflags_long.
(SYS_FUNC(remap_file_pages)): Print 3rd and 4th arguments of syscall
using printflags_long.
* tests/remap_file_pages.c (main): Update.
2016-05-16 23:47:34 +00:00
e2c5a3c60e Fix printing of invalid flags argument of kexec_load and kexec_file_load
* kexec.c (SYS_FUNC(kexec_load), SYS_FUNC(kexec_file_load)): Print
flags argument using printflags_long.
2016-05-16 22:54:41 +00:00
c560c80aa0 Fix printing of invalid 3rd argument of fcntl/fcntl64 syscall
* fcntl.c (print_fcntl): Print 3rd argument of F_NOTIFY, F_SETLEASE, and
F_ADD_SEALS operations using printflags_long.
2016-05-16 22:52:04 +00:00
d06fa28b0e Fix printing of invalid flags argument of unshare syscall
* clone.c (SYS_FUNC(unshare)): Print 1st argument using printflags_long.
2016-05-16 22:49:54 +00:00
77ab8dd0bd Introduce printflags_long and printxval_long
* defs.h (printflags_long, printxval_long): New static inline functions.
2016-05-16 22:44:50 +00:00
f77ca9ca71 Fix printing of invalid struct xfs_dqblk.d_flags
* quota.c (decode_cmd_data): Explicitly cast struct xfs_dqblk.d_flags
to uint8_t to avoid potential sign-extension bug when printing
invalid struct xfs_dqblk.d_flags.
2016-05-16 22:41:20 +00:00
2cad72f489 Fix printing of invalid struct ubi_mkvol_req.vol_type
* mtd.c (ubi_ioctl): Explicitly cast struct ubi_mkvol_req.vol_type
to unsigned short to avoid potential sign-extension bug when printing
invalid struct ubi_mkvol_req.vol_type.
2016-05-16 22:41:20 +00:00
b8eec608fa Fix decoding of prctl/arch_prctl operation argument
Consistently treat operation argument of prctl/arch_prctl syscalls
as int to match the kernel behaviour.

* prctl.c (SYS_FUNC(prctl), SYS_FUNC(arch_prctl)): Assign 1st argument
of syscalls to a variable of type unsigned int and use it in all
subsequent checks and lookups.
2016-05-16 22:41:20 +00:00
ba62f34243 Fix printing of struct sched_attr.sched_flags
* sched.c (print_sched_attr): Print sched_flags using printflags64.
2016-05-16 22:41:19 +00:00
e9dd8f9406 Fix printing of struct statfs.f_flags
* print_statfs.c (print_statfs_flags): Print flags using printflags64.
2016-05-16 22:41:19 +00:00
b0695de14f Fix printing of invalid struct ifreq.ifr_flags
* sock.c (print_ifreq): Explicitly cast struct ifreq.ifr_flags
to unsigned short to avoid potential sign-extension bug when printing
invalid struct ifreq.ifr_flags.
2016-05-16 22:41:19 +00:00
952d89ba5a Fix printing of invalid struct pollfd.events
* poll.c (print_pollfd): Explicitly cast struct pollfd.events
to unsigned short to avoid potential sign-extension bug when printing
invalid struct pollfd.events.
2016-05-16 22:41:19 +00:00
977aee82bf Fix printing of invalid struct sembuf.sem_flg
* ipc_sem.c (print_sembuf): Explicitly cast struct sembuf.sem_flg
to unsigned short to avoid potential sign-extension bug when printing
invalid struct sembuf.sem_flg.
2016-05-16 22:41:19 +00:00
a734a97d0e Fix printing of invalid l_type and l_whence in fcntl/fcntl64 syscalls
* fcntl.c (print_struct_flock64): Explicitly cast l_type and l_whence
fields to unsigned short to avoid potential sign-extension bug when
printing invalid l_type or l_whence fields.
2016-05-16 22:41:19 +00:00
6e381c67fd Fix printing of fanotify_mark mask argument
* fanotify.c (SYS_FUNC(fanotify_mark)): Print mask using printflags64.
2016-05-16 22:41:17 +00:00
55044d9670 Fix decoding of epoll_ctl operation argument
Consistently treat operation argument of epoll_ctl syscall as int
to match the kernel behaviour.

* epoll.c (SYS_FUNC(epoll_ctl)): Assign 2nd argument of syscall
to a variable of type unsigned int and use it in all subsequent
checks and lookups.
* tests/epoll_ctl.c (invoke_syscall): New function.
(main): Use it.
2016-05-16 21:47:09 +00:00
7fb984e27e Fix printing of invalid d_type in getdents syscall
* dirent.c (SYS_FUNC(getdents)): Treat d_type as unsigned char to avoid
potential sign-extension bug when printing invalid d_type.
2016-05-16 21:47:09 +00:00
2eb56d1906 bfin: fix decoding of cacheflush syscall
* cacheflush.c (SYS_FUNC(cacheflush)): Print 2nd argument
using %lu format.  Print 3rd argument as flags.
2016-05-16 21:47:09 +00:00
18d921da6d Fix decoding of BPF_MAP_UPDATE_ELEM flags
* bpf.c (bpf_map_update_elem): Print attr.flags using printxval64.
2016-05-16 21:47:09 +00:00
77086594ce Fix decoding of fcntl/fcntl64 operation argument
Consistently treat operation argument of fcntl/fcntl64 syscalls as int
to match the kernel behaviour.

* fcntl.c (print_fcntl, SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Assign
2nd argument of syscall to a variable of type unsigned int
and use it in all subsequent checks and lookups.
* tests/struct_flock.c (invoke_test_syscall): New function.
(test_flock_einval, test_flock): Use it.
* tests/fcntl.c (test_flock64_einval): Use it.
* tests/fcntl64.c (test_flock64_einval, test_flock64): Use it.
2016-05-16 21:46:48 +00:00
4811023e74 Rename sprintflags64 to sprintflags.
* defs.h (sprintflags): Remove.
(sprintflags64): Rename to sprintflags.
* util.c (sprintflags64): Rename to sprintflags.
2016-05-15 14:26:03 +00:00
6274ecc752 Prepare for transition from sprintflags64 to sprintflags
* fcntl.c (print_fcntl): Cast 3rd argument of sprintflags
to unsigned long.
* membarrier.c (SYS_FUNC(membarrier)): Likewise.
* prctl.c (SYS_FUNC(prctl)): Likewise.
* poll.c (decode_poll_exiting): Cast 3rd argument of sprintflags
to unsigned short.
2016-05-15 14:23:06 +00:00
c0db59b97b Rename xlookup64 to xlookup
* defs.h (xlookup): Remove.
(xlookup64): Rename to xlookup.
* util.c (xlookup64): Rename to xlookup.
2016-05-14 22:05:09 +00:00
9134aab407 Prepare for transition from xlookup64 to xlookup
* fcntl.c (print_fcntl, SYS_FUNC(fcntl), SYS_FUNC(fcntl64)):
Cast 2nd argument of xlookup to unsigned long.
* prctl.c (SYS_FUNC(prctl)): Likewise.
* sched.c (SYS_FUNC(sched_getscheduler)): Likewise.
* time.c (do_adjtimex): Likewise.
* ioprio.c (sprint_ioprio): Change type of the argument
and local variables from int to unsigned int.
* keyctl.c (print_keyring_serial_number): Cast 2nd argument
of xlookup to unsigned int.
* net.c (tprint_sock_type): Change type of the argument to unsigned int.
* printmode.c (sprintmode): Likewise.
* printsiginfo.c (printsigval):  Change type of si_code argument
to unsigned int.
2016-05-14 22:05:06 +00:00
a8443f8695 v4l2: fix build with old kernel headers
Prior to v2.6.25-rc3, <linux/videodev2.h> didn't include all
required headers, resulting to omission of V4L2_* constants.

This issue doesn't arise in v4l2.c and tests/ioctl_v4l2.c files
because they already include all necessary headers themselves.

* configure.ac (AC_CHECK_DECLS): Include <sys/time.h>, <linux/ioctl.h>,
and <linux/types.h> before <linux/videodev2.h>.
2016-05-14 00:36:27 +00:00
3cc989e7fc configure.ac: do not check for sys/ioctl.h and ioctls.h
Since sys/ioctl.h is included unconditionally when needed
and ioctls.h doesn't exist, these checks are redundant.

* configure.ac (AC_CHECK_HEADERS): Remove ioctls.h and sys/ioctl.h.
2016-05-13 22:09:40 +00:00
deff569f41 sock.c: include <linux/ioctl.h> instead of <sys/ioctl.h> or <ioctls.h>
Include <linux/ioctl.h> for <linux/sockios.h> on alpha, sh, and sh64
architectures because their <asm/sockios.h> use _IOR and _IOW macros
but don't include anything that would define these macros.

Being a wrapper around <linux/ioctl.h>, <sys/ioctl.h> brings
no benefits in this case.  <ioctls.h> simply doesn't exist.

* sock.c [ALPHA || SH || SH64]: Include <linux/ioctl.h>
instead of <sys/ioctl.h> or <ioctls.h>.
2016-05-13 22:09:40 +00:00
fe3de9c601 v4l2: include <linux/ioctl.h> instead of <sys/ioctl.h>
Being a wrapper around <linux/ioctl.h>, <sys/ioctl.h> brings
no benefits for parser of VIDIOC_* ioctls.

* v4l2.c: Include <linux/ioctl.h> instead of <sys/ioctl.h>.
2016-05-13 22:09:40 +00:00
f9199ab081 printsiginfo: remove "verbose" argument
Remove erroneous use of verbose(tcp) as a printing limit
for already fetched members of siginfo_t structure.

* printsiginfo.h (printsiginfo): Remove boolean argument.
* printsiginfo.c (printsigval): Remove boolean argument, print
si_int and si_ptr members unconditionally.  All callers changed.
(print_si_info): Remove boolean argument, print si_utime and si_stime
members unconditionally.  All callers changed.
(printsiginfo): Remove boolean argument.  All callers changed.
2016-05-13 22:09:07 +00:00
602998be62 tests/ptrace.c: tweak magic constants to make the test more reliable
* tests/ptrace.c (main): Change bad_request and bad_data to make they
lower 32-bit parts closer to -1U.
2016-05-13 09:37:10 +00:00
98f632a14c tests/ioctl_v4l2.c: fix build on older systems
Fix build on systems without HAVE_DECL_V4L2_CTRL_TYPE_STRING or
V4L2_CTRL_CLASS_CAMERA.

* tests/ioctl_v4l2.c (main) [VIDIOC_S_EXT_CTRLS]: Disable part of the
test if [!HAVE_DECL_V4L2_CTRL_TYPE_STRING].
Replace V4L2_CTRL_CLASS_CAMERA with V4L2_CTRL_CLASS_USER.
2016-05-13 05:18:42 +00:00
f2f162e89c Do not use htole32 function
htole32 function is not portable enough.

* v4l2.c (print_pixelformat): Rewrite initialization of pixel format
union without using of htole32.
* tests/ioctl_v4l2.c (main): Likewise.
2016-05-13 05:18:42 +00:00
09de43b39d tests/ioctl_v4l2.c: fix typo
* tests/ioctl_v4l2.c (main)
[!HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE]: Fix typo in expected
output string.
2016-05-13 05:18:42 +00:00
632efff900 tests: check decoding of ptrace syscall
* tests/ptrace.c: New file.
* tests/ptrace.test: New test.
* tests/.gitignore: Add ptrace.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add ptrace.
2016-05-13 05:18:41 +00:00
76b4c33c7f ptrace: decode data argument of PTRACE_PEEKSIGINFO request
The data argument of PTRACE_PEEKSIGINFO request is a pointer
to siginfo_t array.

* printsiginfo.c (print_siginfo_t): New function.
(print_siginfo_array): New mpers printer.
* process.c (SYS_FUNC(ptrace)): Print data argument of
PTRACE_PEEKSIGINFO request using print_siginfo_array.
2016-05-13 02:36:14 +00:00
d9fb4a434d ptrace: decode data argument of PTRACE_SECCOMP_GET_FILTER request
* process.c (SYS_FUNC(ptrace)): Print data argument of
PTRACE_SECCOMP_GET_FILTER request on exiting using print_seccomp_fprog.
2016-05-13 01:39:41 +00:00
846f617805 ptrace: decode argument of PTRACE_GETEVENTMSG request
* process.c (SYS_FUNC(ptrace)): Print data argument of
PTRACE_GETEVENTMSG request on exiting using printnum_ulong.
2016-05-13 01:39:41 +00:00
1634de70b2 ptrace: decode arguments of PTRACE_[GS]ETSIGMASK requests
* process.c (SYS_FUNC(ptrace)): Print arguments of PTRACE_GETSIGMASK
and PTRACE_SETSIGMASK requests using print_sigset_addr_len.
2016-05-13 01:39:41 +00:00
8bd7f3155c ptrace: return RVAL_DECODED for requests decoded on entering
* process.c (SYS_FUNC(ptrace)): Return RVAL_DECODED on entering for all
ptrace requests except those that are partially decoded in exiting,
2016-05-13 01:39:39 +00:00
388aca6472 ptrace: print PTRACE_O_* flags using printflags64
As flags argument has a long integer type, print it using printflags64
because printflags takes unsigned int argument.

* process.c (SYS_FUNC(ptrace)): Print PTRACE_O_* flags
using printflags64.
2016-05-12 16:35:54 +00:00
7c8e3302ea ptrace: print data argument of PTRACE_SEIZE et al requests as flags
* process.c (SYS_FUNC(ptrace)): Print data argument of
PTRACE_SEIZE and PTRACE_OLDSETOPTIONS as PTRACE_O_* flags.
2016-05-12 15:53:28 +00:00
caa2bc3873 ptrace: print data argument of PTRACE_SINGLEBLOCK et al requests as signo
* process.c (SYS_FUNC(ptrace)): Print data argument of
PTRACE_SINGLEBLOCK, PTRACE_SYSEMU, and PTRACE_SYSEMU_SINGLESTEP requests
as a signal number.
2016-05-12 15:50:43 +00:00
809ee3e46c ptrace: decode addr argument of PTRACE_PEEKSIGINFO request
The addr argument of PTRACE_PEEKSIGINFO request is a pointer to
a struct ptrace_peeksiginfo_args.

* process.c: Include "xlat/ptrace_peeksiginfo_flags.h".
(SYS_FUNC(ptrace)): Print addr argument of PTRACE_PEEKSIGINFO request
as a struct ptrace_peeksiginfo_args.
* xlat/ptrace_peeksiginfo_flags.in: New file.
2016-05-12 15:45:24 +00:00
3a5cd34e34 ptrace: fix printing addr argument of PTRACE_GETSIGMASK et al requests
For PTRACE_GETSIGMASK and PTRACE_SETSIGMASK requests, addr argument
contains the size of the buffer pointed to by data argument.
For PTRACE_SECCOMP_GET_FILTER request, addr argument contains
an offset counter.

* process.c (SYS_FUNC(ptrace)): Print addr argument of
PTRACE_GETSIGMASK, PTRACE_SETSIGMASK, and PTRACE_SECCOMP_GET_FILTER
requests using %lu format.
2016-05-12 15:38:35 +00:00