aboutsummaryrefslogtreecommitdiff
path: root/capability.c
AgeCommit message (Collapse)Author
2017-02-15Upgrade strace to 4.16 from 4.14.Elliott Hughes
Noteworthy changes in release 4.16 (2017-02-14) * Improvements * Implemented syscall return value injection (-e inject=SET:retval= option). * Implemented signal injection (-e inject=SET:signal= option). * Implemented decoding of SUID_DUMP_* constants in PR_[GS]ET_DUMPABLE. * Implemented decoding of all SG_* ioctl commands. * Implemented decoding of ustat syscall. * Implemented decoding of BPF_OBJ_PIN, BPF_OBJ_GET, BPF_PROG_ATTACH, and BPF_PROG_DETACH commands of bpf syscall. * Enhanced decoding of sg_io_hdr and sg_io_v4 structures. * Enhanced decoding of get_robust_list, getrandom, io_submit, set_robust_list syscalls. * Enhanced decoding of entities of kernel long type on x32 and mips n32 ABIs. * Updated lists of IP_*, IPV6_*, and LOOP_* constants. * Updated lists of ioctl commands from Linux 4.10. * Added decoding of recently added syscalls on avr32, microblaze, ppc, and ppc64. * Bug fixes * Fixed pathmatch of oldselect syscall on 64-bit architectures. * Fixed decoding of mmap2 syscall on s390 when arguments are not available. * Fixed decoding of kexec_file_load, mprotect, pkey_mprotect, prctl, preadv*, and pwritev* syscalls on x32. * Fixed printing of string arguments of getxattr and setxattr syscalls when -s option is used to limit the printed string size. * Fixed decoding of ifconf, ifreq, and loop_info structures on non-native personalities. * Fixed decoding of SG_* and LOOP_* ioctl commands. * Fixed build on mips with musl libc. * Fixed cross-building of ioctlsort. * Applied minor formatting fixes to the manual page. Noteworthy changes in release 4.15 (2016-12-14) * Changes in behavior * Time stamps are now printed according to ISO 8601. * Changed output format of val3 parameter of futex FUTEX_WAKE_OP operation. * The last argument of mincore, sched_getaffinity, and sched_setaffinity syscalls is now formatted as an array. * Improvements * Implemented syscall fault injection (-e fault=... option). * Implemented decoding of DM_* ioctl commands. * Implemented decoding of attr parameter of perf_event_open syscall. * Implemented decoding of pkey_alloc, pkey_free, and pkey_mprotect syscalls. * Implemented dumping of mq_timedsend and mq_timedreceive syscalls. * Implemented decoding of PR_SET_FP_MODE and PR_GET_FP_MODE operations of prctl syscall. * Implemented PTRACE_GETREGS API support on m68k. * Updated lists of ARCH_*, BPF_*, BTRFS_*, FALLOC_*, MS_*, *_MAGIC, and V4L2_* constants. * Updated lists of ioctl commands from Linux 4.9. * Added decoding of recently added syscalls on arc, x32, and xtensa. * Enhanced manual page. * Bug fixes * Fixed corner cases in decoding of exit, exit_group, futimesat, getgroups, getresuid, init_module, inotify_init1, kcmp, kexec_load, lookup_dcookie, mq_getsetattr, mq_notify, mq_open, mq_timedreceive, mq_timedsend, name_to_handle_at, prctl, process_vm_readv, process_vm_writev, setfsuid, setgroups, setns, unshare, and utimes syscalls. * Fixed handling of verbose flag in printing of controls array of struct v4l2_ext_controls. * Fixed omission of field names in the output of capability, sigaction, sigevent, statfs, timespec, timeval, and utimbuf structures. * Fixed printing of unknown syscalls in siginfo structure. * Fixed decoding of ioctl constants on m68k. * Fixed cris architecture support. * Fixed cross build when host compiler does not support the same set of warning flags as the cross compiler. * Fixed build on SLE10 and SLE11. Bug: N/A Test: manual Change-Id: I590bf5db1652aa1dfdc0eb16e30fd97c82af2261
2015-12-17Add copyright headers to some files which lack themDmitry V. Levin
Before this change, all files that exist since 20th century had copyright headers, while most files that appeared later didn't. This change fixes the inconsistency by adding missing copyright headers. It doesn't mean that copyright headers became maintained. In my view, git history provides much better information on this subject and is much more accurate than copyright headers.
2015-07-20capability.c: make use of RVAL_DECODEDDmitry V. Levin
* capability.c (sys_capset): Update for RVAL_DECODED.
2015-07-20capability.c: use printaddr and umove_or_printaddrDmitry V. Levin
* capability.c (get_cap_header): Use printaddr. (print_cap_data): Use printaddr and umove_or_printaddr.
2015-04-07Declare syscall parsers using SYS_FUNC macroDmitry V. Levin
Introduce SYS_FUNC macro to declare and define all syscall parsers. * Makefile.am (BUILT_SOURCES, CLEANFILES): Add sys_func.h. (sys_func.h): New rule. * defs.h (SYS_FUNC_NAME, SYS_FUNC): New macros. * linux/syscall.h: Include "sys_func.h". [NEED_UID16_PARSERS]: Use SYS_FUNC to declare uid16 syscall parsers. Remove other declarations. * linux/alpha/syscallent.h (160, 161): Add sys_ prefix to osf_statfs and osf_fstatfs syscall parsers. * *.c: Use SYS_FUNC to define syscall parsers.
2015-03-21Change last parameter of umoven() from char* to void*Denys Vlasenko
Saves tons of casts. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2015-02-19Move CAP_* definitions out to header filesDmitry V. Levin
* Makefile.am (strace_SOURCES): Add caps0.h and caps1.h. * caps0.h: New file. * caps1.h: New file. * capability.c: Remove CAP_* definitions, include "caps0.h" and "caps1.h" instead. Include "xlat/cap_mask0.h" instead of "xlat/capabilities.h". Include "xlat/cap_mask1.h" instead of "xlat/capabilities1.h". (print_cap_bits): Update callers. * xlat/capabilities.in: Rename to xlat/cap_mask0.in. * xlat/capabilities1.in: Rename to xlat/cap_mask1.in.
2014-12-06Implement full decoding of 64-bit capabilitiesDmitry V. Levin
Unlike v1 capabilities which are 32-bit, v2 and v3 are 64-bit, but before this change only lower 32 capability bits were decoded for v2 and v3. * xlat/capabilities1.in: New file. * capability.c: Define v2/v3 CAP_* constants. Include xlat/capabilities1.h. (get_cap_header): New function. (print_cap_header): Update to use get_cap_header result. (print_cap_data): Decoder higher capability bits for v2 and v3. (sys_capget, sys_capset): Use get_cap_header, update print_cap_header and print_cap_data calls. * tests/caps.c: New file. * tests/caps.awk: New file. * tests/caps.test: New test. * tests/Makefile.am (CHECK_PROGRAMS): Add caps. (TESTS): Add caps.test. (EXTRA_DIST): Add caps.awk.
2014-12-06Make parsers of capget and capset syscalls self-containedDmitry V. Levin
Various versions of <linux/capability.h> used to require different workarounds to avoid conflicts with types defined by libc headers. Define all required types and constants locally to fix this issue. * configure.ac (AC_CHECK_HEADERS): Remove linux/capability.h. * capability.c: Do not include <linux/capability.h>, remove workarounds for problematic versions of <linux/capability.h> file. Define CAP_* and _LINUX_CAPABILITY_VERSION_* constants as enums. (struct __user_cap_header_struct, struct __user_cap_data_struct): Define. * xlat/cap_version.in: Add #unconditional. * xlat/capabilities.in: Likewise.
2014-12-04Move capget and capset parsers to a separate fileDmitry V. Levin
* capability.c: New file. * Makefile.am (strace_SOURCES): Add it. * system.c: Move inclusion of headers and macro definitions related to capget and capset decoding to capability.c. (print_cap_header, print_cap_data, sys_capget, sys_capset): Move to capability.c.