4086 Commits

Author SHA1 Message Date
e0ba92016b Fix some compilation warnings on older systems
* print_statfs.c (print_statfs_flags): Define only
for [HAVE_STRUCT_STATFS_F_FLAGS || HAVE_STRUCT_STATFS64_F_FLAGS].
* tests/inet-cmsg.c (print_origdstaddr): Define only
for [IP_ORIGDSTADDR].
2016-05-18 09:26:01 +00:00
9164722af0 Update generic ioctl entries from linux 4.6
* linux/64/ioctls_inc.h: Update from linux v4.6 using ioctls_gen.sh.
* linux/32/ioctls_inc_align32.h: Likewise.
* linux/32/ioctls_inc_align64.h: Likewise.
* NEWS: Mention this.
2016-05-18 09:26:01 +00:00
d07201aeef maint: update for linux 4.6
* maint/ioctls_sym.sh: Update workarounds for linux/kvm.h.
2016-05-18 09:26:01 +00:00
a9fdbf1d59 Update SOL_* constants
* xlat/socketlayers.in: Add SOL_KCM.
2016-05-18 09:26:01 +00:00
85acd1304e Update MSG_* constants
* xlat/msg_flags.in: Add MSG_BATCH.
2016-05-18 09:26:01 +00:00
72712cbc58 Update AF_* constants
* xlat/addrfams.in: Add AF_KCM.
2016-05-18 09:26:01 +00:00
Fei Jie
854a25930c tests: add brk.test
* tests/brk.c: New file.
* tests/brk.test: New test.
* tests/.gitignore: Add brk.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add brk.test.
2016-05-17 10:53:03 +00:00
9b8ca23cc0 Fix printing of invalid arguments of term ioctls
* term.c (term_ioctl): Print arguments of TCXONC and TCFLSH ioctls
using printxval_long.
2016-05-17 08:03:58 +00:00
29c845ca85 mips: fix printing of invalid operations argument of sysmips syscall
* sysmips.c (SYS_FUNC(sysmips)): Print 1st argument of syscall using
printxval_long.
2016-05-17 08:03:58 +00:00
5e2fc6228e bfin: fix printing of invalid flags argument of sram_alloc syscall
* sram_alloc.c (SYS_FUNC(sram_alloc)): Print 2nd argument using
printflags_long.
2016-05-17 08:03:58 +00:00
c5f6863a18 Fix printing of invalid arguments of prctl syscall
* prctl.c (SYS_FUNC(prctl)): Print 2nd syscall argument
of PR_CAPBSET_DROP, PR_CAPBSET_READ, PR_CAP_AMBIENT, PR_MCE_KILL,
and PR_SET_SECCOMP using printxval_long.
Print 2nd syscall argument of PR_SET_SECUREBITS using printflags_long.
Print 3rd syscall argument of PR_CAP_AMBIENT and PR_MCE_KILL using
printxval_long.
* tests/prctl-seccomp-strict.c (main): Update.
2016-05-16 23:50:59 +00:00
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