History log of /external/strace/prctl.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
d35df493b4e7684c50d2d2fa032ee3a7ac228009 16-Feb-2017 Elliott Hughes <enh@google.com> Upgrade strace to 4.16 from 4.14.

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
/external/strace/prctl.c
c5f6863a18976ed448026c6673517e24ffa29fc3 17-May-2016 Dmitry V. Levin <ldv@altlinux.org> 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.
/external/strace/prctl.c
b8eec608faee56727da2d4b81317064a0f6851f3 17-May-2016 Dmitry V. Levin <ldv@altlinux.org> 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.
/external/strace/prctl.c
6274ecc75223ea05abe838b3936b0616210f3a23 15-May-2016 Dmitry V. Levin <ldv@altlinux.org> 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.
/external/strace/prctl.c
9134aab4073a8be6bb529aeb05e8c5f4be69540f 14-May-2016 Dmitry V. Levin <ldv@altlinux.org> 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.
/external/strace/prctl.c
612368b59e7517a34ff23a319329962b6a25c88c 06-Apr-2016 Elliott Hughes <enh@google.com> Improve decoding of Android's PR_SET_VMA prctl

Before:

prctl(0x53564d41 /* PR_??? */, 0, 0x7f8ab53000, 4096,
"atexit handlers") = 0

After:

prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, 0x7fa8cbd000, 4096,
"atexit handlers") = 0

* prctl.c (SYS_FUNC(prctl)) [__ANDROID__]: Do not define PR_SET_VMA.
* Hard-code PR_SET_VMA_ANON_NAME, the only current sub-option.
* xlat/prctl_options.in: Add PR_SET_VMA.
/external/strace/prctl.c
38a34c9349267c99ce1ddbd0b6e985147415d355 17-Dec-2015 Dmitry V. Levin <ldv@altlinux.org> Add copyright headers to some files which lack them

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.
/external/strace/prctl.c
eb76c4be150102e5ddf2f2cf90673d8d7cda9afd 06-Dec-2015 Dmitry V. Levin <ldv@altlinux.org> prctl: add PR_CAP_AMBIENT parser

* xlat/pr_cap_ambient.in: New file.
* prctl.c: Include "xlat/pr_cap_ambient.h".
(SYS_FUNC(prctl)): Handle PR_CAP_AMBIENT.
/external/strace/prctl.c
1b283307d1a6ffbeb14aa8f76f85ddf506c568de 06-Dec-2015 Dmitry V. Levin <ldv@altlinux.org> prctl: finish decoding of several commands on entering syscall

* prctl.c (SYS_FUNC(prctl)): Return RVAL_DECODED after decoding of
PR_GET_DUMPABLE, PR_GET_KEEPCAPS, PR_GET_SECCOMP, PR_GET_TIMERSLACK,
PR_GET_TIMING, and PR_CAPBSET_READ commands.
/external/strace/prctl.c
2479ef0bceaa35ea353fd0ea372cf31d5eb8a216 18-Aug-2015 Dmitry V. Levin <ldv@altlinux.org> Fix printing tracee's long integers

Replace ambiguous printnum_long that used to fetch native long integers
from tracee's memory with printnum_ptr, printnum_slong, and printnum_ulong
that fetch tracee's pointer, signed long, and unsigned long integers.

* defs.h (printnum_long, printpair_long): Remove prototypes.
(printnum_int64, printpair_int64): Remove macros, declare functions
unconditionally.
[SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] (printnum_long_int):
New prototype.
(printnum_ptr, printnum_slong, printnum_ulong): New macros.
* aio.c (sys_io_setup): Use printnum_ulong.
* block.c (block_ioctl): Use printnum_slong and printnum_ulong.
* get_robust_list.c (sys_get_robust_list): Use printnum_ptr
and printnum_ulong.
* io.c (print_off_t): Remove.
(sys_sendfile): Use printnum_ulong.
* ipc.c (sys_semctl): Use printnum_ptr.
* prctl.c (sys_prctl): Likewise.
* process.c (sys_ptrace): Likewise.
* rtc.c (rtc_ioctl): Use printnum_ulong.
* util.c (printnum_long, printpair_long): Remove.
(printnum_int64, printpair_int64): Define unconditionally.
[SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4] (printnum_long_int):
New function.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Elvira Khabirova <lineprinter0@gmail.com>
/external/strace/prctl.c
1d246ce3d474829c505794a52a63435e7c9a2501 30-Jul-2015 Elliott Hughes <enh@google.com> prctl: decode Android-specific PR_SET_VMA

Android kernels have a prctl to name VMAs.

* prctl.c (sys_prctl) [__ANDROID__]: Decode PR_SET_VMA.
/external/strace/prctl.c
3691562e7dc030047048cd9ef993ab1bf4c69dce 25-Jul-2015 Dmitry V. Levin <ldv@altlinux.org> prctl: fix decoding of unrecognized commands

The use of printargs introduced by commit v4.10-179-g210a6b6 is wrong:
when the first argument is already printed, printargs cannot be called.

* prctl.c (print_prctl_args): New function.
(sys_prctl): Use it.
/external/strace/prctl.c
210a6b688479718519d6231c24722438a963732e 17-Jul-2015 Dmitry V. Levin <ldv@altlinux.org> prctl.c: make use of RVAL_DECODED

* prctl.c (prctl_enter, prctl_exit): Merge into sys_prctl.
(sys_prctl, sys_arch_prctl): Update for RVAL_DECODED.
/external/strace/prctl.c
7c53e984acca835d1477291c969fa15967dc3685 17-Jul-2015 Dmitry V. Levin <ldv@altlinux.org> prctl.c: use printaddr and umove_or_printaddr

* prctl.c (prctl_exit): Use printaddr and umove_or_printaddr.
/external/strace/prctl.c
850ba4b1e92c182ba44dc542a92d23e747273a3e 13-Jul-2015 Dmitry V. Levin <ldv@altlinux.org> Change printnum_* printers to honor syserror

With this change, printnum_* printers will not attempt to fetch data
in case of exiting(tcp) && syserror(tcp).
All "at exiting" decoders that call these printers have been made
ready for this change in previous commits.

* util.c (DEF_PRINTNUM, DEF_PRINTPAIR): Use umove_or_printaddr.
* prctl.c (prctl_exit): Use printnum_int and printnum_long.
(sys_arch_prctl): Do not check for syserror.
/external/strace/prctl.c
a0bd3749fc6fdf6364c1e269a4c02e8c153eb84b 07-Apr-2015 Dmitry V. Levin <ldv@altlinux.org> Declare syscall parsers using SYS_FUNC macro

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.
/external/strace/prctl.c
1e880730539b5d95d63345faf89409b0ed7b87d6 14-Feb-2015 Dmitry V. Levin <ldv@altlinux.org> Improve prctl decoding

* configure.ac (AC_CHECK_HEADERS): Add linux/securebits.h.
* prctl.c (sys_prctl): Implement full decoding of all PR_* constants
as defined in linux v3.19.
(sys_arch_prctl): Fix decoding of unknown commands.
* xlat/cap.in: New file.
* xlat/pr_mce_kill.in: New file.
* xlat/pr_mce_kill_policy.in: New file.
* xlat/pr_set_mm.in: New file.
* xlat/pr_tsc.in: New file.
* xlat/pr_unalign_flags.in: New file.
* xlat/secbits.in: New file.
* xlat/prctl_options.in: Remove non-linux constants, add fallback
definitions.
* xlat/seccomp_mode.in: Add fallback definitions.
/external/strace/prctl.c
2af6903f456b549fd57ba8beceddec961803cb3d 05-Feb-2015 Dmitry V. Levin <ldv@altlinux.org> Implement seccomp decoding

* configure.ac (AC_CHECK_HEADERS): Add linux/filter.h
and linux/seccomp.h.
* defs.h (print_seccomp_filter): New prototype.
* linux/dummy.h (sys_seccomp): Remove.
* linux/syscall.h (sys_seccomp): New prototype.
* prctl.c: Include <linux/seccomp.h>.
(sys_prctl): Decode PR_SET_SECCOMP.
* seccomp.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* xlat/bpf_class.in: New file.
* xlat/bpf_miscop.in: Likewise.
* xlat/bpf_mode.in: Likewise.
* xlat/bpf_op_alu.in: Likewise.
* xlat/bpf_op_jmp.in: Likewise.
* xlat/bpf_rval.in: Likewise.
* xlat/bpf_size.in: Likewise.
* xlat/bpf_src.in: Likewise.
* xlat/seccomp_filter_flags.in: Likewise.
* xlat/seccomp_mode.in: Likewise.
* xlat/seccomp_ops.in: Likewise.
* xlat/seccomp_ret_action.in: Likewise.
/external/strace/prctl.c
8224758b339b23f7b4388d84b68dd032045af5e6 11-Dec-2014 Dmitry V. Levin <ldv@altlinux.org> Always compile sys_prctl parser

Since sys_prctl is referenced by syscallent files unconditionally,
conditional compilation of sys_prctl depending on prctl availability is
pointless.

* prctl.c (unalignctl_string, sys_prctl): Compile unconditionally.
/external/strace/prctl.c
53c993d9c1455faca61560ba78c6399fa489169e 11-Dec-2014 Dmitry V. Levin <ldv@altlinux.org> process.c: move prctl and arch_prctl parsers to a separate file

* prctl.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* process.c: Move sys_prctl, sys_arch_prctl, and related code to prctl.c.
/external/strace/prctl.c