Commit Graph

208 Commits

Author SHA1 Message Date
5e90930421 Update ioctl entries from linux v4.14-rc1
* linux/32/ioctls_inc_align16.h: Update from linux v4.14-rc1
using ioctls_gen.sh.
* linux/32/ioctls_inc_align32.h: Likewise.
* linux/32/ioctls_inc_align64.h: Likewise.
* linux/64/ioctls_inc.h: Likewise.
* linux/x32/ioctls_inc0.h: Likewise.
* xlat/loop_cmds.in: Add LOOP_SET_BLOCK_SIZE introduced
by kernel commit v4.13-rc7-176-g89e4fde.
* NEWS: Mention this.
* tests/ioctl_loop.c (main): Update.
2017-09-19 11:32:05 +00:00
52231be034 Update MEMBARRIER_CMD_* constants
* xlat/membarrier_cmds.in: Add MEMBARRIER_CMD_PRIVATE_EXPEDITED
introduced by kernel commit v4.14-rc1~174^2^2^4.
* NEWS: Mention this.
* tests/membarrier.c (main): Update expected output.
2017-09-17 12:04:11 +00:00
13901e7e6f Update UFFD_FEATURE_* constants
* xlat/memfd_create_flags.in: Remove UFFD_FEATURE_EVENT_EXIT removed
by kernel commit v4.11-rc2~15^2~18.
Add UFFD_FEATURE_SIGBUS and UFFD_FEATURE_THREAD_ID introduced by kernel
commits v4.14-rc1~126^2~28 and v4.14-rc1~126^2~23, repsectively.
* NEWS: Mention this.
2017-09-17 12:04:11 +00:00
53ddcf0fd6 Update MFD_* constants
* xlat/memfd_create_flags.in: Add MFD_HUGETLB introduced
by kernel commit v4.14-rc1~126^2~17.
* NEWS: Mention this.
* tests/memfd_create.c (main): Update expected output.
2017-09-17 12:04:11 +00:00
23dc62bb8b Update ETH_P_* constants
* xlat/ethernet_protocols.in: Add ETH_P_ERSPAN, ETH_P_NSH, ETH_P_IFE,
and ETH_P_MAP introduced by kernel commits v4.14-rc1~130^2~164,
v4.14-rc1~130^2~89^2~3, v4.14-rc1~130^2~90^2~2, and
v4.14-rc1~130^2~78^2~2, respectively.
* NEWS: Mention this.
2017-09-17 12:04:11 +00:00
6751159fda Update ARPHRD_* constants
* xlat/arp_hardware_types.in: Add ARPHRD_RAWIP introduced
by kernel commit v4.14-rc1~130^2~78^2~1.
* NEWS: Mention this.
2017-09-17 12:04:11 +00:00
3e45b0398d Update BPF_* constants
* xlat/bpf_attach_type.in: Add BPF_SK_SKB_STREAM_PARSER
and BPF_SK_SKB_STREAM_VERDICT introduced by kernel commit
v4.14-rc1~130^2~123^2~8.
* xlat/bpf_map_flags.in: Add BPF_F_NO_COMMON_LRU and BPF_F_NUMA_NODE
introduced by kernel commits v4.10-rc1~202^2~271^2~2
and v4.14-rc1~130^2~196^2~1, respectively.
* xlat/bpf_map_types.in: Add BPF_MAP_TYPE_DEVMAP
and BPF_MAP_TYPE_SOCKMAP introduced by kernel commits
v4.14-rc1~130^2~497^2~4 and v4.14-rc1~130^2~234^2~4,
respectively.
* xlat/bpf_op_jmp.in: Add BPF_JLT, BPF_JLE, BPF_JSLT, and BPF_JSLE
introduced by kernel commit v4.14-rc1~130^2~309^2~8.
* xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_SK_SKB introduced
by kernel commit v4.14-rc1~130^2~234^2~6.
* NEWS: Mention this.
2017-09-17 12:04:11 +00:00
55bb3e27d7 Update SO_* constants
* xlat/sockoptions.in: Add SO_ZEROCOPY introduced by kernel commit
v4.14-rc1~130^2~376^2~5.
* NEWS: Mention this.
2017-09-17 12:04:11 +00:00
5f1d34e1f3 Update MADV_* constants
* xlat/madvise_cmds.in: Add MADV_WIPEONFORK and MADV_KEEPONFORK
introduced by kernel commit v4.14-rc1~126^2.
* NEWS: Mention this.
2017-09-17 12:04:11 +00:00
68d00ce2d6 Update TCP_* constants
* xlat/socktcpoptions.in: Add TCP_ULP and TCP_MD5SIG_EXT.
* NEWS: Mention this.
2017-09-07 06:45:04 +00:00
3e178d2fb2 Update SOL_* constants
* xlat/socketlayers.in: Add SOL_TLS.
* NEWS: Mention this.
2017-09-07 06:45:04 +00:00
93006fc2a0 Post-release administrivia
* NEWS: Add a header line for the next release.
* debian/changelog.in: Add a changelog entry for 4.19-1.
* strace.spec.in: Likewise.
2017-09-06 20:24:50 +00:00
af9010e63b Prepare for 4.19 release
* NEWS: Update for 4.19 release.
2017-09-05 12:13:14 +00:00
Eugene Syromyatnikov
94e0fe19bc Update NEWS 2017-09-04 23:17:27 +02:00
Gleb Fotengauer-Malinovskiy
5f270dcbc6 Update ioctl entries from linux v4.13-rc7
* linux/32/ioctls_inc_align16.h: Update from linux v4.13-rc7 using ioctls_gen.sh.
* linux/32/ioctls_inc_align32.h: Likewise.
* linux/32/ioctls_inc_align64.h: Likewise.
* linux/64/ioctls_inc.h: Likewise.
* linux/x32/ioctls_inc0.h: Likewise.
* linux/arm/ioctls_arch0.h: Likewise.
* linux/i386/ioctls_arch0.h: Likewise.
* linux/powerpc/ioctls_arch0.h: Likewise.
* linux/s390x/ioctls_arch0.h: Likewise.
* linux/x86_64/ioctls_arch0.h: Likewise.
* NEWS: Mention this.
2017-08-28 14:44:38 +00:00
JingPiao Chen
418dd0e7db Update NEWS 2017-08-14 01:10:33 +00:00
JingPiao Chen
e4b90f7bbf netlink: decode NETLINK_CRYPTO crypto_user_alg netlink attributes
* configure.ac (AC_CHECK_TYPES): Check for crypto_report_aead,
crypto_report_blkcipher, crypto_report_cipher, crypto_report_hash,
and crypto_report_rng structures in <linux/cryptouser.h>.
* netlink_crypto.c (decode_crypto_report_generic,
decode_crypto_report_hash, decode_crypto_report_blkcipher,
decode_crypto_report_aead, decode_crypto_report_rng,
decode_crypto_report_cipher): New functions.
(crypto_user_alg_nla_decoders): New array.
(decode_crypto_user_alg): Use it.
* xlat/crypto_nl_attrs.in: New file.
* NEWS: Mention this.
2017-07-24 11:18:43 +00:00
JingPiao Chen
9da72b5251 netlink: add a basic parser of NETLINK_CRYPTO messages
* netlink_crypto.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* defs.h (decode_netlink_crypto): New prototype.
* netlink.c (netlink_decoders): Add NETLINK_CRYPTO.
* NEWS: Mention this.
2017-07-24 10:47:19 +00:00
6f51a6d00d keyctl: add support for KEYCTL_RESTRICT_KEYRING operation
* keyctl.c (keyctl_restrict_keyring): New function.
(SYS_FUNC(keyctl)): Use it to implement KEYCTL_RESTRICT_KEYRING support.
* NEWS: Mention this.
* tests/keyctl.c (main): Check KEYCTL_RESTRICT_KEYRING decoding.
2017-07-21 11:07:55 +00:00
8d2dd76323 x86: wire up arch_prctl syscall
* linux/i386/syscallent.h [384]: Add arch_prctl entry.
* xlat/archvals.in: Add fallback definitions for constants.
* prctl.c: Stop including <asm/prctl.h>.
(SYS_FUNC(arch_prctl)): Enable for [I386].
* NEWS: Mention this.
2017-07-21 01:30:26 +00:00
886a7966b1 Update input event KEY_* constants
* xlat/evdev_keycode.in: Add KEY_ASSISTANT introduced by linux kernel
commit v4.13-rc1~13^2~1^2~1.
* NEWS: Mention this.
2017-07-19 20:41:15 +00:00
3e1ed8cf62 Update fs *_MAGIC constants
* xlat/fsmagic.in: Add AAFS_MAGIC introduced by linux kernel commit
v4.13-rc1~161^2~87.
* NEWS: Mention this.
2017-07-19 20:41:15 +00:00
JingPiao Chen
3bfaa0f744 netlink: decode nlmsgerr attributes
* netlink.c: Include "nlattr.h" and "xlat/nlmsgerr_attrs.h".
(print_cookie, decode_nlmsgerr_attr_cookie): New functions.
(nlmsgerr_nla_decoders): New array.
(decode_nlmsgerr): Use it.
* xlat/nlmsgerr_attrs.in: New file.
* NEWS: Mention this.
2017-07-19 09:25:58 +00:00
JingPiao Chen
9ec9ad9c0f netlink: decode netlink message ack flags
* netlink.c: Include "xlat/netlink_ack_flags.h".
(decode_nlmsg_flags): Decode ack flags when type == NLMSG_ERROR.
* xlat/netlink_ack_flags.in: New file.
* NEWS: Mention this.
* tests/netlink_protocol.c (test_ack_flags): New function, check this.
(main): Use it.
2017-07-19 09:25:58 +00:00
6644e1f4e1 userfaultfd: decode struct uffdio_api.features as flags
* xlat/uffd_api_features.in: New file.
* userfaultfd.c: Include "xlat/uffd_api_features.h".
(uffdio_ioctl): Print struct uffdio_api.features using
PRINT_FIELD_FLAGS64 and uffd_api_features.
* NEWS: Mention this.
* tests/ioctl_uffdio.c: Include "xlat.h" and "xlat/uffd_api_features.h".
(main): Update expected output.
2017-07-19 00:33:56 +00:00
8d62a6072d Update NEWS 2017-07-17 19:55:17 +00:00
7bcb1dcdbc net: enhance decoding of MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP
* net.c (print_group_req): Allow option length greater than
sizeof(struct group_req) to match the kernel behaviour.
When the option length is invalid, print the address.
* NEWS: Mention this.
2017-07-09 18:43:34 +00:00
492517e35f net: enhance decoding of IP_ADD_MEMBERSHIP et al socket options
* net.c (print_mreq, print_mreq6): Treat negative option length
as invalid to match the kernel behaviour.  When the option length
is invalid, print the address.
* NEWS: Mention it.
* tests/ip_mreq.c (main): Check it.  Update expected output.
2017-07-09 18:43:34 +00:00
0c4052b9ca net: accept arbitrary option length for getsockopt's SO_PEERCRED
* print_fields.h (PRINT_FIELD_UID): New macro.
* net.c (print_ucred): Rewrite to match the kernel behaviour.
* NEWS: Mention this.
2017-07-08 19:27:26 +00:00
bc515c7f54 Implement decoding of linux socket filter programs
* bpf_sock_filter.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* xlat/skf_ad.in: New file.
* defs.h (decode_sock_fprog, print_sock_fprog): New prototypes.
* fetch_bpf_fprog.c (get_bpf_fprog_size): New mpers printer.
* net.c (print_getsockopt): Use decode_sock_fprog to print
socket filter programs for SO_GET_FILTER socket option.
(print_setsockopt): Use decode_sock_fprog and get_bpf_fprog_size
to print socket filter programs for SO_ATTACH_FILTER
and SO_ATTACH_REUSEPORT_CBPF socket options.
* NEWS: Mention this.
2017-07-08 14:57:44 +00:00
4c14d39332 net: accept arbitrary option length for getsockopt's SO_LINGER
* net.c (print_linger): Rename to print_set_linger.
(print_setsockopt): Replace print_linger with print_set_linger.
(print_get_linger): New function that accepts arbitrary option length
to match the kernel behaviour.
(print_getsockopt): Replace print_linger with print_get_linger.
* NEWS: Mention this.
2017-07-08 14:57:44 +00:00
657b04b83b net: enhance decoding of getsockopt's optlen argument
As the last argument of getsockopt syscall has read-write semantics,
print both user and kernel values when they differ.

* net.c (SYS_FUNC(getsockopt)): On entering syscall, fetch and save
the length specified to the kernel.  On error, print the length saved
on entering.  When the saved length and the length returned by the
kernel differ, print both values.
* NEWS: Mention this.
* tests/net-icmp_filter.c (main): Update expected output.
2017-07-08 14:57:44 +00:00
1e4f54cd28 Post-release administrivia
* NEWS: Add a header line for the next release.
* debian/changelog.in: Add a changelog entry for 4.18-1.
* strace.spec.in: Likewise.
2017-07-06 12:50:55 +00:00
c136e9e449 Prepare for 4.18 release
* NEWS: Update for 4.18 release.
2017-07-05 07:08:09 +00:00
e70dae5954 Update NEWS 2017-07-04 17:52:54 +00:00
Gleb Fotengauer-Malinovskiy
89e2e64936 Update ioctl entries from linux v4.12-rc7
* linux/32/ioctls_inc_align16.h: Update from linux v4.12-rc7
(with f7a320ff commit applied on top) using ioctls_gen.sh.
* linux/32/ioctls_inc_align32.h: Likewise.
* linux/32/ioctls_inc_align64.h: Likewise.
* linux/64/ioctls_inc.h: Likewise.
* linux/x32/ioctls_inc0.h: Likewise.
* NEWS: Mention this.
2017-06-29 09:20:36 +00:00
7f2b636a22 Fix a few misspellings in comments
Reported by kernel's checkpatch.pl script.
2017-06-17 10:40:05 +00:00
Miroslav Lichvar
c0a127d163 msghdr: print SCM_TIMESTAMP* control messages
Add support for printing control messages containing software and/or
hardware timestamps, which are typically enabled by NTP and PTP
implementations.

* print_timeval.c (print_struct_timeval_data_size): New mpers printer.
* print_timespec.c (print_struct_timespec_data_size,
print_struct_timespec_array_data_size): Likewise.
* msghdr.c (print_scm_timestamp, print_scm_timestampns,
print_scm_timestamping): New functions.
(cmsg_socket_printers): Add them.
* NEWS: Mention this change.
* tests/msg_control.c: Include "xlat.h" and "xlat/scmvals.h".
(test_scm_timestamp, test_scm_timestampns, test_scm_timestamping):
New functions.
(test_sol_socket): Use them.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2017-06-15 23:52:48 +00:00
a25d7521ef scno.am: include config.h before syscallent.h
This fixes generation of syscallent.i and subsequent scno.h files
on mips where syscallent.h checks macros defined in config.h.

* scno.am (syscallent.i): Add $(top_builddir)/config.h
to prerequisites, include it.
* NEWS: Mention this fix.

Reported-by: David Robins <dbrobins@i4031.net>
2017-05-30 22:44:47 +00:00
337d3a10ce signal: fix decoding of struct old_sigaction on some architectures
On alpha, struct old_sigaction.sa_flags has a 32-bit type.

On mips, only first word of old_sigaction.sa_mask is read.

On all architectures except alpha and mips that have old sigaction
syscall, struct old_sigaction has sa_restorer field that has to be
decoded.

* signal.c (struct old_sigaction) [ALPHA]: Change sa_flags type
to unsigned int, add ATTRIBUTE_PACKED.
[MIPS]: Dhrink sa_mask array to 1 element.
[!ALPHA && !MIPS]: Define sa_restorer field unconditionally.
(struct old_sigaction32): Likewise.
(decode_old_sigaction) [!current_wordsize]: Initialize sa_restorer field
from old_sigaction32.sa_restorer unconditionally.
[!ALPHA && !MIPS]: Print old_sigaction.sa_restorer if SA_RESTORER flag
is set.
* NEWS: Mention this change.
2017-05-28 17:13:29 +00:00
47b93f2a7a Fix termination signal forwarding
When traced command is terminated by a blocked signal, unblock
that signal to ensure strace termination with the same signal.

* strace.c (main): Unblock the signal raised for strace termination.
* NEWS: Mention this change.
2017-05-27 17:59:44 +00:00
e97a66faa1 Do not reset SIGCHLD handler in tracees to SIG_DFL
While strace resets SIGCHLD handler to the default action so that
waitpid definitely works without losing track of children, tracees
should not inherit this change.

* strace.c (struct exec_params): Add child_sa field.
(init): When setting SIGCHLD handler to SIG_DFL, save the old handler.
(exec_or_die): Restore SIGCHLD handler if it was different from SIG_DFL
at startup.
* NEWS: Mention this change.
2017-05-27 17:59:44 +00:00
f83b49b03a Fix unblocking of signals in interactive mode
In interactive mode (-I2), those signals that were blocked at startup
will remain blocked for the whole period of strace execution.

* strace.c (empty_set): Rename to start_set.  All users changed.
(init): Initialize start_set and blocked_set to the set of currently
blocked signals.
(startup_attach, trace): Use SIG_SETMASK instead of SIG_BLOCK.
* NEWS: Mention this change.
2017-05-27 10:00:43 +00:00
b77b04744a Post-release administrivia
* NEWS: Add a header line for the next release.
* debian/changelog.in: Add a changelog entry for 4.17-1.
* strace.spec.in: Likewise.
2017-05-25 19:42:20 +00:00
23ed9034c8 Prepare for 4.17 release
* NEWS: Update for 4.17 release.
2017-05-24 16:17:18 +00:00
ba0bd3f1ec Fix decoding of sgetmask and ssetmask syscalls
Old ssetmask syscall takes an argument and returns a value of type int.
Old sgetmask syscall may return an error.

* signal.c (SYS_FUNC(ssetmask)): Explicitly convert the argument
and return value to unsigned int, print it using sprint_old_sigmask_val.
(SYS_FUNC(sgetmask)): Do not print the mask in case of syserror.
* tests/sxetmask.c: New file.
* tests/gen_tests.in (sxetmask): New entry.
* tests/pure_executables.list: Add sxetmask.
* tests/.gitignore: Likewise.
* NEWS: Mention this fix.
2017-05-22 17:33:51 +00:00
d852b31a8b alpha, cris, mips, ppc, sh, sparc: fix decoding of sigsuspend syscall
On some architectures old sigsuspend syscall takes the signal mask from
the 3rd argument, on some from the 1st.  And, if it wasn't peculiar
enough, the signal mask is passed by value on all architectures except
mips where it's passed by reference.

* signal.c (SYS_FUNC(sigsuspend)): Take the signal mask from the last
argument.
* linux/alpha/syscallent.h (sigsuspend): Set nargs to 1.
* linux/crisv10/syscallent.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* tests/sigsuspend.c: New file.
* tests/gen_tests.in (sigsuspend): New entry.
* tests/pure_executables.list: Add sigsuspend.
* tests/.gitignore: Likewise.
* NEWS: Mention this fix.
2017-05-01 14:49:26 +00:00
Eugene Syromyatnikov
b0ef7be9a0 Update NEWS 2017-05-01 14:49:26 +00:00
Eugene Syromyatnikov
3277a2370a Always print raw values of time data fields
Refactor sprinttime: implement sprinttime_nsec and sprinttime_usec
that handle nanoseconds and microseconds, respectively.
Always print raw values of time data fields, format string
representations of time as comments.

* defs.h (sprinttime): Change argument type from time_t to long long.
(sprinttime_nsec, sprinttime_usec): New prototypes.
* util.c (sprinttime_ex, sprinttime_nsec, sprinttime_usec): New
functions.
(sprinttime): Turn into a thin wrapper around sprinttime_ex.
* stat.h (struct strace_stat): Add has_nsec field.
* fetch_struct_stat.c (HAVE_NSEC): New macro.
(fetch_struct_stat): Initialize has_nsec field with HAVE_NSEC.
* fetch_struct_stat64.c (HAVE_NSEC): New macro.
(fetch_struct_stat64): Initialize has_nsec field with HAVE_NSEC.
* print_struct_stat.c (print_struct_stat) <PRINT_ST_TIME>:
Print raw values of time fields, use sprinttime_nsec to format a string
representation of time, use tprints_comment to print it as a comment.
* statx.c (SYS_FUNC(statx)) <PRINT_FIELD_TIME>: Likewise.
* utime.c (SYS_FUNC(utime)): Print raw values of struct utimbuf.actime
and struct utimbuf.modtime fields, use sprinttime to format a string
representation of time, use tprints_comment to print it as a comment.
* tests/tests.h (print_time_t_nsec): Add int argument.
* tests/print_time.c (print_time_t_ex): New function.
(print_time_t_nsec): Add int argument, turn into a thin wrapper around
print_time_t_ex.
* tests/utime.c (main): Update expected output.
* tests/xstatx.c [!IS_STATX] (HAVE_NSEC): New macro.
[!IS_STATX] (PRINT_ST_TIME), [IS_STATX] (PRINT_FIELD_TIME): Update
expected output.
* NEWS: Mention this timestamps representation improvement.

Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
2017-04-24 23:14:57 +00:00
Eugene Syromyatnikov
e15d00536b Implement -e trace=%stat option
linux/*/syscallent*.h part is updated automatically by:

    sed -i '/statx/! s/TF|TSTA,/TF|TST|TSTA,/' linux/*/syscallent*.h

* sysent.h (TRACE_STAT): New macro.
* syscall.c: Alias LST to TRACE_STAT around syscallent.h inclusion.
* qualify.c (lookup_class): Add TRACE_STAT for "%stat".
* strace.1 (.SS Filtering): Add information about %stat syscall class.
* NEWS: Mention this change.
* linux/aarch64/syscallent.h (stat): Add TST flag.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/arm/syscallent.h (oldstat, stat, stat64): Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/crisv10/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/avr32/syscallent.h (stat, stat64): Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
* linux/powerpc64/syscallent.h (oldstat, stat): Likewise.
* linux/alpha/syscallent.h (osf_old_stat, osf_stat, stat, stat64): Likewise.
* linux/mips/syscallent-compat.h (bsd43_oldstat, bsd43_stat, posix_stat,
svr4_stat, svr4_xstat, sysv_stat, sysv_xstat): Likewise.
* tests/gen_tests.in (trace_stat): New entry.
* tests/trace_stat.in: New file.
* tests/Makefile.am (EXTRA_DIST): Add it.
* tests/ksysent.c (TST): New macro, defined to 0.
* tests/nsyscalls.c: Likewise.
2017-04-21 19:49:03 +00:00