Commit Graph

7052 Commits

Author SHA1 Message Date
4c9516cc9b Post-release administrivia
* NEWS: Add a header line for the next release.
* debian/changelog.in: Add a changelog entry for 4.25-1.
* strace.spec.in: Likewise.
2018-10-30 10:43:31 +00:00
c12d2de112 Prepare for 4.25 release
* NEWS: Update for 4.25 release.
2018-10-30 08:09:10 +00:00
5c62e29237 Update copyright headers
Headers updated automatically using maint/update_copyright_years.sh
script.
2018-10-30 08:09:10 +00:00
6726f218f7 Update NEWS 2018-10-25 20:50:32 +00:00
Elvira Khabirova
7a7f6c6a7c Implement decoding of NBD_* ioctl commands
* nbd_ioctl.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* defs.h (DECL_IOCTL): Add nbd.
* ioctl.c (ioctl_decode): Add 0xab (nbd) case.
* xlat/nbd_ioctl_cmds.in: Likewise.
* xlat/nbd_ioctl_flags.in: Likewise.
* tests/ioctl_nbd.c: Likewise.
* tests/.gitignore: Add ioctl_nbd.
* tests/pure_executables.list: Likewise.
* tests/gen_tests.in (ioctl_nbd): New entry.

Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
2018-10-25 20:50:32 +00:00
6d6d5bc480 tests: fix build with recent kernel headers
Linux commit v4.19-rc2-5-g2ecefa0a15fd0ef88b9cd5d15ceb813008136431
changed the definition of struct keyctl_dh_params in an incompatible
way again.  Workaround this issue by using designated initializers.

* tests/keyctl.c (main): Use designated initializers for
struct keyctl_dh_params.
2018-10-25 13:36:54 +00:00
4370024753 arm, sparc, sparc64: wire up io_pgetevents
* linux/arm/syscallent.h ([399]): Wire up io_pgetevents syscall
introduced by Linux commit v4.19-rc7~24^2~1.
(ARM_FIRST_SHUFFLED_SYSCALL, SYS_socket_subcall): Raise from 400 to 500,
to make room for new syscalls.
* linux/sparc/syscallent.h ([361]): Wire up io_pgetevents syscall
introduced by Linux commit v4.19~31^2~5.
* linux/sparc64/syscallent.h: Likewise.
2018-10-24 09:05:38 +00:00
Gleb Fotengauer-Malinovskiy
3960969554 Update ioctl entries from linux v4.19
* linux/32/ioctls_inc_align16.h: Update from linux v4.19-rc8
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/i386/ioctls_arch0.h: Likewise.
* linux/x86_64/ioctls_arch0.h: Likewise.
* NEWS: Mention this.
2018-10-24 07:48:56 +00:00
Gleb Fotengauer-Malinovskiy
be3ba52a4d maint: update for linux 4.19-rc8
* maint/ioctls_sym.sh (x86_list): Add KVM_[GS]ET_NESTED_STATE.
2018-10-24 07:48:56 +00:00
5993d50813 Remove redundant VIDIOC_SUBDEV_* constants
Remove those of VIDIOC_SUBDEV_* constants are defined exactly the same
way by the Linux kernel as their VIDIOC_* origins.

Linux kernel commit v4.19-rc1~137^2~248 introduced more of such
duplicates, forward remove them as well.

* linux/32/ioctls_inc_align16.h: Remove VIDIOC_SUBDEV_DV_TIMINGS_CAP,
VIDIOC_SUBDEV_ENUM_DV_TIMINGS, VIDIOC_SUBDEV_G_DV_TIMINGS,
VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_QUERY_DV_TIMINGS,
VIDIOC_SUBDEV_S_DV_TIMINGS, and VIDIOC_SUBDEV_S_EDID.
* 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.
* maint/ioctls_sym.sh: Remove VIDIOC_SUBDEV_DV_TIMINGS_CAP,
VIDIOC_SUBDEV_ENUM_DV_TIMINGS, VIDIOC_SUBDEV_ENUMSTD,
VIDIOC_SUBDEV_G_DV_TIMINGS, VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_G_STD,
VIDIOC_SUBDEV_QUERY_DV_TIMINGS, VIDIOC_SUBDEV_QUERYSTD,
VIDIOC_SUBDEV_S_DV_TIMINGS, VIDIOC_SUBDEV_S_EDID, and
VIDIOC_SUBDEV_S_STD.
2018-10-24 07:48:56 +00:00
f5b9ee4945 xtensa: fix typo in pkey_alloc syscall number
* linux/xtensa/syscallent.h (pkey_alloc): Change from 249 to 349.
2018-09-27 19:46:36 +00:00
e78becf8b9 xlat: print _IOC_NONE in symbolic form even if it is equal to 0
On some architectures _IOC_NONE equals to 1, on others it is 0.
Change the way how ioctl direction flags are printed so that
_IOC_NONE is printed in symbolic form even if it is equal to 0.

* xlat/ioctl_dirs.in (_IOC_NONE): Move to the head of the list.
* tests/ioctl_inotify.c (main): Update expected output.
* tests/ioctl_loop. (main): Likewise.c
* tests/ioctl_perf.c (main): Likewise.
* tests/ioctl_scsi.c (main): Likewise.
2018-09-23 09:54:55 +00:00
9eeab98448 Disable git-archive
Since configure uses git-version-gen which in turn depends
on "git describe" or  a .tarball-version file, raw archives
generated by "git archive" cannot be built.

* .gitattributes: New file.
* README-github_gitlab-autogenerated-archives.txt: Likewise.
2018-09-18 21:54:17 +00:00
96df4b36f6 Workaround signedness bugs in system NLMSG_OK reported by -Wsign-compare
Introduce a replacement for NLMSG_OK provided by <linux/netlink.h> since
that system macro contains signedness bugs that are not going to be fixed.

* netlink.h: Include <stdbool.h>.
(is_nlmsg_ok): New static inline function.
* socketutils.c (receive_responses): Use it instead of NLMSG_OK.
* tests/netlink_inet_diag.c (check_responses): Likewise.
* tests/netlink_netlink_diag.c (check_responses): Likewise.
* tests/netlink_unix_diag.c (check_responses): Likewise.

Closes: https://github.com/strace/strace/issues/79
2018-09-16 21:32:37 +00:00
f708bcfa45 tests/sprintrc.c: drop redundant check
* tests/sprintrc.c (sprintrc_ex): Remove fmt check, this also fixes the
warning reported by clang -Wtautological-constant-out-of-range-compare.
2018-09-16 16:45:24 +00:00
305e47a9ae build: enable gcc -Woverride-init and clang -Winitializer-overrides
* m4/st_warn_cflags.m4 (gl_WARN_ADD): Add -Winitializer-overrides
and -Woverride-init.
2018-09-16 11:44:01 +00:00
762d8e06bf tests: exclude arm_sync_file_range from ksysent test
arm_sync_file_range is better known as sync_file_range2.

* tests/ksysent.sed: Filter out arm_sync_file_range.
2018-09-16 11:44:01 +00:00
af39dee46c Ignore warnings about overridden initialization of hwaddr_sizes
As hwaddr_sizes array is explicitly initialized this way,
ignore potential warnings reported by gcc -Woverride-init
and clang -Winitializer-overrides.

* gcc_compat.h (CLANG_PREREQ): New macro.
(DIAG_PUSH_IGNORE_OVERRIDE_INIT, DIAG_POP_IGNORE_OVERRIDE_INIT): New
macros non-trivially defined for gcc >= 4.2 and clang >= 2.8.
* sock.c (print_ifreq): Use them to ignore warnings about overridden
initialization of hwaddr_sizes array.

Closes: https://github.com/strace/strace/issues/77
2018-09-16 11:44:01 +00:00
d7cbc89824 tests: workaround clang -Wunneeded-internal-declaration bug
* tests/execve.c (main): Explicitly mark q_envp variable as used
to workaround clang -Wunneeded-internal-declaration bug.
* tests/execveat.c (main): Likewise.
* tests/nsyscalls.c (main): Explicitly mark syscallent variable as used
to workaround clang -Wunneeded-internal-declaration bug.

Closes: https://github.com/strace/strace/issues/78
2018-09-16 09:48:16 +00:00
Eugene Syromyatnikov
5aba529854 process: honor xlat style in print_user_offset_addr
* process.c (print_user_offset_addr): Print in accordance with xlat
verbosity setting.
2018-09-04 11:13:52 +00:00
Eugene Syromyatnikov
92b04d4a22 time: add xlat styles support to printclockname
* time.c (printclockname): Respectl xlat_verbosity.
2018-09-04 11:13:52 +00:00
Eugene Syromyatnikov
4b0130a7d0 perf: rewrite print_perf_event_attr using PRINT_FIELD_* macros
* perf.c: Include "print_fields.h".
(PRINT_XLAT): Remove.
(print_perf_event_attr): Use PRINT_FIELD_* macros.
2018-09-04 11:13:52 +00:00
Eugene Syromyatnikov
750cdcba9c tests: check stack unwinding for signals
* tests/stack-fcall-3.c: Include <signal.h>.
(f3): Call getpid or kill depending on the argument, store getpid result.
* tests/stack-fcall.c (main): Remove arguments, call f0(0) and f0(1).
* tests/strace-k-demangle.expected: Update expected output.
* tests/strace-k.expected: Likewise.
* tests/strace-k.test: Rewrite pattern matching code.

Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
2018-09-03 12:05:48 +00:00
Eugene Syromyatnikov
302cf02757 Print stack traces on signals
I don't know why it hasn't been done earlier.

* strace.c (print_stopped) [ENABLE_STACKTRACE]: Call unwind_tcb_print
if stack trace printing is enabled.
2018-09-03 12:05:48 +00:00
Eugene Syromyatnikov
a5918bf7e6 xlat: provide fallback definitions for open_access_modes constants
* xlat/open_access_modes.in: Add fallback values.
2018-09-03 10:16:50 +00:00
Eugene Syromyatnikov
4499e109ec xlat: update resources
* xlat/resources.in: Declare as #value indexed, provide fallback values.
(RLIMIT_VMEM): Remove.
2018-09-03 10:16:50 +00:00
Eugene Syromyatnikov
201e01dbac nlattr: ignore nla_type flags when selecting nlattr decoder
* nlattr.c (decode_nlattr_with_data): Apply NLA_TYPE_MASK to nla_type
before decoder selection.
2018-09-03 10:16:50 +00:00
Eugene Syromyatnikov
ac2f6695cd netlink_packet_diag: assorted decoding fixes
* xlat/af_packet_versions.in: New file.
* netlink_packet_diag.c: Include "xlat/af_packet_versions.h".
(decode_packet_diag_req): sdiag_protocol shouldn't be decoded as a protocol,
currently it should be set to 0.
(decode_packet_diag_info): Decode pdi_version field using af_packet_versions
xlat; decode pdi_index field as an interface index.
(packet_diag_msg_nla_decoders) <PACKET_DIAG_UID>: Decode using
decode_nla_uid.
(decode_packet_diag_msg): Decode pdiag_num as an low-level protocol.
* tests/netlink_sock_diag.c: Update expected output.
* tests/nlattr_packet_diag_msg.c: Likewise.
2018-09-02 22:38:21 +00:00
Eugene Syromyatnikov
da048e91a1 sockaddr: add X.25 socket address decoding support
* sockaddr.c: Include <linux/x25.h>.
(print_sockaddr_data_x25): New function.
(sa_printers) <[AF_X25]>: New socket address handler.
* tests/net-sockaddr.c (check_x25): New function.
(main): Use it to check X.25 socket address decoding.
2018-09-02 22:03:43 +00:00
Eugene Syromyatnikov
cfb86ab4e9 net: add support for AX.25 protocols and socket option names decoding
* xlat/ax25_protocols.in: New file.
* xlat/sock_ax25_options.in: Likewise.
* net.c: Include "xlat/ax25_protocols.h" and "xlat/sock_ax25_options.h".
* (SYS_FUNC(socket)): <[AF_AX25]>: Print protocol name using
ax25_protocols xlat.
(print_sockopt_fd_level_name) <[SOL_AX25]>: Print socket option name
using sock_ax25_options xlat.
2018-09-02 22:03:43 +00:00
Eugene Syromyatnikov
92d020787f sockaddr: decode AX.25 socket addresses
* defs.h (print_ax25_addr): New prototype.
* print_fields.h (PRINT_FIELD_AX25_ADDR): New macro.
* sockaddr.c: Include <linux/ax25.h>.
(check_ax25_address, ax25_addr2str, print_ax25_addr_raw,
print_ax25_addr, print_sockaddr_data_ax25): New functions.
(sa_printers) <[AF_AX25]>: New printer.
* tests/net-sockaddr.c (AX25_ADDR): New macro.
(check_ax25): New function.
(main): Use it to check AX.25 socket address decoding.
2018-09-02 22:03:43 +00:00
Eugene Syromyatnikov
cbbf708b4d macros: add ROUNDUP macro
* macros.h (ROUNDUP): New macro.
2018-09-02 22:03:43 +00:00
Eugene Syromyatnikov
c3ac40611c futex: recognise FUTEX_BITSET_MATCH_ANY bitmask
* xlat/futexbitset.in: New file.
* futex.c: Include "xlat/futexbitset.h".
(futex) <FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET>: Decode val3 using
futexbitset xlat.
* tests/futex.c: Add checks for 0xffffffff bitset mask printing.

Closes: Linux commit v4.16-rc1~166^2^2~2
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
8a56b8a1b7 ioprio: move constant definitions to xlat
* xlat/ioprio_class.in: Add fallback values.
* xlat/ioprio_who.in: Likewise.
* ioprio.c: Remove IOPRIO_WHO_* and IOPRIO_CLASS_* enums.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
38e0f55602 net: decode AF_PACKET protocols in socket syscall
* net.c: Include "xlat/ethernet_protocols.h" in XLAT_MACROS_ONLY mode.
(SYS_FUNC(socket)) <AF_PACKET>: Decode using ethernet_protocols xlat.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
9a969eb670 print_ifindex: add public get_ifname method
In order to be able to obtain sanitised device name internally.

* defs.h (get_ifname): New declaration.
* print_ifindex.c (get_ifname): Refactor, leaving out addition
of if_nametoindex("") part.
(sprint_ifname): New function, adds if_nametoindex("")
to get_ifname's output.
(print_ifindex): Use sprint_ifname instead of get_ifname.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
ef859a2702 socketutils: introduce get_family_by_proto
Add a helper function that returns address family based on the internal
notion of the socket protocol using protocols table.

* defs.h (get_family_by_proto): New declaration.
* socketutils.c (get_family_by_proto): New function.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
54fc755c56 socketutils: add more IP/IPv6 transport protocols
* defs.h (sock_proto): Add SOCK_PROTO_UDPLITE, SOCK_PROTO_DCCP,
SOCK_PROTO_SCTP, SOCK_PROTO_L2TP_IP, SOCK_PROTO_PING, SOCK_PROTO_RAW,
SOCK_PROTO_UDPLITEv6, SOCK_PROTO_DCCPv6, SOCK_PROTO_L2TP_IPv6,
SOCK_PROTO_SCTPv6, SOCK_PROTO_PINGv6, and SOCK_PROTO_RAWv6.
* socketutils.c: Include "xlat/inet_protocols.h" in XLAT_MACROS_ONLY
mode.
(protocols): Add protocol descriptions for them.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
7c08fe37a1 socketutils: store more information in protocols table
This also allows getting rid of all these *_v[46]_get calls.

* socketutils.c (unix_get, inet_get, netlink_gen): Add family, protocol,
and proto_name paramteres, use them where appropriate.
(tcp_v4_get, udp_v4_get, tcp_v6_get, udp_v6_get): Remove.
(protocols): Add family and proto fields to the structure, call inet_get
for IP/IPv6 protocols.
(get_sockaddr_by_inode_uncached): Update protocols->get calls.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
a302982576 sockaddr: whitespace cleanup, fix typo in comment
* sockaddr.c (print_sockaddr_data_bt): Fix typo, remove excess
indentation from the switch statement.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
f561173367 tests: add utimensat test variants with different xlat verbosity levels
* tests/utimensat-Xabbrev.c: New file.
* tests/utimensat-Xraw.c: Likewise.
* tests/utimensat-Xverbose.c: Likewise.
* tests/utimensat.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags.
* tests/pure_executables.list: Add utimensat-Xabbrev, utimensat-Xraw,
and utimensat-Xverbose.
* tests/.gitignore: Likewise.
* tests/gen_tests.in (utimensat-Xabbrev, utimensat-Xraw, utimensat-Xverbose): New
tests.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
9f4b5992fe print_timespec: make print_timespec_t_utime respect xlat style setting
* print_timespec.c (print_timespec_t_utime): Print raw timespec value
in accordance with xlat style setting.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
79878e783c netlink: honor custom xlat style setting during nlmsg flags printing
Commit v4.23~343 introduced xlat style argument to printflags_ex, but
XLAT_STYLE_DEFAULT was introduced only in the next commit v4.23~342,
which led to missing out fixing the sole external user of this
peculiar extended interface.

* netlink.c (decode_nlmsg_flags): Use XLAT_STYLE_DEFAULT instead of
XLAT_STYLE_ABBREV in printflags_ex call.

Fixes: v4.23~342 "Introduce XLAT_STYLE_DEFAULT"
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
298f29a15b netlink_netfilter: use xlat styles for res_id workaround printing
* netlink_netfilter.c (decode_netlink_netfilter): Call print_xlat_ex
in order to respect xlat style setting.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
6177e74134 xlat: provide fallback definitions for epollevents
* xlat/epollevents.in: Provide fallback definitions, add EPOLLNVAL
constant (introduced by Linux commit v4.16-rc1~3^2~3).
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
b05d2667e9 xlat: provide fallback definitions to pollflags
* xlat/pollflags.in: Add fallback definitions for POLLWRNORM,
POLLWRBAND, POLLMSG, POLLREMOVE, and POLLRDHUP.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
fdfc68a984 xlat: provide fallback values for socktypes
* xlat/socktypes.in: Provide fallback values.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
3f10639284 xlat: provide fallback values to route_nexthop_flags
* xlat/route_nexthop_flags.in: Add fallback values.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
618d4ed497 block: move fallback definitions for ioctl commands to xlat
* xlat/block_ioctl_cmds.in: New file.
* block.c: Include "xlat/block_ioctl_cmds.h" in XLAT_MACROS_ONLY mode.
(BLKPG, BLKTRACESETUP, BLKTRACESTART, BLKTRACESTOP, BLKTRACETEARDOWN,
BLKDISCARD, BLKIOMIN, BLKIOOPT, BLKALIGNOFF, BLKPBSZGET,
BLKDISCARDZEROES, BLKSECDISCARD, BLKROTATIONAL, BLKZEROOUT): Remove
fallback definitions as those are porvided by block_ioctl_cmds xlat now.
2018-09-01 14:38:12 +00:00
Eugene Syromyatnikov
9b5d56054c Decode BLKGETSIZE64 unconditionally
It is available on all supported kernel versions.

* block.c (block_ioctl): Remove #ifdef HAVE_BLKGETSIZE64.
* configure.ac: Remove BLKGETSIZE64 check.
2018-09-01 14:38:12 +00:00