]> granicus.if.org Git - strace/log
strace
6 years agotests: robustify options-syntax.test against inquisitive musl
Dmitry V. Levin [Wed, 1 Nov 2017 01:43:25 +0000 (01:43 +0000)]
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.

6 years agoUpdate MEMBARRIER_CMD_* constants
Dmitry V. Levin [Wed, 1 Nov 2017 00:20:44 +0000 (00:20 +0000)]
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.

6 years agotests: check decoding of NFNL_SUBSYS_NFT_COMPAT netlink message flags
JingPiao Chen [Sat, 28 Oct 2017 01:03:19 +0000 (09:03 +0800)]
tests: check decoding of NFNL_SUBSYS_NFT_COMPAT netlink message flags

* tests/nfnetlink_nft_compat.c (test_nlmsg_flags): New function.
(main): Use it.

6 years agotests: check decoding of NFNL_SUBSYS_NFTABLES netlink message flags
JingPiao Chen [Sat, 28 Oct 2017 01:01:27 +0000 (09:01 +0800)]
tests: check decoding of NFNL_SUBSYS_NFTABLES netlink message flags

* tests/nfnetlink_nftables.c (test_nlmsg_flags): New function.
(main): Use it.

6 years agotests: check decoding of NFNL_SUBSYS_CTHELPER netlink message flags
JingPiao Chen [Sat, 28 Oct 2017 00:58:44 +0000 (08:58 +0800)]
tests: check decoding of NFNL_SUBSYS_CTHELPER netlink message flags

* tests/nfnetlink_cthelper.c (test_nlmsg_flags): New function.
(main): Use it.

6 years agotests: check decoding of NFNL_SUBSYS_CTNETLINK_TIMEOUT netlink message flags
JingPiao Chen [Sat, 28 Oct 2017 00:55:44 +0000 (08:55 +0800)]
tests: check decoding of NFNL_SUBSYS_CTNETLINK_TIMEOUT netlink message flags

* tests/nfnetlink_cttimeout.c (test_nlmsg_flags): New function.
(main): Use it.

6 years agotests: check decoding of NFNL_SUBSYS_ACCT netlink message flags
JingPiao Chen [Sat, 28 Oct 2017 00:50:51 +0000 (08:50 +0800)]
tests: check decoding of NFNL_SUBSYS_ACCT netlink message flags

* tests/nfnetlink_acct.c (test_nlmsg_flags): New function.
(main): Use it.

6 years agotests: check decoding of NFNL_SUBSYS_CTNETLINK_EXP netlink message flags
JingPiao Chen [Sat, 28 Oct 2017 00:46:39 +0000 (08:46 +0800)]
tests: check decoding of NFNL_SUBSYS_CTNETLINK_EXP netlink message flags

* tests/nfnetlink_ctnetlink_exp.c (test_nlmsg_flags): New function.
(main): Use it.

6 years agotests: check decoding of NFNL_SUBSYS_CTNETLINK netlink message flags
JingPiao Chen [Mon, 18 Sep 2017 12:25:13 +0000 (20:25 +0800)]
tests: check decoding of NFNL_SUBSYS_CTNETLINK netlink message flags

* tests/nfnetlink_ctnetlink.c (test_nlmsg_flags): New function.
(main): Use it.

6 years agonetlink: decode NETLINK_NETFILTER netlink message flags
JingPiao Chen [Mon, 18 Sep 2017 12:13:14 +0000 (20:13 +0800)]
netlink: decode NETLINK_NETFILTER netlink message flags

* netlink.c (decode_nlmsg_flags_netfilter): New function.
(nlmsg_flags): Add NETLINK_NETFILTER.
* NEWS: Mention this.

6 years agonetlink: decode netlink message delete flags
JingPiao Chen [Thu, 21 Sep 2017 01:25:38 +0000 (09:25 +0800)]
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.

6 years agonetlink: refactor decode_nlmsg_flags
JingPiao Chen [Sat, 9 Sep 2017 15:43:20 +0000 (23:43 +0800)]
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.

6 years agoWorkaround historic linux/netfilter/xt_osf.h deficiencies
JingPiao Chen [Wed, 11 Oct 2017 14:41:50 +0000 (22:41 +0800)]
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>.

6 years agotests: check decoding of NFNL_SUBSYS_NFT_COMPAT netlink message types
JingPiao Chen [Sat, 9 Sep 2017 11:10:17 +0000 (19:10 +0800)]
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.

6 years agotests: check decoding of NFNL_SUBSYS_NFTABLES netlink message types
JingPiao Chen [Sat, 9 Sep 2017 11:07:21 +0000 (19:07 +0800)]
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.

6 years agotests: check decoding of NFNL_SUBSYS_CTHELPER netlink message types
JingPiao Chen [Sat, 9 Sep 2017 11:03:28 +0000 (19:03 +0800)]
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.

6 years agotests: check decoding of NFNL_SUBSYS_CTNETLINK_TIMEOUT netlink message types
JingPiao Chen [Sat, 9 Sep 2017 10:59:46 +0000 (18:59 +0800)]
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.

6 years agotests: check decoding of NFNL_SUBSYS_ACCT netlink message types
JingPiao Chen [Sat, 9 Sep 2017 10:54:08 +0000 (18:54 +0800)]
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.

6 years agotests: check decoding of NFNL_SUBSYS_IPSET netlink message types
JingPiao Chen [Sat, 9 Sep 2017 10:50:47 +0000 (18:50 +0800)]
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.

6 years agotests: check decoding of NFNL_SUBSYS_OSF netlink message types
JingPiao Chen [Sat, 9 Sep 2017 10:46:40 +0000 (18:46 +0800)]
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.

6 years agotests: check decoding of NFNL_SUBSYS_ULOG netlink message types
JingPiao Chen [Sat, 9 Sep 2017 10:42:50 +0000 (18:42 +0800)]
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.

6 years agotests: check decoding of NFNL_SUBSYS_QUEUE netlink message types
JingPiao Chen [Sat, 9 Sep 2017 10:39:10 +0000 (18:39 +0800)]
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.

6 years agotests: check decoding of NFNL_SUBSYS_CTNETLINK_EXP netlink message types
JingPiao Chen [Sat, 9 Sep 2017 10:35:19 +0000 (18:35 +0800)]
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.

6 years agotests: check decoding of NFNL_SUBSYS_CTNETLINK netlink message types
JingPiao Chen [Sat, 9 Sep 2017 10:29:12 +0000 (18:29 +0800)]
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.

6 years agonetlink: decode NETLINK_NETFILTER netlink message types
JingPiao Chen [Sat, 9 Sep 2017 09:42:41 +0000 (17:42 +0800)]
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.

6 years agoppc64: fix sigreturn parser for ppc personality
Dmitry V. Levin [Wed, 20 Sep 2017 00:15:02 +0000 (00:15 +0000)]
ppc64: fix sigreturn parser for ppc personality

* linux/powerpc/arch_sigreturn.c (arch_sigreturn) [POWERPC64]: Rewrite.

6 years agoppc64: truncate syscall args for 32-bit personality tracees
Dmitry V. Levin [Wed, 20 Sep 2017 00:15:02 +0000 (00:15 +0000)]
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.

6 years agoppc64: fix PRI__64 macro definition when compiled with -m32
Dmitry V. Levin [Wed, 20 Sep 2017 00:15:02 +0000 (00:15 +0000)]
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.

6 years agoloop: decode LOOP_SET_BLOCK_SIZE
Dmitry V. Levin [Tue, 19 Sep 2017 11:32:05 +0000 (11:32 +0000)]
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.

6 years agoUpdate ioctl entries from linux v4.14-rc1
Dmitry V. Levin [Tue, 19 Sep 2017 11:32:05 +0000 (11:32 +0000)]
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.

6 years agomaint: generate ioctl entries without target architecture code execution
Gleb Fotengauer-Malinovskiy [Tue, 12 Sep 2017 17:13:12 +0000 (20:13 +0300)]
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.

6 years agoRemove KVM_S390_* ioctls from non-s390 architectures
Dmitry V. Levin [Mon, 18 Sep 2017 11:26:04 +0000 (11:26 +0000)]
Remove KVM_S390_* ioctls from non-s390 architectures

* maint/ioctls_sym.sh <linux/kvm.h> (s390_list): New variable.
Use it to exclude KVM_S390_* ioctls on non-s390 architectures.
* linux/arm/ioctls_arch0.h: Regenerate.
* linux/i386/ioctls_arch0.h: Likewise.
* linux/powerpc/ioctls_arch0.h: Likewise.
* linux/s390/ioctls_arch0.h: Likewise.
* linux/x86_64/ioctls_arch0.h: Likewise.

6 years agoRemove some of arch-specific KVM ioctls from non-matching architectures
Dmitry V. Levin [Sun, 17 Sep 2017 12:04:11 +0000 (12:04 +0000)]
Remove some of arch-specific KVM ioctls from non-matching architectures

* maint/ioctls_sym.sh (arm_list, ppc_list, x86_list): Use bracket
expressions to generalize arch-specific regular expressions.
* linux/arm/ioctls_arch0.h: Regenerate.
* linux/i386/ioctls_arch0.h: Likewise.
* linux/powerpc/ioctls_arch0.h: Likewise.
* linux/s390/ioctls_arch0.h: Likewise.
* linux/x86_64/ioctls_arch0.h: Likewise.

6 years agodm: add support for DM_DEV_ARM_POLL
Eugene Syromyatnikov [Sun, 17 Sep 2017 01:51:51 +0000 (03:51 +0200)]
dm: add support for DM_DEV_ARM_POLL

Added in Linux commit v4.13-rc1~137^2~14.

* dm.c [!DM_LIST_VERSIONS] (DM_LIST_VERSIONS): Add leading zero.
[!DM_TARGET_MSG] (DM_TARGET_MSG): Likewise.
[!DM_DEV_SET_GEOMETRY_CMD] (DM_DEV_SET_GEOMETRY_CMD): Likewise.
[!DM_DEV_ARM_POLL] (DM_DEV_ARM_POLL): New macro.
(dm_ioctl_has_params, dm_ioctl): Handle DM_DEV_ARM_POLL.
* tests/ioctl_dm.c [!DM_DEV_ARM_POLL] (DM_DEV_ARM_POLL): New macro.
(main) <dummy_check_cmds>: Add DM_DEV_ARM_POLL.

6 years agokcmp: add KCMP_EPOLL_TFD support
Eugene Syromyatnikov [Sat, 16 Sep 2017 01:05:33 +0000 (03:05 +0200)]
kcmp: add KCMP_EPOLL_TFD support

* configure.ac (AC_CHECK_TYPES): Add check for struct kcmp_epoll_slot.
* kcmp.c (SYS_FUNC(kcmp)) <case KCMP_EPOLL_TFD>: Implement idx1/idx2
argument parsing.
* tests/kcmp.c: Update test.
* xlat/kcmp_types.in (KCMP_EPOLL_TFD): New entry.

6 years agotests: add kcmp-y test
Eugene Syromyatnikov [Sat, 16 Sep 2017 01:04:40 +0000 (03:04 +0200)]
tests: add kcmp-y test

It is not very useful as of now, but it will allow tracking changes
in fd output once they are implemented.

* tests/gen_tests.in (kcmp-y): New test.
* tests/kcmp-y.c: New file, wrapper for kcmp.c
* tests/kcmp.c: Add opening of some files for which info may be printed
in the future.
* tests/pure_executables.list: Add kcmp-y.
* tests/.gitignore: Likewise.

6 years agokcmp: output fds using a separate function
Eugene Syromyatnikov [Sat, 16 Sep 2017 01:02:16 +0000 (03:02 +0200)]
kcmp: output fds using a separate function

This is a preparation for the future introduction of cross-NS PID
derivation, which would enable us to print fd information for fds
related to all processes, not just traced ones.

Note the change in output type for idx1/idx2 in KCMP_FILE command from
unsigned to int, it follows printfd output format.

* kcmp.c (printpidfd): New function.
(PRINT_FIELD_PIDFD): New macro.
(SYS_FUNC(kcmp)) <case KCMP_FILE>: Use printpidfd for printing
idx1/idx2, as they are fds, after all.

6 years agotests/kcmp: add more checks
Eugene Syromyatnikov [Sat, 16 Sep 2017 00:59:10 +0000 (02:59 +0200)]
tests/kcmp: add more checks

Let's check all kcmp commands that they indeed do not print idx1/idx2.
Also, check that upper bits of pid arguments are ignored.

* tests/gen_tests.in (kcmp): Decrease -a argument's value from 27 to 22.
* tests/kcmp.c: Add checks for upper bits of pid1/pid2 and for all
kcmp types not tested before.

6 years agotests/kcmp: use <linux/kcmp.h> if it is available
Eugene Syromyatnikov [Sat, 16 Sep 2017 00:56:14 +0000 (02:56 +0200)]
tests/kcmp: use <linux/kcmp.h> if it is available

I see it as a good idea to stick to system headers whenever possible
in order to also check for possible discrepancies between strace's
internal definitions and definitions present in the system headers.

* configure.ac (AC_CHECK_HEADERS): Add linux/kcmp.h.
* tests/kcmp.h [HAVE_LINUX_KCMP_H]: Include <linux/kcmp.h>,
do not define KCMP_FILE and KCMP_SYSVSEM.

6 years agotests: check decoding of MDBA_ROUTER_PORT netlink attribute
JingPiao Chen [Sat, 9 Sep 2017 01:49:35 +0000 (09:49 +0800)]
tests: check decoding of MDBA_ROUTER_PORT netlink attribute

* tests/nlattr_mdba_router_port.c: New file.
* tests/gen_tests.in (nlattr_mdba_router_port): New entry.
* tests/pure_executables.list: Add nlattr_mdba_router_port.
* tests/.gitignore: Likewise.

6 years agotests: check decoding of MDBA_MDB_ENTRY_INFO netlink attributes
JingPiao Chen [Sat, 9 Sep 2017 01:38:11 +0000 (09:38 +0800)]
tests: check decoding of MDBA_MDB_ENTRY_INFO netlink attributes

* tests/nlattr_mdba_mdb_entry.c: New file.
* tests/gen_tests.in (nlattr_mdba_mdb_entry): New entry.
* tests/pure_executables.list: Add nlattr_mdba_mdb_entry.
* tests/.gitignore: Likewise.

6 years agotests: extend TEST_NESTED_NLATTR_OBJECT macro
JingPiao Chen [Sat, 9 Sep 2017 01:30:01 +0000 (09:30 +0800)]
tests: extend TEST_NESTED_NLATTR_OBJECT macro

Extend TEST_NESTED_NLATTR_OBJECT macro for multi-nested netlink
attributes, such as

[MDBA_MDB] = {
[MDBA_MDB_ENTRY] = {
[MDBA_MDB_ENTRY_INFO] {
struct br_mdb_entry
[MDBA_MDB_EATTR attributes]
}
}
}

* tests/test_nlattr.h (TEST_NESTED_NLATTR_OBJECT_EX_,
TEST_NESTED_NLATTR_OBJECT_EX): New macros.
(TEST_NESTED_NLATTR_OBJECT): Use TEST_NESTED_NLATTR_OBJECT_EX_.

6 years agortnl_mdb: decode br_port_msg netlink attributes
JingPiao Chen [Mon, 4 Sep 2017 14:27:02 +0000 (22:27 +0800)]
rtnl_mdb: decode br_port_msg netlink attributes

* configure.ac (AC_CHECK_TYPES): Check for struct br_mdb_entry
in <linux/if_bridge.h>.
(AC_CHECK_MEMBERS): Check for flags and vid fields in struct br_mdb_entry.
* rtnl_mdb.c: Include "xlat/mdb_flags.h", "xlat/mdb_states.h",
"xlat/rtnl_mdba_mdb_attrs.h", "xlat/rtnl_mdba_mdb_eattr_attrs.h",
"xlat/rtnl_mdba_mdb_entry_attrs.h" ,"xlat/rtnl_mdba_router_attrs.h"
and "xlat/rtnl_mdba_router_pattr_attrs.h".
(decode_mdba_mdb_entry_info, decode_mdba_mdb_entry,
decode_mdba_mdb, decode_multicast_router_type,
decode_mdba_router_port, decode_mdba_router): New functions.
(mdba_mdb_eattr_nla_decoders, mdba_mdb_entry_nla_decoders,
mdba_mdb_nla_decoders, mdba_router_pattr_nla_decoders,
mdba_router_nla_decoders, br_port_msg_nla_decoders): New arrays.
(decode_br_port_msg): Use br_port_msg_nla_decoders.
* xlat/mdb_flags.in: New file.
* xlat/mdb_states.in: Likewise.
* xlat/multicast_router_types.in: Likewise.
* xlat/rtnl_mdba_mdb_attrs.in: Likewise.
* xlat/rtnl_mdba_mdb_eattr_attrs.in: Likewise.
* xlat/rtnl_mdba_mdb_entry_attrs.in: Likewise.
* xlat/rtnl_mdba_router_attrs.in: Likewise.
* xlat/rtnl_mdba_router_pattr_attrs.in: Likewise.

6 years agonetlink: implement decoding of INET_DIAG_CLASS_ID attribute
Dmitry V. Levin [Sat, 16 Sep 2017 17:44:29 +0000 (17:44 +0000)]
netlink: implement decoding of INET_DIAG_CLASS_ID attribute

This is a new netlink attribute introduced by linux kernel commit
v4.14-rc1~130^2~207.

* linux/inet_diag.h (INET_DIAG_CLASS_ID): New enum.
* netlink_inet_diag.c (inet_diag_msg_nla_decoders): Add
INET_DIAG_CLASS_ID.
* xlat/inet_diag_attrs.in: Add INET_DIAG_CLASS_ID.
* xlat/inet_diag_extended_flags.in: Add 1<<(INET_DIAG_CLASS_ID-1).
* tests/nlattr_inet_diag_msg.c (main): Check INET_DIAG_CLASS_ID
decoding.

6 years agoUpdate MEMBARRIER_CMD_* constants
Dmitry V. Levin [Fri, 15 Sep 2017 16:06:14 +0000 (16:06 +0000)]
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.

6 years agoUpdate UFFD_FEATURE_* constants
Dmitry V. Levin [Thu, 14 Sep 2017 15:52:54 +0000 (15:52 +0000)]
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.

6 years agoUpdate MFD_* constants
Dmitry V. Levin [Wed, 13 Sep 2017 15:50:37 +0000 (15:50 +0000)]
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.

6 years agoUpdate ETH_P_* constants
Dmitry V. Levin [Tue, 12 Sep 2017 15:46:35 +0000 (15:46 +0000)]
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.

6 years agoUpdate ARPHRD_* constants
Dmitry V. Levin [Mon, 11 Sep 2017 15:43:36 +0000 (15:43 +0000)]
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.

6 years agoUpdate BPF_* constants
Dmitry V. Levin [Sun, 10 Sep 2017 09:41:22 +0000 (09:41 +0000)]
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.

6 years agoUpdate SO_* constants
Dmitry V. Levin [Sat, 9 Sep 2017 08:17:36 +0000 (08:17 +0000)]
Update SO_* constants

* xlat/sockoptions.in: Add SO_ZEROCOPY introduced by kernel commit
v4.14-rc1~130^2~376^2~5.
* NEWS: Mention this.

6 years agoUpdate MADV_* constants
Dmitry V. Levin [Fri, 8 Sep 2017 09:10:50 +0000 (09:10 +0000)]
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.

6 years agoerror_prints: fix potential program_invocation_name type conflict
Baruch Siach [Fri, 8 Sep 2017 09:12:57 +0000 (12:12 +0300)]
error_prints: fix potential program_invocation_name type conflict

uClibc-ng declares program_invocation_name as const.
This causes the build failure below:

error_prints.c:40:14: error: conflicting types for â€˜program_invocation_name’
 extern char *program_invocation_name;
              ^~~~~~~~~~~~~~~~~~~~~~~
In file included from error_prints.c:32:0:
.../output/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/errno.h:54:20: note: previous declaration of â€˜program_invocation_name’ was here
 extern const char *program_invocation_name, *program_invocation_short_name;
                    ^~~~~~~~~~~~~~~~~~~~~~~

* error_prints.c (program_invocation_name): Declare only in case
of [!HAVE_PROGRAM_INVOCATION_NAME].

6 years agortnl_tc_action: decode tcamsg netlink attributes
JingPiao Chen [Mon, 4 Sep 2017 06:56:44 +0000 (14:56 +0800)]
rtnl_tc_action: decode tcamsg netlink attributes

* rtnl_tc_action.c (tcamsg_nla_decoders): New array.
(decode_tcamsg): Use it.

6 years agotests: check decoding of TCA_STAB netlink attribute of tcmsg
JingPiao Chen [Mon, 4 Sep 2017 13:40:06 +0000 (21:40 +0800)]
tests: check decoding of TCA_STAB netlink attribute of tcmsg

* tests/test_nlattr.h (TEST_NESTED_NLATTR_ARRAY): New macro.
* tests/nlattr_tca_stab.c: New file.
* tests/gen_tests.in (nlattr_tca_stab): New entry.
* tests/pure_executables.list: Add nlattr_tca_stab.
* tests/.gitignore: Likewise.

6 years agotests: check decoding of TCA_STATS2 netlink attribute of tcmsg
JingPiao Chen [Mon, 4 Sep 2017 12:56:47 +0000 (20:56 +0800)]
tests: check decoding of TCA_STATS2 netlink attribute of tcmsg

* tests/nlattr_tc_stats.c: New file.
* tests/gen_tests.in (nlattr_tc_stats): New entry.
* tests/pure_executables.list: Add nlattr_tc_stats.
* tests/.gitignore: Likewise.

6 years agotests: check decoding of tcmsg netlink attributes
JingPiao Chen [Mon, 4 Sep 2017 07:11:33 +0000 (15:11 +0800)]
tests: check decoding of tcmsg netlink attributes

* tests/nlattr_tcmsg.c: Include <stddef.h> and <linux/pkt_sched.h>.
(main): Check decoding of TCA_STATS and TCA_RATE.

6 years agortnl_tc: decode tcmsg netlink attributes
JingPiao Chen [Mon, 4 Sep 2017 06:56:24 +0000 (14:56 +0800)]
rtnl_tc: decode tcmsg netlink attributes

* configure.ac (AC_CHECK_TYPES): Check for gnet_stats_basic,
gnet_stats_queue, gnet_stats_rate_est,
and gnet_stats_rate_est64 structures in <linux/gen_stats.h>.
And check for struct tc_sizespec in <linux/pkt_sched.h>.
* nlattr.h (tc_stats): New prototype.
* rtnl_tc.c: Include <linux/gen_stats.h>, <linux/pkt_sched.h>,
"xlat/rtnl_tca_stab_attrs.h" and "xlat/rtnl_tca_stats_attrs.h".
(decode_tc_stats, decode_tc_estimator, decode_gnet_stats_basic,
decode_gnet_stats_rate_est, decode_gnet_stats_queue,
decode_gnet_stats_rate_est64, decode_nla_tc_stats,
decode_tc_sizespec, print_stab_data, decode_tca_stab_data,
decode_tca_stab): New functions.
(tca_stats_nla_decoders, tca_stab_nla_decoders,
tcmsg_nla_decoders): New arrays.
(decode_tcmsg): Use tcmsg_nla_decoders.
* xlat/rtnl_tca_stab_attrs.in: New file.
* xlat/rtnl_tca_stats_attrs.in: Likewise.

6 years agoUpdate TCP_* constants
Dmitry V. Levin [Thu, 7 Sep 2017 06:45:04 +0000 (06:45 +0000)]
Update TCP_* constants

* xlat/socktcpoptions.in: Add TCP_ULP and TCP_MD5SIG_EXT.
* NEWS: Mention this.

6 years agoUpdate SOL_* constants
Dmitry V. Levin [Thu, 7 Sep 2017 06:45:04 +0000 (06:45 +0000)]
Update SOL_* constants

* xlat/socketlayers.in: Add SOL_TLS.
* NEWS: Mention this.

6 years agoPost-release administrivia
Dmitry V. Levin [Wed, 6 Sep 2017 20:24:50 +0000 (20:24 +0000)]
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.

6 years agoPrepare for 4.19 release v4.19
Dmitry V. Levin [Tue, 5 Sep 2017 12:13:14 +0000 (12:13 +0000)]
Prepare for 4.19 release

* NEWS: Update for 4.19 release.

6 years ago.mailmap: add canonical name and address of Edgar Kaziakhmedov
Dmitry V. Levin [Mon, 4 Sep 2017 00:57:41 +0000 (00:57 +0000)]
.mailmap: add canonical name and address of Edgar Kaziakhmedov

* .mailmap: Add canonical name and address of Edgar Kaziakhmedov here
to avoid duplications in CREDITS file.

6 years agomaint: add gen-tag-message.sh script
Dmitry V. Levin [Sun, 3 Sep 2017 09:49:57 +0000 (09:49 +0000)]
maint: add gen-tag-message.sh script

* maint/gen-tag-message.sh: New file.

6 years agomaint: add gen-contributors-list.sh script
Dmitry V. Levin [Sat, 2 Sep 2017 22:12:12 +0000 (22:12 +0000)]
maint: add gen-contributors-list.sh script

* maint/gen-contributors-list.sh: New file.

6 years agoUpdate copyright headers
Eugene Syromyatnikov [Tue, 5 Sep 2017 08:01:01 +0000 (10:01 +0200)]
Update copyright headers

Headers updated automatically with

    maint/update_copyright_headers.sh -c

6 years agoupdate_copyright_years.sh: add ability to automatically commit results
Eugene Syromyatnikov [Tue, 5 Sep 2017 07:56:15 +0000 (09:56 +0200)]
update_copyright_years.sh: add ability to automatically commit results

* maint/update_copyright_years.sh (DEFAULT_GIT_COMMIT_MESSAGE,
GIT_COMMIT_MESSAGE): New variables.
<-c>: New option, implies -a, calls git commit with GIT_COMMIT_TEMPLATE string
as a template.

6 years agoconfigure.ac: specify minimal GNU Automake version
Eugene Syromyatnikov [Mon, 4 Sep 2017 20:45:12 +0000 (22:45 +0200)]
configure.ac: specify minimal GNU Automake version

In order to provide better diagnostics.

* configure.ac (AM_INIT_AUTOMAKE): Specify minimal GNU Automake version as
1.13 due to usage of AM_EXTRA_RECURSIVE_TARGETS macro.

Closes: https://github.com/strace/strace/issues/11
6 years agoUpdate NEWS
Eugene Syromyatnikov [Mon, 4 Sep 2017 15:14:35 +0000 (17:14 +0200)]
Update NEWS

6 years agotests: check decoding of IFLA_XDP netlink attribute of ifinfomsg
JingPiao Chen [Sun, 3 Sep 2017 01:25:09 +0000 (09:25 +0800)]
tests: check decoding of IFLA_XDP netlink attribute of ifinfomsg

* tests/nlattr_ifla_xdp.c: New file.
* tests/gen_tests.in (nlattr_ifla_xdp): New entry.
* tests/pure_executables.list: Add nlattr_ifla_xdp.
* tests/.gitignore: Likewise.

6 years agotests: check decoding of IFLA_PORT_SELF netlink attribute of ifinfomsg
JingPiao Chen [Sun, 3 Sep 2017 01:13:27 +0000 (09:13 +0800)]
tests: check decoding of IFLA_PORT_SELF netlink attribute of ifinfomsg

* tests/nlattr_ifla_port.c: New file.
* tests/gen_tests.in (nlattr_ifla_port): New entry.
* tests/pure_executables.list: Add nlattr_ifla_port.
* tests/.gitignore: Likewise.

6 years agotests: check decoding of more ifinfomsg netlink attributes
JingPiao Chen [Sat, 2 Sep 2017 14:46:41 +0000 (22:46 +0800)]
tests: check decoding of more ifinfomsg netlink attributes

* tests/nlattr_ifinfomsg.c (IFLA_LINKINFO, IFLA_VF_PORTS,
IFLA_INFO_KIND, IFLA_VF_PORT): New macros.
(main): Check decoding of IFLA_LINKINFO and IFLA_VF_PORTS.

6 years agortnl_link: decode more ifinfomsg netlink attributes
JingPiao Chen [Sat, 2 Sep 2017 14:25:43 +0000 (22:25 +0800)]
rtnl_link: decode more ifinfomsg netlink attributes

* configure.ac (AC_CHECK_TYPES): Check for struct ifla_port_vsi
in <linux/if_link.h>.
* rtnl_link.c: Include "xlat/rtnl_ifla_info_attrs.h",
"xlat/rtnl_ifla_port_attrs.h", "xlat/rtnl_ifla_port_attrs.h",
"xlat/rtnl_ifla_xdp_attrs.h", and "xlat/xdp_flags.h".
(decode_ifla_linkinfo, decode_ifla_port_vsi,
decode_ifla_port, decode_ifla_vf_ports,
decode_ifla_xdp_flags, decode_ifla_xdp): New functions.
(ifla_linkinfo_nla_decoders, ifla_port_nla_decoders,
ifla_vf_port_nla_decoders, ifla_xdp_nla_decoders): New arrays.
(ifinfomsg_nla_decoders) <IFLA_LINKINFO>: Use decode_ifla_linkinfo.
<IFLA_VF_PORTS>: Use decode_ifla_vf_ports.
<IFLA_PORT_SELF>: Use decode_ifla_port.
<IFLA_XDP>: Use decode_ifla_xdp.
* xlat/rtnl_ifla_info_attrs.in: New file.
* xlat/rtnl_ifla_port_attrs.in: Likewise.
* xlat/rtnl_ifla_vf_port_attrs.in: Likewise.
* xlat/rtnl_ifla_xdp_attrs.in: Likewise.
* xlat/xdp_flags.in: Likewise.

6 years agokeyctl: add support for KDF parameters decoding in KEYCTL_DH_COMPUTE
Eugene Syromyatnikov [Fri, 1 Sep 2017 14:14:25 +0000 (16:14 +0200)]
keyctl: add support for KDF parameters decoding in KEYCTL_DH_COMPUTE

* fetch_struct_keyctl_kdf_params.c: New file.
* keyctl_kdf_params.h: Likewise.
* Makefile.am (strace_SOURCES): Add them.
* configure.ac: Add check for struct keyctl_kdf_params presence in
<linux/keyctl.h>.
* defs.h (struct strace_keyctl_kdf_params): Add forward declaration.
* keyctl.c (keyctl_dh_compute): Add new parameter kdf_addr, print it
on exiting.
(SYS_FUNC(keyctl)) <case KEYCTL_DH_COMPUTE>: Pass arg5 to
keyctl_dh_compute.
* tests/keyctl.c: Include assert.h.
(struct keyctl_kdf_params) [!HAVE_STRUCT_KEYCTL_KDF_PARAMS]: New
definition.
(STR32): New definition, copied from ioctl_dm.c.
(append_str, kckdfp_to_str): New functions.
(main): Update expected output, add checks for struct keyctl_kdf_params
decoding.

6 years agotests/keyctl: improve readability
Eugene Syromyatnikov [Fri, 1 Sep 2017 13:12:42 +0000 (15:12 +0200)]
tests/keyctl: improve readability

* tests/keyctl.c: Since do_keyctl() has so convoluted calling convention
and keyctl test is so complex, let's try to improve readability a bit
with some conventions regarding do_keyctl() call formatting: arguments
representing single keyctl argument should be put on the separate line,
continuations of arguments related to the same keyctl argument should
have additional indentation and termination 0UL should always be
on a separate line.  Also, while we are here, let's add spaces
to two type casts that are missing them.

6 years agos390: update ioctl entries from linux 4.13
Gleb Fotengauer-Malinovskiy [Fri, 1 Sep 2017 17:30:13 +0000 (20:30 +0300)]
s390: update ioctl entries from linux 4.13

* linux/s390/ioctls_arch0.h: Update from linux v4.13-rc7 using ioctls_gen.sh.

6 years agompers.awk: fix regression introduced by the previous cleanup
Dmitry V. Levin [Fri, 1 Sep 2017 17:30:13 +0000 (17:30 +0000)]
mpers.awk: fix regression introduced by the previous cleanup

* mpers.awk (what_is): Remove returned_size from local variables.

Fixes: v4.18-308-gfd3447b5 ("mpers.awk: declare local variables consistently")
6 years agortnl_link: enhance decoding of struct rtnl_link_stats{,64}
Dmitry V. Levin [Fri, 1 Sep 2017 08:41:08 +0000 (08:41 +0000)]
rtnl_link: enhance decoding of struct rtnl_link_stats{,64}

Enhance runtime detection of struct rtnl_link_stats.rx_nohandler
and struct rtnl_link_stats64.rx_nohandler.

* rtnl_link.c (decode_rtnl_link_stats): Do not accept structure length
greater than min_size but less than sizeof(struct rtnl_link_stats).
(decode_rtnl_link_stats64): Likewise, so not accept structure length
greater than min_size but less than sizeof(struct rtnl_link_stats64).

6 years agortnl_neightbl: enhance decoding of struct ndt_stats
Dmitry V. Levin [Fri, 1 Sep 2017 08:41:08 +0000 (08:41 +0000)]
rtnl_neightbl: enhance decoding of struct ndt_stats

Add support of kernels that operate with older definition of
struct ndt_stats than the definition used to build strace.

* rtnl_neightbl.c (decode_ndt_stats): Add runtime detection
of struct ndt_stats.ndts_table_fulls field, print the field
when it is available.

6 years agotests: check decoding of IFLA_PROTINFO netlink attribute of ifinfomsg
JingPiao Chen [Tue, 29 Aug 2017 13:04:19 +0000 (21:04 +0800)]
tests: check decoding of IFLA_PROTINFO netlink attribute of ifinfomsg

* tests/nlattr_ifla_brport.c: New file.
* tests/gen_tests.in (nlattr_ifla_brport): New entry.
* tests/pure_executables.list: Add nlattr_ifla_brport.
* tests/.gitignore: Likewise.
* tests/test_nlattr.h (TEST_NESTED_NLATTR_OBJECT): New macro.

6 years agortnl_link: decode IFLA_PROTINFO netlink attribute of ifinfomsg
JingPiao Chen [Sun, 27 Aug 2017 08:12:11 +0000 (16:12 +0800)]
rtnl_link: decode IFLA_PROTINFO netlink attribute of ifinfomsg

* configure.ac (AC_CHECK_TYPES): Check for ifla_bridge_id
and rtnl_link_stats64 structures in <linux/if_link.h>.
* rtnl_link.c: Include "xlat/rtnl_ifla_brport_attrs.h".
(decode_ifla_bridge_id, decode_ifla_protinfo): New functions.
(ifla_brport_nla_decoders): New array.
(ifinfomsg_nla_decoders) <IFLA_PROTINFO>: Use decode_ifla_protinfo.
* xlat/rtnl_ifla_brport_attrs.in: New file.

6 years agotests: check decoding of ndtmsg netlink attributes
JingPiao Chen [Wed, 30 Aug 2017 13:56:09 +0000 (21:56 +0800)]
tests: check decoding of ndtmsg netlink attributes

* tests/nlattr_ndtmsg.c (NDTA_PARMS, NDTPA_IFINDEX): New macros.
(main): Check decoding of NDTA_CONFIG, NDTA_PARMS and NDTA_STATS.

6 years agortnl_neightbl: decode ndtmsg netlink attributes
JingPiao Chen [Wed, 30 Aug 2017 13:51:30 +0000 (21:51 +0800)]
rtnl_neightbl: decode ndtmsg netlink attributes

* configure.ac (AC_CHECK_TYPES): Check for ndt_config
and ndt_stats structures in <linux/neighbour.h>.
(AC_CHECK_MEMBERS): Check for ndts_table_fulls field in struct ndt_stats.
* rtnl_neightbl.c: Include "xlat/rtnl_neightbl_parms_attrs.h".
(decode_ndt_config, decode_ndta_parms, decode_ndta_parms): New functions.
(ndt_parms_nla_decoders, ndtmsg_nla_decoders): New arrays.
(decode_ndtmsg): Use ndtmsg_nla_decoders.
* xlat/rtnl_neightbl_parms_attrs.in: New file.

6 years agotests: check decoding of ifaddrlblmsg netlink attributes
JingPiao Chen [Wed, 30 Aug 2017 13:15:27 +0000 (21:15 +0800)]
tests: check decoding of ifaddrlblmsg netlink attributes

* tests/nlattr_ifaddrlblmsg.c (main): Check decoding of IFAL_ADDRESS.

6 years agortnl_addrlabel: decode ifaddrlblmsg netlink attributes
JingPiao Chen [Wed, 30 Aug 2017 13:14:05 +0000 (21:14 +0800)]
rtnl_addrlabel: decode ifaddrlblmsg netlink attributes

* rtnl_addrlabel.c (decode_ifal_address): New function.
(ifaddrlblmsg_nla_decoders): New array.
(decode_ifaddrlblmsg): Use it.

6 years agoalpha: wire up new syscalls
Dmitry V. Levin [Fri, 1 Sep 2017 00:56:59 +0000 (00:56 +0000)]
alpha: wire up new syscalls

* linux/alpha/syscallent.h [514..522]: New entries.

6 years agotests/.gitignore: add missing files that should be ignored
JingPiao Chen [Wed, 30 Aug 2017 17:36:12 +0000 (01:36 +0800)]
tests/.gitignore: add missing files that should be ignored

* tests/.gitignore: Add is_linux_mips_n64.

6 years agompers.awk: declare local variables consistently
Dmitry V. Levin [Thu, 31 Aug 2017 09:54:24 +0000 (09:54 +0000)]
mpers.awk: declare local variables consistently

* mpers.awk (compare_indices): Make c1 and c2 variables local.
(enter): Make item variable local.
(what_is): Make loc_diff, returned_size, and to_return local.

6 years agompers.awk: separate local variables from real parameters by newline
Dmitry V. Levin [Wed, 30 Aug 2017 09:48:51 +0000 (09:48 +0000)]
mpers.awk: separate local variables from real parameters by newline

* mpers.awk (array_get, update_upper_bound): Separate local variables
from real parameters by newline.

6 years agortnl_rule: enhance FRA_TABLE decoding
Dmitry V. Levin [Tue, 29 Aug 2017 10:09:04 +0000 (10:09 +0000)]
rtnl_rule: enhance FRA_TABLE decoding

The attribute of FRA_TABLE is not just a 32-bit integer, some constants
have well-known symbolic names like RT_TABLE_DEFAULT.

* rtnl_rule.c (fib_rule_hdr_nla_decoders) <FRA_TABLE>:
Use decode_nla_rt_class.
* tests/nlattr_fib_rule_hdr.c (FRA_TABLE): New macro.
(main): Check FRA_TABLE decoding.

6 years agortnl_route: enhance RTA_TABLE decoding
Dmitry V. Levin [Tue, 29 Aug 2017 10:09:04 +0000 (10:09 +0000)]
rtnl_route: enhance RTA_TABLE decoding

The attribute of RTA_TABLE is not just a 32-bit integer, some constants
have well-known symbolic names like RT_TABLE_DEFAULT.

* nlattr.h (decode_nla_rt_class): New prototype.
* rtnl_route.c (decode_nla_rt_class): New function.
(rtmsg_nla_decoders) <RTA_TABLE>: Use it.
* tests/nlattr_rtmsg.c (main): Check RTA_TABLE decoding.

6 years agortnl_nsid: decode rtgenmsg netlink attributes
JingPiao Chen [Sun, 27 Aug 2017 17:20:10 +0000 (01:20 +0800)]
rtnl_nsid: decode rtgenmsg netlink attributes

* rtnl_nsid.c (rtgenmsg_nla_decoders): New array.
(decode_rtgenmsg): Use it.

6 years agortnl_netconf: decode netconfmsg netlink attributes
JingPiao Chen [Sun, 27 Aug 2017 17:18:20 +0000 (01:18 +0800)]
rtnl_netconf: decode netconfmsg netlink attributes

* rtnl_netconf.c (netconfmsg_nla_decoders): New array.
(decode_netconfmsg): Use it.

6 years agotests: check decoding of ndmsg netlink attributes
JingPiao Chen [Sun, 27 Aug 2017 16:56:41 +0000 (00:56 +0800)]
tests: check decoding of ndmsg netlink attributes

* tests/nlattr_ndmsg.c: Include <netinet/in.h> and <arpa/inet.h>.
(NDA_PORT): New macro.
(main): Check decoding of NDA_DST, NDA_CACHEINFO and NDA_PORT.

6 years agortnl_neigh: decode ndmsg netlink attributes
JingPiao Chen [Sun, 27 Aug 2017 16:46:22 +0000 (00:46 +0800)]
rtnl_neigh: decode ndmsg netlink attributes

* nlattr.c: Include <netinet/in.h> and <arpa/inet.h>.
(decode_nla_be16): New function.
* nlattr.h (decode_nla_be16): New prototype.
* rtnl_neigh.c (decode_neigh_addr,
decode_nda_cacheinfo): New functions.
(ndmsg_nla_decoders): New array.
(decode_ndmsg): Use it.

6 years agotests: check decoding of fib_rule_hdr netlink attributes
JingPiao Chen [Sun, 27 Aug 2017 16:37:33 +0000 (00:37 +0800)]
tests: check decoding of fib_rule_hdr netlink attributes

* tests/nlattr_fib_rule_hdr.c: Include <inttypes.h>.
(FRA_TUN_ID, FRA_UID_RANGE): New macros.
(main): Check decoding of FRA_DST, FRA_UID_RANGE and FRA_TUN_ID.

6 years agortnl_rule: decode fib_rule_hdr netlink attributes
JingPiao Chen [Sun, 27 Aug 2017 16:33:30 +0000 (00:33 +0800)]
rtnl_rule: decode fib_rule_hdr netlink attributes

* configure.ac (AC_CHECK_FUNCS): Add be64toh.
(AC_CHECK_TYPES): Check for struct fib_rule_uid_range
in <linux/fib_rules.h>.
* nlattr.c: Include <endian.h>.
(decode_nla_be64): New function.
* nlattr.h (decode_nla_be64): New prototype.
* rtnl_rule.c (decode_rule_addr,
decode_fib_rule_uid_range): New functions.
(fib_rule_hdr_nla_decoders): New array.
(decode_fib_rule_hdr): Use it.

6 years agortnl_neigh: fix ndm_type field decode in struct ndmsg
JingPiao Chen [Mon, 28 Aug 2017 08:13:56 +0000 (16:13 +0800)]
rtnl_neigh: fix ndm_type field decode in struct ndmsg

* defs.h (routing_types): New xlat prototype.
* rtnl_neigh.c (decode_ndmsg): Fix ndm_type decode.
* xlat/nda_types.in: Remove it.
* tests/netlink_route.c (test_rtnl_neigh): Update the test.
* tests/nlattr_ndmsg.c (init_ndmsg, print_ndmsg): Likewise.

6 years agoDisallow more than one signal= specification in an injection expression
Dmitry V. Levin [Mon, 28 Aug 2017 23:38:43 +0000 (23:38 +0000)]
Disallow more than one signal= specification in an injection expression

Specifying several signal= specifications in an injection expressions
makes no sense.

* filter_qualify.c (parse_inject_token): Disallow second
signal= specification.
* strace.1.in: Document it.
* tests/qual_inject-syntax.test: Check it.

6 years agoAdd "flags" field to struct inject_data
Dmitry V. Levin [Mon, 28 Aug 2017 22:37:27 +0000 (22:37 +0000)]
Add "flags" field to struct inject_data

Introduce "flags" field to struct inject_data and use it instead
of magic rval and signo constants.
Due to layout of struct inject_data, this new field does not change
sizeof(struct inject_data).

* defs.h (INJECT_F_RETVAL, INJECT_F_SIGNAL): New macros.
(INJECT_OPTS_RVAL_DEFAULT): Remove macro.
(struct inject_data): Add "flags" field.
* filter_qualify.c (parse_inject_token, qualify_inject_common): Check
struct inject_data.flags instead of inject_data.rval
and inject_data.signo, do not initialize inject_opts.data.
* syscall.c (tamper_with_syscall_entering): Check struct
inject_data.flags instead of inject_data.rval and inject_data.signo.