History log of /external/strace/uid.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
dc75b01004a0588c1eb3bc26d7248a6e473b2cdd 05-Jul-2017 Elliott Hughes <enh@google.com> Update strace to 4.18.

Noteworthy changes in release 4.18 (2017-07-05)
===============================================

* Improvements
* Implemented decoding of SCM_TIMESTAMP* control messages.
* Implemented decoding of netlink NLMSG_DONE messages.
* Implemented decoding of netlink generic nlmsg_type and nlmsg_flags.
* Implemented decoding of NETLINK_AUDIT, NETLINK_NETFILTER, NETLINK_ROUTE,
NETLINK_SELINUX, NETLINK_SOCK_DIAG, and NETLINK_XFRM message types.
* Implemented decoding of NETLINK_GENERIC protocol families.
* Implemented basic protocol specific decoding of AF_INET, AF_INET6,
AF_NETLINK, AF_PACKET, AF_SMC, and AF_UNIX messages of NETLINK_SOCK_DIAG.
* Implemented basic decoding of netlink attributes.
* Implemented basic protocol specific decoding of AF_INET, AF_NETLINK,
AF_PACKET, AF_SMC, and AF_UNIX netlink attributes of NETLINK_SOCK_DIAG.
* Implemented decoding of inet_diag_msg, netlink_diag_msg, and unix_diag_msg
netlink attributes of NETLINK_SOCK_DIAG.
* Updated lists of ARPHRD_*, KEYCTL_*, NDIAG_SHOW_*, RTM_*, SCM_*, SCTP_*,
SO_*, V4L2_*, and prctl ARCH_* constants.
* Updated lists of ioctl commands from Linux 4.12.

* Bug fixes
* In interactive mode (-I2), those signals that were blocked at startup
will remain blocked for the whole period of strace execution.
* strace no longer resets SIGCHLD handler in tracees to the default action.
* When traced command is terminated by a blocked signal, strace unblocks
that signal to ensure its own termination with the same signal.
* Fixed corner cases in decoding of old sigaction syscall.
* Fixed build with old kernel headers on mips.
* Fixed build on aarch64 and tile with glibc >= 2.26.
* Fixed build on arc and nios2.

Bug: N/A
Test: strace date
Change-Id: Ib34873ff60824b04f67332380c3460721f66002e
/external/strace/uid.c
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/uid.c
6469f39ee9ad8bbd3a6284896a116c4e746f9306 08-May-2016 Dmitry V. Levin <ldv@altlinux.org> uid.c: use print_array function

* uid.c (print_gid): New function.
(print_groups): Use it via print_array.
/external/strace/uid.c
5e9944df2c8b75a8fec46a597d34934c7525d4ca 19-Apr-2016 Dmitry V. Levin <ldv@altlinux.org> Fix corner cases of getgroups and setgroups syscall decoders

* uid.c (print_groups): New function.
(SYS_FUNC(setgroups), SYS_FUNC(getgroups)): Use it.
Print first syscall argument using %u format.
* tests/getgroups.c: New file.
* tests/getgroups.test: New test.
* tests/getgroups32.c: New file.
* tests/getgroups32.test: New test.
* tests/setgroups.c: New file.
* tests/setgroups.test: New test.
* tests/setgroups32.c: New file.
* tests/setgroups32.test: New test.
* tests/.gitignore: Add getgroups, getgroups32, setgroups,
and setgroups32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add getgroups.test, getgroups32.test,
setgroups.test, and setgroups32.test.
/external/strace/uid.c
ba210af0600a57fc2a5f58d2da31aa557b798268 18-Apr-2016 Dmitry V. Levin <ldv@altlinux.org> Cleanup setfsuid syscall decoder

* uid.c (SYS_FUNC(setfsuid)): Remove redundant check.
/external/strace/uid.c
a99bcbf9168ddd17fc172f909ee0ed32b4232dfc 15-Apr-2016 Dmitry V. Levin <ldv@altlinux.org> Fix decoding of 16-bit uid_t/git_t

* uid.c (printuid): Always cast value to uid_t.
/external/strace/uid.c
abfa939f57247c9eaa1e8ab2f110495819a51617 27-Dec-2015 Dmitry V. Levin <ldv@altlinux.org> Do not truncate return value of get{,e}[ug]id and setfs[ug]id syscalls

This should not be a user visible change unless the kernel does
something completely unexpected. In the latter case, let user see
what is going on.

* uid.c (SYS_FUNC(getuid), SYS_FUNC(setfsuid)): Do not truncate
tcp->u_rval to uid_t on exiting syscall, return RVAL_DECODED.
/external/strace/uid.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/uid.c
14278620c9241e3dcd0f8f24ec704d6d12e7a85a 16-Jul-2015 Dmitry V. Levin <ldv@altlinux.org> uid.c: make use of RVAL_DECODED

* uid.c (sys_setuid, sys_setreuid, sys_setresuid, sys_chown, sys_fchown,
sys_setgroups): Update for RVAL_DECODED.
/external/strace/uid.c
288a87049c335c16bab8a4fb25ed60f2d28fe530 16-Jul-2015 Dmitry V. Levin <ldv@altlinux.org> uid.c: use printaddr and umoven_or_printaddr

* uid.c (get_print_uid): Use umoven_or_printaddr.
(sys_getresuid): Do not check for syserror, get_print_uid now does
the right thing.
(sys_setgroups, sys_getgroups): Add const qualifier to local variables
that are assigned once. Use printaddr.
/external/strace/uid.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/uid.c
7e69ed98cdd3c8ee0bba783927bc95b895c60160 21-Mar-2015 Denys Vlasenko <dvlasenk@redhat.com> Change last parameter of umoven() from char* to void*

Saves tons of casts.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/uid.c
530bed0ca8285188ce6cbc9406e817da0ef4828b 14-Dec-2014 Dmitry V. Levin <ldv@altlinux.org> Fix decoding of getgroups, getgroups32, setgroups, and setgroups32 syscalls

Convert parsers of these syscalls to the same scheme as were applied to
parsers of other uid/gid related syscalls.
That is, define two sets of parsers on architectures that support
(either directly or via multiarch) 16-bit and 32-bit gid getgroups
and setgroups syscalls simultaneously, and reuse essentially the same
code by parametrizing uid_t and names of parser functions.

* groups.c: Remove.
(sys_getgroups, sys_setgroups): Move ...
* uid.c: ... here and parametrize their names.
* Makefile.am (strace_SOURCES): Remove groups.c.
* linux/syscall.h (sys_getgroups32, sys_setgroups32): Remove.
[NEED_UID16_PARSERS] (sys_getgroups16, sys_setgroups16): New prototypes.
* linux/arm/syscallent.h: Rename sys_[gs]etgroups to sys_[gs]etgroups16,
rename sys_[gs]etgroups32 to sys_[gs]etgroups.
* linux/bfin/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* tests/uid.c: Test for getgroups.
* tests/uid16.c: Likewise.
* tests/uid32.c: Test for getgroups32.
* tests/uid.awk: Test for getgroups/getgroups32 decoding.
* tests/uid.test: Trace getgroups/getgroups32 syscalls.
/external/strace/uid.c
80f7db1fedefedb01cd2ce3107dfc264eab50601 13-Dec-2014 Dmitry V. Levin <ldv@altlinux.org> Fix decoding of 16-bit *chown and [gs]et*[gu]id syscalls

Define two sets of parsers on architectures that support (either
directly or via multiarch) 16-bit and 32-bit uid/gid syscalls
simultaneously. Since the code in these two sets is essentially
the same and the key difference between them is the size of uid_t,
implement it by parametrizing uid_t and names of parser functions.

* defs.h (NEED_UID16_PARSERS): New macro.
* linux/syscall.h [NEED_UID16_PARSERS] (sys_chown16, sys_fchown16,
sys_getresuid16, sys_getuid16, sys_setfsuid16, sys_setresuid16,
sys_setreuid16, sys_setuid16): New prototypes.
* linux/dummy.h (sys_geteuid16): Alias to sys_getuid16.
(sys_getegid16, sys_getgid16, sys_getresgid16, sys_setfsgid16,
sys_setgid16, sys_setregid16, sys_setresgid16): Alias to corresponding
sys_*uid16 functions.
* uid.c: Stop including <asm/posix_types.h>.
Parametrize uid_t and names of all exported functions.
(get_print_uid): New function.
(sys_getresuid): Use it.
(printuid): Check for (uid_t) -1.
* uid16.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* linux/arm/syscallent.h: Use sys_chown16, sys_fchown16, sys_getegid16,
sys_geteuid16, sys_getgid16, sys_getresgid16, sys_getresuid16,
sys_getuid16, sys_setfsgid16, sys_setfsuid16, sys_setgid16,
sys_setregid16, sys_setresgid16, sys_setresuid16, sys_setreuid16,
and sys_setuid16 parsers for *chown and [gs]et*[gu]id syscall entries.
* linux/bfin/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* tests/uid16.c: New file.
* tests/uid16.test: New test.
* tests/Makefile.am (CHECK_PROGRAMS): Add uid16.
(TESTS): Add uid16.test.
* tests/.gitignore: Add uid16.
/external/strace/uid.c
2f7d020e2258b8565c3809cfe2dd76668a1c433d 13-Dec-2014 Dmitry V. Levin <ldv@altlinux.org> chown.c: split into separate files

This will make further uid/gid fixes simpler.

* fchownat.c: New file.
* chown.c (sys_fchownat: Move to fchownat.c.
(sys_chown, sys_fchown): Move to uid.c.
* Makefile.am (strace_SOURCES): Remove chown.c, add fchownat.c.
/external/strace/uid.c
25ebe46ce23d6db0dd2623bcc798d2f6a9bc6163 13-Dec-2014 Dmitry V. Levin <ldv@altlinux.org> util.c: move printuid to uid.c

This will make further uid/gid fixes simpler.

* util.c (printuid): Move
* uid.c: ... here.
/external/strace/uid.c
e93ef1eb9d1aea312273337e0775002921273829 11-Dec-2014 Dmitry V. Levin <ldv@altlinux.org> process.c: move get*uid and set*uid parsers to a separate file

* uid.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* process.c (sys_getuid, sys_setfsuid, sys_setuid, sys_getresuid,
sys_setreuid, sys_setresuid): Move to uid.c.
/external/strace/uid.c