Commit Graph

6007 Commits

Author SHA1 Message Date
Gleb Fotengauer-Malinovskiy
78f448e8c7 maint: remove KVM_PPC_CONFIGURE_V3_MMU ioctl from non-powerpc arches
* maint/ioctls_sym.sh (ppc_list): Update.
2017-11-13 20:21:22 +00:00
18f69cceeb Update copyright headers
Headers updated semi-automatically using
maint/update_copyright_years.sh script.

* m4/mpers.m4: Update copyright years.
* tests/kcmp.c: Likewise.
* tests/membarrier.c: Likewise.
2017-11-12 00:11:06 +00:00
73e9f00754 maint/update_copyright_years.sh: fix typo in help output
* maint/update_copyright_years.sh (print_help): Fix typo, disable
here-document expansion.
2017-11-11 23:08:09 +00:00
Eugene Syromiatnikov
bb9673ba1d Move MIN, MAX, and CLAMP to macros.h
We shouldn't have to include the whole defs.h to get them.

* defs.h (MIN, MAX, CLAMP): Move ...
* macros.h: ... here.
2017-11-10 17:35:18 +00:00
Eugene Syromiatnikov
f3d9348fd1 Update .mailmap
* .mailmap (Eugene Syromyatnikov): Add work address.
2017-11-10 17:35:18 +00:00
Steve McIntyre
6d87820a94 debian: update debhelper compat level to 10, replace -s with -a in some calls 2017-11-07 23:04:09 +00:00
Steve McIntyre
83e88bd659 debian: update Standards-Version to 3.9.8 2017-11-07 23:04:09 +00:00
9517cfa996 mpers.m4: check for size of long and kernel_long_t
The primary purpose of this new check is diagnostics.

* m4/mpers.m4 (st_MPERS): Check for size of long and kernel_long_t.
2017-11-06 19:21:58 +00:00
Eugene Syromyatnikov
04a65a183b xlat/gen.sh: speedup xlat generation
This commit implements the following changes:
- increases the number of concurrent jobs to twice the CPU count;
- creates a circular buffer, so instead of running multiple jobs
  at once, the generator tries to keep about the same number of jobs
  being run concurrently;
- runs gen_git and gen_make concurrently in order to squeeze in
  one more bit of concurrency.

With my deeply scientific measurements, this approach achieves
up to 15% speedup with dash and about 30-40% with bash as /bin/sh
on a 4-core machine.

* xlat/gen.sh (main): Declare pids local variable, append pid of every
run job to it; increase the limit of jobs to ncpus * 2; when the limit
is reached, wait for the first pid in pids instead of resetting jobs
to zero and waiting for all the run jobs; put gen_git and gen_make
into background.
2017-11-06 19:21:58 +00:00
4d8eedbd4f hppa: wire up statx syscall
* linux/hppa/syscallent.h [349]: Add statx entry.
2017-11-05 20:18:44 +00:00
c458ea4d77 tests: check signal mask transparency
Starting with commit v4.17-5-gf83b49b strace is expected
to forward the signal mask to tracees unchanged.

* tests/check_sigblock.c: New file.
* tests/set_sigblock.c: Likewise.
* tests/sigblock.test: New test.
* tests/.gitignore: Add check_sigblock and set_sigblock.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(MISC_TESTS): Add sigblock.test.
2017-11-04 23:43:55 +00:00
ff1bc06589 tests: check signal disposition transparency
Starting with commit v4.17-8-ge97a66f strace is expected
to forward the signal disposition to tracees unchanged.

* tests/check_sigign.c: New file.
* tests/list_sigaction_signum.c: Likewise.
* tests/set_sigign.c: Likewise.
* tests/sigign.test: New test.
* tests/.gitignore: Add check_sigign, list_sigaction_signum,
and set_sigign.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(MISC_TESTS): Add sigign.test.
2017-11-03 23:10:38 +00:00
Eugene Syromyatnikov
48cb6336d8 tests: update futex test to accommodate the recent kernel change
Kernel commit v4.14-rc1~162^2~8 refactored futex implementation and
introduced checks for invalid shift sizes.  Accommodate this change
by allowing EINVAL in the corresponding futex checks.

* tests/futex.c (CHECK_FUTEX_GENERIC): Reset errno before the syscall.
(main) <wake_ops>: Add err2 field, describe err/err2 fields.
Add EINVAL as a possible errno to the checks that contain invalid
shift values.
Update return value check so it checks that values are strictly
as expected.

Closes: https://github.com/strace/strace/pull/16
2017-11-03 20:46:47 +00:00
Eugene Syromyatnikov
052a399cce tests: cleanup futex test
* tests/futex.c (main) <wake_ops>: Remove unused errstr field
from the structure type definition.
2017-11-03 20:46:47 +00:00
5d460ae383 seccomp: decode SECCOMP_GET_ACTION_AVAIL operation
* defs.h (seccomp_ret_action): New xlat prototype.
* seccomp.c (decode_seccomp_set_mode_strict): Remove.
(SYS_FUNC(seccomp)): Decode SECCOMP_GET_ACTION_AVAIL operation.
* NEWS: Mention this.
* tests/seccomp_get_action_avail.c: New file.
* tests/gen_tests.in (seccomp_get_action_avail): New entry.
* tests/pure_executables.list: Add seccomp_get_action_avail.
* tests/.gitignore: Likewise.
2017-11-02 00:21:57 +00:00
745c53410f Add SECCOMP_RET_KILL_PROCESS decoding support
* bpf_seccomp_filter.c [!SECCOMP_RET_ACTION]: Remove.
[!SECCOMP_RET_ACTION_FULL] (SECCOMP_RET_ACTION_FULL): Define.
(print_seccomp_filter_k): Use SECCOMP_RET_ACTION_FULL
instead of SECCOMP_RET_ACTION.
* xlat/seccomp_ret_action.in: Add SECCOMP_RET_KILL_PROCESS introduced
by linux kernel commit v4.14-rc2~15^2~3.
2017-11-01 02:05:41 +00:00
01d45b6c2b Rename SECCOMP_RET_KILL to SECCOMP_RET_KILL_THREAD
Follow linux kernel commit v4.14-rc2~15^2~4 and rename SECCOMP_RET_KILL
to SECCOMP_RET_KILL_THREAD.

* xlat/seccomp_ret_action.in (SECCOMP_RET_KILL): Rename
to SECCOMP_RET_KILL_THREAD.
* tests/prctl-seccomp-filter-v.c (main): Update expected output.
* tests/seccomp-filter-v.c (main): Likewise.
2017-11-01 02:02:21 +00:00
3ed59f89fd Update SECCOMP_* constants
* xlat/seccomp_filter_flags.in: Add SECCOMP_FILTER_FLAG_LOG introduced
by kernel commit v4.14-rc2~15^2~6.
* xlat/seccomp_ops.in: Add SECCOMP_GET_ACTION_AVAIL introduced
by kernel commit v4.14-rc2~15^2~9.
* xlat/seccomp_ret_action.in: Add SECCOMP_RET_LOG introduced
by kernel commit v4.14-rc2~15^2~5.
* NEWS: Mention this.
* tests/seccomp-filter.c (main): Update expected output.
* tests/seccomp-filter-v.c (main): Likewise.
2017-11-01 02:00:04 +00:00
2ce8a26a9a Provide fallback definitions for SECCOMP_RET_* constants
* xlat/seccomp_ret_action.in: Add fallback definitions.
2017-11-01 02:00:04 +00:00
1079428852 tests: robustify options-syntax.test against inquisitive musl
Workaround musl >= 1.1.17 ability to use AT_EXECFN during
program_invocation_name initialization.

* tests/options-syntax.test: Check for two valid variants
of "zeroargc strace" expected output.
2017-11-01 01:43:25 +00:00
73354cff1a Update MEMBARRIER_CMD_* constants
* xlat/membarrier_cmds.in: Add MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED
introduced by kernel commit v4.14-rc6~26.
* tests/membarrier.c (main): Update expected output.
2017-11-01 00:20:44 +00:00
JingPiao Chen
98e7eec333 tests: check decoding of NFNL_SUBSYS_NFT_COMPAT netlink message flags
* tests/nfnetlink_nft_compat.c (test_nlmsg_flags): New function.
(main): Use it.
2017-10-31 11:59:55 +08:00
JingPiao Chen
76e1dbb539 tests: check decoding of NFNL_SUBSYS_NFTABLES netlink message flags
* tests/nfnetlink_nftables.c (test_nlmsg_flags): New function.
(main): Use it.
2017-10-31 11:59:55 +08:00
JingPiao Chen
3617415443 tests: check decoding of NFNL_SUBSYS_CTHELPER netlink message flags
* tests/nfnetlink_cthelper.c (test_nlmsg_flags): New function.
(main): Use it.
2017-10-31 11:59:55 +08:00
JingPiao Chen
148e20ccdc tests: check decoding of NFNL_SUBSYS_CTNETLINK_TIMEOUT netlink message flags
* tests/nfnetlink_cttimeout.c (test_nlmsg_flags): New function.
(main): Use it.
2017-10-31 11:59:55 +08:00
JingPiao Chen
66e923f09d tests: check decoding of NFNL_SUBSYS_ACCT netlink message flags
* tests/nfnetlink_acct.c (test_nlmsg_flags): New function.
(main): Use it.
2017-10-31 11:59:55 +08:00
JingPiao Chen
2a23f1d638 tests: check decoding of NFNL_SUBSYS_CTNETLINK_EXP netlink message flags
* tests/nfnetlink_ctnetlink_exp.c (test_nlmsg_flags): New function.
(main): Use it.
2017-10-31 11:59:55 +08:00
JingPiao Chen
07c91defbc tests: check decoding of NFNL_SUBSYS_CTNETLINK netlink message flags
* tests/nfnetlink_ctnetlink.c (test_nlmsg_flags): New function.
(main): Use it.
2017-10-31 11:59:42 +08:00
JingPiao Chen
58739bf243 netlink: decode NETLINK_NETFILTER netlink message flags
* netlink.c (decode_nlmsg_flags_netfilter): New function.
(nlmsg_flags): Add NETLINK_NETFILTER.
* NEWS: Mention this.
2017-10-26 18:08:03 +00:00
JingPiao Chen
b56c8dbcfb netlink: decode netlink message delete flags
* netlink.c: Include "xlat/netlink_delete_flags.h".
(decode_nlmsg_flags_crypto, decode_nlmsg_flags_route,
decode_nlmsg_flags_xfrm): Decode delete flags.
* netlink.h (NLM_F_NONREC): New macro.
* xlat/netlink_delete_flags.in: New file.
* tests/netlink_crypto.c (test_nlmsg_flags): Check this.
* tests/netlink_route.c (test_nlmsg_flags): Likewise.
* tests/netlink_xfrm.c (test_nlmsg_flags): Likewise.
2017-10-26 18:07:03 +00:00
JingPiao Chen
695de1df13 netlink: refactor decode_nlmsg_flags
Refactor decode_nlmsg_flags to make it family-specific, just like
decode_nlmsg_type and decode_payload.

* netlink.c (decode_nlmsg_flags_crypto, decode_nlmsg_flags_route,
decode_nlmsg_flags_sock_diag, decode_nlmsg_flags_xfrm): New functions.
(nlmsg_flags_decoder_t): New typedef.
(nlmsg_flags): New array.
(decode_nlmsg_flags): Use it.
2017-10-26 18:04:08 +00:00
JingPiao Chen
69c68ef5bf Workaround historic linux/netfilter/xt_osf.h deficiencies
When using linux kernel headers without commit v4.5-rc1~128^2~115^2~22
("netfilter: fix include files for compilation"), both <linux/ip.h>
and <linux/tcp.h> have to be included before <linux/netfilter/xt_osf.h>.

* configure.ac (AC_CHECK_HEADERS): Include <linux/ip.h>
and <linux/tcp.h> when checking for linux/netfilter/xt_osf.h header.
* tests/nfnetlink_osf.c: Include <linux/ip.h> and <linux/tcp.h>
before <linux/netfilter/xt_osf.h>.
2017-10-14 18:29:51 +00:00
JingPiao Chen
489d8a9564 tests: check decoding of NFNL_SUBSYS_NFT_COMPAT netlink message types
* configure.ac (AC_CHECK_HEADERS): Add
linux/netfilter/nf_tables_compat.h.
* tests/nfnetlink_nft_compat.c: New file.
* tests/gen_tests.in (nfnetlink_nft_compat): New entry.
* tests/pure_executables.list: Add nfnetlink_nft_compat.
* tests/.gitignore: Likewise.
2017-09-24 10:07:58 +00:00
JingPiao Chen
b27bee724d tests: check decoding of NFNL_SUBSYS_NFTABLES netlink message types
* configure.ac (AC_CHECK_HEADERS): Add linux/netfilter/nf_tables.h.
* tests/nfnetlink_nftables.c: New file.
* tests/gen_tests.in (nfnetlink_nftables): New entry.
* tests/pure_executables.list: Add nfnetlink_nftables.
* tests/.gitignore: Likewise.
2017-09-24 10:07:58 +00:00
JingPiao Chen
935e0629c5 tests: check decoding of NFNL_SUBSYS_CTHELPER netlink message types
* configure.ac (AC_CHECK_HEADERS): Add
linux/netfilter/nfnetlink_cthelper.h.
* tests/nfnetlink_cthelper.c: New file.
* tests/gen_tests.in (nfnetlink_cthelper): New entry.
* tests/pure_executables.list: Add nfnetlink_cthelper.
* tests/.gitignore: Likewise.
2017-09-24 10:07:58 +00:00
JingPiao Chen
130b1ade11 tests: check decoding of NFNL_SUBSYS_CTNETLINK_TIMEOUT netlink message types
* configure.ac (AC_CHECK_HEADERS): Add
linux/netfilter/nfnetlink_cttimeout.h.
* tests/nfnetlink_cttimeout.c: New file.
* tests/gen_tests.in (nfnetlink_cttimeout): New entry.
* tests/pure_executables.list: Add nfnetlink_cttimeout.
* tests/.gitignore: Likewise.
2017-09-24 10:07:58 +00:00
JingPiao Chen
fa94d0e5e0 tests: check decoding of NFNL_SUBSYS_ACCT netlink message types
* configure.ac (AC_CHECK_HEADERS): Add
linux/netfilter/nfnetlink_acct.h.
* tests/nfnetlink_acct.c: New file.
* tests/gen_tests.in (nfnetlink_acct): New entry.
* tests/pure_executables.list: Add nfnetlink_acct.
* tests/.gitignore: Likewise.
2017-09-24 10:07:58 +00:00
JingPiao Chen
f61c513898 tests: check decoding of NFNL_SUBSYS_IPSET netlink message types
* configure.ac (AC_CHECK_HEADERS): Add linux/netfilter/ipset/ip_set.h.
* tests/nfnetlink_ipset.c: New file.
* tests/gen_tests.in (nfnetlink_ipset): New entry.
* tests/pure_executables.list: Add nfnetlink_ipset.
* tests/.gitignore: Likewise.
2017-09-24 10:07:58 +00:00
JingPiao Chen
0d870031b3 tests: check decoding of NFNL_SUBSYS_OSF netlink message types
* configure.ac (AC_CHECK_HEADERS): Add linux/netfilter/xt_osf.h.
* tests/nfnetlink_osf.c: New file.
* tests/gen_tests.in (nfnetlink_osf): New entry.
* tests/pure_executables.list: Add nfnetlink_osf.
* tests/.gitignore: Likewise.
2017-09-24 10:07:58 +00:00
JingPiao Chen
ed593fef59 tests: check decoding of NFNL_SUBSYS_ULOG netlink message types
* configure.ac (AC_CHECK_HEADERS): Add
linux/netfilter/nfnetlink_log.h.
* tests/nfnetlink_ulog.c: New file.
* tests/gen_tests.in (nfnetlink_ulog): New entry.
* tests/pure_executables.list: Add nfnetlink_ulog.
* tests/.gitignore: Likewise.
2017-09-24 10:07:58 +00:00
JingPiao Chen
cd02efa8cf tests: check decoding of NFNL_SUBSYS_QUEUE netlink message types
* configure.ac (AC_CHECK_HEADERS): Add
linux/netfilter/nfnetlink_queue.h.
* tests/nfnetlink_queue.c: New file.
* tests/gen_tests.in (nfnetlink_queue): New entry.
* tests/pure_executables.list: Add nfnetlink_queue.
* tests/.gitignore: Likewise.
2017-09-24 10:07:58 +00:00
JingPiao Chen
9854baf382 tests: check decoding of NFNL_SUBSYS_CTNETLINK_EXP netlink message types
* tests/nfnetlink_ctnetlink_exp.c: New file.
* tests/gen_tests.in (nfnetlink_ctnetlink_exp): New entry.
* tests/pure_executables.list: Add nfnetlink_ctnetlink_exp.
* tests/.gitignore: Likewise.
2017-09-24 10:07:58 +00:00
JingPiao Chen
f2ee2a845e tests: check decoding of NFNL_SUBSYS_CTNETLINK netlink message types
* configure.ac (AC_CHECK_HEADERS): Add
linux/netfilter/nfnetlink_conntrack.h.
* tests/nfnetlink_ctnetlink.c: New file.
* tests/gen_tests.in (nfnetlink_ctnetlink): New entry.
* tests/pure_executables.list: Add nfnetlink_ctnetlink.
* tests/.gitignore: Likewise.
2017-09-24 10:07:57 +00:00
JingPiao Chen
c5d6bccdb0 netlink: decode NETLINK_NETFILTER netlink message types
* netlink.c: Include "xlat/nf_acct_msg_types.h",
"xlat/nf_cthelper_msg_types.h", "xlat/nf_ctnetlink_exp_msg_types.h",
"xlat/nf_ctnetlink_msg_types.h", "xlat/nf_cttimeout_msg_types.h",
"xlat/nf_ipset_msg_types.h", "xlat/nf_nft_compat_msg_types.h",
"xlat/nf_nftables_msg_types.h", "xlat/nf_osf_msg_types.h",
"xlat/nf_queue_msg_types.h", and "xlat/nf_ulog_msg_types.h".
(nf_nlmsg_types): New array.
(decode_nlmsg_type_netfilter): Use it.
* NEWS: Mention this.
* xlat/nf_acct_msg_types.in: New file.
* xlat/nf_cthelper_msg_types.in: Likewise.
* xlat/nf_ctnetlink_exp_msg_types.in: Likewise.
* xlat/nf_ctnetlink_msg_types.in: Likewise.
* xlat/nf_cttimeout_msg_types.in: Likewise.
* xlat/nf_ipset_msg_types.in: Likewise.
* xlat/nf_nft_compat_msg_types.in: Likewise.
* xlat/nf_nftables_msg_types.in: Likewise.
* xlat/nf_osf_msg_types.in: Likewise.
* xlat/nf_queue_msg_types.in: Likewise.
* xlat/nf_ulog_msg_types.in: Likewise.
* tests/netlink_netfilter.c (test_nlmsg_type): Update expected output.
2017-09-24 10:07:57 +00:00
2d3a697810 ppc64: fix sigreturn parser for ppc personality
* linux/powerpc/arch_sigreturn.c (arch_sigreturn) [POWERPC64]: Rewrite.
2017-09-20 00:15:02 +00:00
55b097b506 ppc64: truncate syscall args for 32-bit personality tracees
* linux/powerpc/get_syscall_args.c (get_syscall_args): Clear upper
32 bits of syscall args for 32-bit personality tracees.
* NEWS: Mention this fix.
2017-09-20 00:15:02 +00:00
c8a294a585 ppc64: fix PRI__64 macro definition when compiled with -m32
* kernel_types.h [SIZEOF_LONG != 4]: Check for __powerpc64__ instead
of POWERPC to handle -m32 case properly.
2017-09-20 00:15:02 +00:00
5b9de7b081 loop: decode LOOP_SET_BLOCK_SIZE
* loop.c (loop_ioctl) <LOOP_SET_BLOCK_SIZE>: Handle LOOP_SET_BLOCK_SIZE.
* tests/ioctl_loop.c (main): Check it.
2017-09-19 11:32:05 +00:00
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
Gleb Fotengauer-Malinovskiy
55bc4164bd maint: generate ioctl entries without target architecture code execution
ioctls_sym.sh used to generate and invoke target architecture
executables that limited its applicability.
After this change, the generated code is just compiled to the target
architecture object files and all required information is obtained
from the dwarf sections.
This approach allows to generate ioctl entries for any target
architecture supported by compiler.

* maint/ioctls_sym.awk: New file.
* maint/ioctls_sym.sh (LC_ALL): Define to C and export.
(uname_m): Make configurable.
(CFLAGS): Add -gdwarf-2.
(LDFLAGS): Remove.
Do not use print_ioctlent.c.
Change asm-generic/ioctl.h and asm/ioctl.h hook.
Dump and process dwarf sections of generated object files.
* maint/print_ioctlent.c: Remove.
2017-09-19 11:32:05 +00:00