Commit Graph

17 Commits

Author SHA1 Message Date
2b6e074846 Update copyright headers
Headers updated automatically using maint/update_copyright_years.sh
script.
2018-06-14 11:00:00 +00:00
eb2c0b8bdf Enhance printing of unfetchable object addresses in sequences and arrays
* btrfs.c (btrfs_print_tree_search): Print the address of unfetchable
object inside the sequence using printaddr_comment.
* msghdr.c (decode_msg_control): Likewise.
* execve.c (printargv): Print the address of unfetchable object inside
the array using printaddr_comment.
* netlink.c (fetch_nlmsghdr): Add in_array argument.  When in_array
is true, print the address of unfetchable object using
printaddr_comment.
* nlattr.c (fetch_nlattr): Likewise.
* tests/execve.c (main): Update expected output.
* tests/execveat.c (main): Likewise.
* tests/msg_control.c (test_scm_rights1, test_scm_rights2,
test_scm_security): Likewise.
* tests/netlink_protocol.c (send_query): Likewise.
* tests/nlattr.c (test_nlattr): Likewise.
2018-05-29 09:58:10 +00:00
Eugene Syromyatnikov
9d095c7860 Add copyright headers 2017-05-22 17:33:51 +00:00
c34952709d Introduce tprintf_comment and tprints_comment functions
* defs.h (tprintf_comment, tprints_comment): New prototypes.
* strace.c (tvprintf): New function.
(tprintf): Use it.
(tprintf_comment, tprints_comment): New functions.
* aio.c (tprint_lio_opcode): Use tprints_comment.
* dm.c (dm_decode_dm_target_spec, dm_decode_dm_target_deps,
dm_decode_dm_name_list, dm_decode_dm_target_versions,
dm_decode_dm_target_msg, dm_decode_string, dm_known_ioctl): Likewise.
* futex.c (SYS_FUNC(futex)): Likewise.
* perf.c (print_perf_event_attr): Likewise.
* seccomp.c (decode_bpf_code): Likewise.
* util.c (printxvals, printxval_searchn, printflags64): Likewise.
* btrfs.c (print_u64, btrfs_print_key_type, btrfs_print_objectid,
print_key_value_internal): Likewise.
(btrfs_ioctl): Use tprints_comment and tprintf_comment.
* dirent.c (SYS_FUNC(getdents)): Likewise.
* dirent64.c (SYS_FUNC(getdents64)): Likewise.
* execve.c (printargc): Use tprintf_comment.
* tests/btrfs.c (btrfs_test_get_dev_stats_ioctl,
btrfs_test_features_ioctls): Update expected output.
2017-04-24 19:31:54 +00:00
37fc8e673a Make output of execve/execveat syscall parsers more structured
* execve.c (printargc): Always print the address, format the number
of variables as a comment.
* tests/execve.c: Update expected output.
* tests/execveat.c: Likewise.
* tests/qual_syscall.test: Likewise.
* tests/strace-r.expected: Likewise.
* tests/strace-t.test: Likewise.
* tests/strace-tt.test: Likewise.
* tests/strace-ttt.test: Likewise.
* tests/threads-execve.c: Likewise.
* tests/threads-execve.test: Likewise.
2017-04-24 19:22:11 +00:00
7fa3d78319 Automatically replace kernel_(scno|ureg)_t with kernel_ulong_t
Remove temporary types created for transition from long
to kernel_ulong_t.

Automatically replace kernel_scno_t and kernel_ureg_t with
kernel_ulong_t using
$ git grep -El 'kernel_(scno|ureg)_t' |
  xargs sed -ri 's/kernel_(scno|ureg)_t/kernel_ulong_t/g'

* kernel_types.h (kernel_scno_t, kernel_ureg_t): Remove.
All users updated.
2016-12-26 10:43:34 +00:00
7e5cd0e72b execve: prepare for handling big pointers
* execve.c (printargv): Change cp.p64 type from unsigned long
to kernel_ulong_t so it could handle wordsize > sizeof(long) properly.
2016-12-25 22:27:33 +00:00
a940d1a60f printstr: rename to printstrn, add printstr as a thin wrapper
As about half of all printstr uses cases are invocations with the last
argument set to -1, create a dedicated function for this use case.

* defs.h (printstr): Rename to printstrn.  All callers updated.
(printstr): New static inline function.  All callers updated.
2016-12-25 11:32:45 +00:00
ef54d3d838 execve: change address argument type from long to kernel_ureg_t
* execve.c (printargv, printargc): Change address argument type
from long to kernel_ureg_t.
2016-12-25 11:32:44 +00:00
3c00e63b03 Fix decoding of execve and execveat syscalls with invalid input
* execve.c (printargv): Fix decoding of inaccessible or partially
inaccessible array.
(printargc): Diagnose inaccessible or partially inaccessible array.
(decode_execve, SYS_FUNC(execv)): Update printargv and printargc callers.
2016-02-08 18:21:31 +00:00
38a34c9349 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.
2015-12-17 17:56:48 +00:00
7c2210190a Implement execveat syscall decoding
* execve.c (decode_execve): New function.
(sys_execve): Use it.
(sys_execveat): New function.
* linux/dummy.h (sys_execveat): Remove.
* tests/execveat.c: New file.
* tests/execveat.expected: Likewise.
* tests/execveat-v.expected: Likewise.
* tests/execveat.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add execveat.
(TESTS): Add execveat.test.
(EXTRA_DIST): Add execveat.expected and execveat-v.expected.
* tests/.gitignore: Add execveat.
2015-07-27 15:27:43 +00:00
4ff687bb31 execve: fix support of personalities with different word size
* execve.c (printargc): Do not assume that host and target pointers have
the same size.
* tests/execve.c: New file.
* tests/execve.expected: Likewise.
* tests/execve-v.expected: Likewise.
* tests/execve.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add execve.
(TESTS): Add execve.test.
(EXTRA_DIST): Add execve.expected and execve-v.expected.
* tests/.gitignore: Add execve.
2015-07-27 15:27:43 +00:00
7e56b4e5ae execve.c: make use of RVAL_DECODED
* execve.c (sys_execve, sys_execv): Update for RVAL_DECODED.
2015-07-20 22:03:07 +00:00
ad18132608 execve.c: use printaddr and umove_or_printaddr
* execve.c (printargv): Use umoven_or_printaddr.
(sys_execve, sys_execv): Use printaddr.
2015-07-20 22:03:07 +00:00
a0bd3749fc 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.
2015-04-07 11:22:49 +00:00
7be2318ad2 process.c: move execve and execv parsers to a separate file
* execve.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* process.c: Move sys_execve, sys_execv, and related code to execve.c.
2014-12-11 22:52:03 +00:00