Commit Graph

4094 Commits

Author SHA1 Message Date
4bf7ab7005 Remove redundant declaration of v4l2_ioctl
There is no need to declare mpers printers in defs.h because
they are already declared in printers.h or native_printer_decls.h.

This complements commit 1e56814f77.

* defs.h (v4l2_ioctl): Remove.
2016-05-20 22:47:39 +00:00
7b6979701b Fix one more code pattern that might break gcc strict aliasing rules
* socketutils.c (receive_responses): Turn static buffer into a union
to avoid breaking of gcc strict aliasing rules.
* tests/netlink_inet_diag.c (check_responses): Likewise.
* tests/netlink_netlink_diag.c (check_responses): Likewise.
* tests/netlink_unix_diag.c (check_responses): Likewise.
2016-05-21 09:33:12 +00:00
Fabien Siron
28e955d747 tests: add check for netlink protocol decoding with -yy option
* tests/netlink_netlink_diag.c: New file.
* tests/net-yy-netlink.c: New file.
* tests/net-yy-netlink.test: New test.
* tests/.gitignore: Add net-yy-netlink and netlink_netlink_diag
* tests/Makefile.am (check_PROGRAMS): Likewise.
(TESTS): Add net-yy-netlink.test.
2016-05-21 09:32:52 +00:00
Fabien Siron
814c0d575d Add netlink domain sockets support to socketutils
* linux/netlink_diag.h: New file.
* Makefile.am (EXTRA_DIST): Add it.
* socketutils.c: Include it and "xlat/netlink_protocols.h".
(netlink_send_query, netlink_parse_response, netlink_print): New
functions.
(print_sockaddr_by_inode): Hook up netlink_print.
2016-05-18 22:02:48 +00:00
ff2b853e7f tests/pread64-pwrite64.c: robustify against os specific issues
Do not assume that pwrite64 syscall fails when only part of the
specified memory buffer is accessible.  With some kernels, one
accessible byte at the end of page is enough for pwrite64 syscall
to return 1.

* tests/pread64-pwrite64.c (main): Tweak the test that can lead
to a partial write.
2016-05-18 09:26:01 +00:00
a8e820586e tests/read-write.c: robustify against os specific issues
Do not assume that write syscall fails when only part of the specified
memory buffer is accessible.  With some kernels, one accessible byte
at the end of page is enough for write syscall to return 1.

* tests/read-write.c (main): Tweak the test that can lead to a partial
write.
2016-05-18 09:26:01 +00:00
af09d4f4fa umovestr3.test: extend test coverage
* tests/umovestr3.c: Include <sys/param.h>.
(main): Test with each number between PATH_MAX-1 and 0.
2016-05-18 09:26:01 +00:00
81f1b1689a tests/timer_create.c: robustify against os specific issues
* tests/timer_create.c (main): Do not assume any specific error code
returned by timer_create, print whatever it is.
2016-05-18 09:26:01 +00:00
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