summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* xlat: add BTRFS_COMPRESS_ZSTD to btrfs_compress_typesesyr/linux-5.7Eugene Syromyatnikov2020-04-192-1/+2
| | | | | | * xlat/btrfs_compress_types.in (BTRFS_COMPRESS_ZSTD): New constant, introduced by Linux commit v4.14-rc1~22^2~1. * tests/btrfs.c (BTRFS_COMPRESS_TYPES): Change value to 3.
* xlat: annotate btrfs_compress_types with #enumEugene Syromyatnikov2020-04-192-3/+3
| | | | | | * xlat/btrfs_compress_types.in: Add #enum, #include <stdio.h>, and #include <linux/btrfs.h> * configure.ac (AC_CHECK_DECL(BTRFS_COMPRESS_*)): Remove.
* xlat: annotate rtnl_ifla_xdp_attached_mode with #enumEugene Syromyatnikov2020-04-192-5/+7
| | | | | | | | | | | | And use proper checks in tests/nlattr_ifla_xdp.c. * xlat/rtnl_ifla_xdp_attached_mode.in: Add #enum, #include <netinet/in.h>, and #include <linux/rtnetlink.h> annotations. * tests/nlattr_ifla_xdp.c [!XDP_ATTACHED_NONE] (XDP_ATTACHED_NONE): Remove. [!XDP_ATTACHED_MULTI] (XDP_ATTACHED_MULTI): Remove. [!HAVE_DECL_XDP_ATTACHED_NONE] (XDP_ATTACHED_NONE): New enum definition. [!HAVE_DECL_XDP_ATTACHED_MULTI] (XDP_ATTACHED_MULTI): Likewise.
* rtnl_link: support IFLA_XDP_EXPECTED_FD attribute decodingEugene Syromyatnikov2020-04-197-23/+31
| | | | | | | | | | | | | | | | | | | | Introduced by Linux commit v5.7-rc1~146^2~10^2~13^2~3. * xlat/rtnl_ifla_xdp_attrs.in: Add #enum, #include <netlink/in.h>, and #include <linux/rtnetlink.h> annotations. (IFLA_XDP_EXPECTED_FD): New constant. * rtnl_link.c (ifla_xdp_nla_decoders): Add [IFLA_XDP_EXPECTED_FD], set value to decode_nla_fd. * tests/nlattr_ifla_xdp-y.c: New file. * tests/.gitignore: Add nlattr_ifla_xdp-y. * tests/Makefile.am (check_PROGRAMS): Likewise. * tests/gen_tests.in: Add nlattr_ifla_xdp-y test. * tests/nlattr_ifla_xdp.c: Include "xlat/rtnl_ifla_xdp_attrs.h" under XLAT_MACROS_ONLY definition. (IFLA_XDP_FD, IFLA_XDP_ATTACHED, IFLA_XDP_PROG_ID, IFLA_XDP_DRV_PROG_ID, IFLA_XDP_SKB_PROG_ID, IFLA_XDP_HW_PROG_ID): Remove. [!FD9_PATH] (FD9_PATH): New macro, define to empty string. (main): Add checks for IFLA_XDP_EXPECTED_FD.
* tests: support -y mode for sockfd printingEugene Syromyatnikov2020-04-191-1/+28
| | | | | | * tests/test_nlattr.h [!PRINT_SOCK] (PRINT_SOCK): New macro, define to 0. (print_sockfd): New function. (TEST_NLATTR_EX_): Call print_sockfd for sock fd printing.
* rtnl_tc_action: implement TCA_ACT_HW_STATS and TCA_ACT_USED_HW_STATS decodingEugene Syromyatnikov2020-04-194-1/+43
| | | | | | | | | | | | | | * xlat/rtnl_tca_act_hw_stats.in: New file. * rtnl_tc_action.c: Include "xlat/rtnl_tca_act_hw_stats.h". (decode_tca_act_hw_stats): New function. (tcamsg_nla_decoders): Add [TCA_ACT_HW_STATS] and [TCA_ACT_USED_HW_STATS], set them to decode_tca_act_hw_stats. * tests/nlattr_tcamsg.c: Add checks, update expected output. * xlat/rtnl_tc_action_attrs.in (TCA_ACT_HW_STATS): New constant, introduced by Linux commit v5.7-rc1~146^2~230^2 and renamed in Linux commit v5.7-rc1~146^2~101. (TCA_ACT_USED_HW_STATS): New constant, introduced by Linux commit v5.7-rc1~146^2~25^2.
* xlat: annotate rtnl_tca_stab_attrs with #enumEugene Syromyatnikov2020-04-192-2/+3
| | | | | | * xlat/rtnl_tca_stab_attrs.in: Add #enum, #include <linux/types.h>, #include <linux/pkt_sched.h>. * configure.ac (AC_CHECK_DECLS(TCA_STAB_DATA)): Remove.
* xlat: annotate rtnl_tca_stats_attrs with #enumEugene Syromyatnikov2020-04-192-3/+2
| | | | | * xlat/rtnl_tca_stats_attrs.in: Add #enum, #include <linux/gen_stats.h>. * configure.ac (AC_CHECK_DECL(TCA_STATS_PKT64)): Remove.
* xlat: add #enum to v4l2 xlatsEugene Syromyatnikov2020-04-198-66/+35
| | | | | | | | | | | | | * xlat/v4l2_buf_types.in: Add #enum, #include <sys/time.h>, #include <linux/ioctl.h>, #include <linux/types.h>, and #include <linux/videodev2.h>. * xlat/v4l2_colorspaces.in: Likewise. * xlat/v4l2_control_types.in: Likewise. * xlat/v4l2_fields.in: Likewise. * xlat/v4l2_framesize_types.in: Likewise. * xlat/v4l2_memories.in: Likewise. * xlat/v4l2_tuner_types.in: Likewise. * configure.ac (AC_CHECK_DECL(V4L2_*)): Remove.
* xlat: annotate rtnl_link_attrs with #enumEugene Syromyatnikov2020-04-192-11/+3
| | | | | | * xlat/rtnl_link_attrs.in: Add #enum, #include <sys/socket.h>, #include <linux/rtnetlink.h>. * configure.ac (AC_CHECK_DECL(IFLA_*)): Remove.
* xlat: annotate rtnl_tc_action_attrs with #enumEugene Syromyatnikov2020-04-192-6/+2
| | | | | * xlat/rtnl_tc_action_attrs.in: Add #enum, #include <linux/pkt_cls.h> * configure.ac (AC_CHECK_DECL(TCA_ACT_*)): Remove.
* xlat: annotate sysctl xlats with #enumEugene Syromyatnikov2020-04-1912-78/+33
| | | | | | | | | | | | | | | | * configure.ac (AC_CHECK_DECL(CTL_* KERN_* NET_* VM_*)): Remove. * xlat/sysctl_kern.in: Add #enum, #include <sys/types.h>, #include <linux/sysctl.h> descriptors. * xlat/sysctl_net.in: Likewise. * xlat/sysctl_net_core.in: Likewise. * xlat/sysctl_net_ipv4.in: Likewise. * xlat/sysctl_net_ipv4_conf.in: Likewise. * xlat/sysctl_net_ipv4_route.in: Likewise. * xlat/sysctl_net_ipv6.in: Likewise. * xlat/sysctl_net_ipv6_route.in: Likewise. * xlat/sysctl_net_unix.in: Likewise. * xlat/sysctl_root.in: Likewise. * xlat/sysctl_vm.in: Likewise.
* configure: annotate waitid_types with #enumEugene Syromyatnikov2020-04-192-12/+3
| | | | | | | | | | | This also syncs up the configure checks with the actual list of xlat values. * xlat/waitid_types.in: Add #enum, #include <sys/types.h>, and #include <sys/wait.h>. * configure.ac (AC_CHECK_DECL(P_*)): Remove. Complements: v5.4~82 "xlat: update waitid_types"
* xlat: mark loop_flags_options as #enumEugene Syromyatnikov2020-04-192-8/+2
| | | | | | * xlat/loop_flags_options.in: Add #enum and #include <linux/loop.h> descriptors. * configure.ac (AC_CHECK_DECLS(LO_FLAGS_*)): Remove.
* xlat: generate m4 checks for enumerationsEugene Syromyatnikov2020-04-193-11/+103
| | | | | | | | | | | | | | | | | | | | * xlat/gen.sh (print_m4_record, gen_m4_entry): New functions. (print_xlat_pair): Accept macro name in the third argument. (print_xlat, print_xlat_pair): Call print_m4_record. (cond_xlat): Pass $m to print_xlat_pair call. Set first_enum to 0. (gen_header, gen_make, gen_git): Output the "generating ..." line to stderr. (gen_header): Get output_m4 as the fourth parameter, redirect fd 3 to stdout, set enum to 1 if #enum is present and $output_m4 is set, append #include argument to includes, generate $output_m4 is $enum is set to 1, pass macro name to print_xlat_pair call, close fd 3. (gen_git): Add st_check_enums.m4 and "/*.m4". (main): Allow passing $output_m4 as the third argument, pass m4 file name as the fourth argument to gen_header calls, pipe gen_header output to gen_m4_entry in case of no-argument invocation, redirect gen_header output to /dev/null in case of single-file invocation. * Makefile.am (ACLOCAL_AMFLAGS): Add "-I xlat". * configure.ac: Add st_CHECK_ENUMS.
* tests: correct error message in io_uring_register testKemeng Shi2020-04-181-1/+1
| | | | | * tests/io_uring_register.c (main): If path_full failed to open, print its name instead of mistakenly used path_null.
* bpf: support new commands BPF_LINK_{CREATE,UPDATE}Paul Chaignon2020-04-185-0/+96
| | | | | | | | | | | | | | | | | | | | * xlat/bpf_commands.in (BPF_LINK_CREATE): New constant introduced by Linux commit v5.7-rc1~146^2~10^2^2~3. (BPF_LINK_UPDATE): New constant introduced by Linux commit v5.7-rc1~146^2~10^2^2~2. * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_LINK_CREATE), BEGIN_BPF_CMD_DECODER(BPF_LINK_UPDATE)): Decode the new commands. (SYS_FUNC(bpf)): Decode the new commands. * bpf_attr.h (BPF_LINK_CREATE_struct): New structure introduced by Linux commit v5.7-rc1~146^2~10^2^2~3. (BPF_LINK_UPDATE_struct): New structure introduced by Linux commit v5.7-rc1~146^2~10^2^2~2. (BPF_LINK_CREATE_struct_size, BPF_LINK_UPDATE_struct_size): New macros. * NEWS: Mention this. * tests/bpf.c (BPF_LINK_CREATE_checks, BPF_LINK_UPDATE_checks): Tests for the new commands. Signed-off-by: Paul Chaignon <paul@cilium.io>
* types: do not generate TYPES_M4_FILES variableDmitry V. Levin2020-04-181-4/+0
| | | | | * types/gen.sh (gen_makefile): Do not generate TYPES_M4_FILES variable, it isn't used anywhere.
* Add test for %clock trace classÁkos Uzonyi2020-04-173-0/+7
| | | | | | | | * tests/Makefile.am (EXTRA_DIST): Add trace_clock.in. * tests/gen_tests.in (trace_clock): New entry. * tests/trace_clock.in: New file. Signed-off-by: Ákos Uzonyi <uzonyi.akos@gmail.com>
* Add %clock trace classÁkos Uzonyi2020-04-1733-207/+217
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The %clock class includes the syscalls that read or modify system clock. linux/*/syscallent*.h part is updated automatically by: sed -i -r ' /"(.*adjtime.*|.*clock_([gs]et|adj).*|.*[gs]ettimeofday.*|time)"/ { s/(\{[^,]*,\t[^0][^,]*)/\1|TCL/ s/(\{[^,]*,\s*)0/\1TCL/ } ' linux/*/syscallent*.h * basic_filters.c (loopup_class): Add %clock member to syscall_class[]. * linux/32/syscallent-time32.h: Add TCL flag to clock related syscalls. * linux/64/syscallent.h: Likewise. * linux/alpha/syscallent.h: Likewise. * linux/arm/syscallent.h: Likewise. * linux/avr32/syscallent.h: Likewise. * linux/bfin/syscallent.h: Likewise. * linux/hppa/syscallent.h: Likewise. * linux/i386/syscallent.h: Likewise. * linux/ia64/syscallent.h: Likewise. * linux/m68k/syscallent.h: Likewise. * linux/microblaze/syscallent.h: Likewise. * linux/mips/syscallent-compat.h: Likewise. * linux/mips/syscallent-n32.h: Likewise. * linux/mips/syscallent-n64.h: Likewise. * linux/mips/syscallent-o32.h: Likewise. * linux/powerpc/syscallent.h: Likewise. * linux/powerpc64/syscallent.h: Likewise. * linux/s390/syscallent.h: Likewise. * linux/s390x/syscallent.h: Likewise. * linux/sh/syscallent.h: Likewise. * linux/sh64/syscallent.h: Likewise. * linux/sparc/syscallent.h: Likewise. * linux/sparc64/syscallent.h: Likewise. * linux/x32/syscallent.h: Likewise. * linux/x86_64/syscallent.h: Likewise. * linux/xtensa/syscallent.h: Likewise. * strace.1.in: Add %clock description. * strace.c (usage): Add %clock group to help message. * sysent.h (TRACE_CLOCK): New definition. * sysent_shorthand_defs.h (TC): Likewise. * sysent_shorthand_undefs.h (TC): Add undef. * NEWS: Mention this. Signed-off-by: Ákos Uzonyi <uzonyi.akos@gmail.com>
* sysent_shorthand_undefs.h: add missing undefsÁkos Uzonyi2020-04-171-0/+3
| | | | | | | | | | | | | | | Add undefs that were missing from sysent_shorthand_undefs.h (mirroring defs in sysent_shorthand_defs.h). * sysent_shorthand_undefs.h (PU): Add undef. (TSD): Likewise. (TC): Likewise. Fixes: v4.21~29 "Add pure syscall flag" Fixes: v5.3~36 "Add seccomp filter syscall flag" Fixes: v5.5~100 "Implement %creds trace class" Signed-off-by: Ákos Uzonyi <uzonyi.akos@gmail.com>
* tests: use create_tmpfileDmitry V. Levin2020-04-175-35/+7
| | | | | | | | | * tests/fchmod.c (main): Use create_tmpfile instead of open+unlink. * tests/preadv.c: Likewise. * tests/sendfile.c: Likewise. * tests/sendfile64.c: Likewise. * tests/fcntl-common.c (create_sample): Use create_tmpfile instead of mkstemp.
* tests: introduce create_tmpfile functionDmitry V. Levin2020-04-173-0/+50
| | | | | | | | | | There are few cases in tests where a file is created and immediately unlinked. Add a function to perform this action in a more systematic way. * tests/tests.h (create_tmpfile): New prototype. * tests/create_tmpfile.c: New file. * tests/Makefile.am (libtests_a_SOURCES): Add create_tmpfile.c.
* Extend memory caching of umove* functionsDmitry V. Levin2020-04-166-37/+134
| | | | | | | | | | | | | * ucopy.c (cached_raddr): Double the size. (get_next_unused_idx, lookup_cached_raddr_idx, set_cached_raddr_idx): New functions. (vm_read_mem): Use them. When the data to be fetched resides in up to 4 adjacent memory pages, fetch these pages and cache them. * tests/umovestr_cached_adjacent.c: New file. * tests/pure_executables.list: Add umovestr_cached_adjacent. * tests/.gitignore: Likewise. * tests/umovestr_cached.test: Handle the first argument. * tests/gen_tests.in (umovestr_cached_adjacent): New test.
* filter_seccomp: implement on systems without <linux/seccomp.h>Dmitry V. Levin2020-04-151-62/+56
| | | | | | | | | | | | | | Provide fallback definitions required to implement seccomp-assisted syscall filtering. * filter_seccomp.c [!HAVE_LINUX_SECCOMP_H]: Include "xlat/prctl_options.h", "xlat/seccomp_mode.h" and "xlat/seccomp_ret_action.h" in XLAT_MACROS_ONLY mode, remove #warning. [!HAVE_LINUX_SECCOMP_H] (struct seccomp_data): Define. [!HAVE_LINUX_SECCOMP_H] (check_seccomp_filter_properties, init_seccomp_filter, seccomp_filter_restart_operator): Remove stubs. Complements: v5.3~7 "Introduce seccomp-assisted syscall filtering"
* x86_64: provide a fallback definition of __X32_SYSCALL_BITDmitry V. Levin2020-04-154-14/+3
| | | | | | | | | | | | | | Make sure __X32_SYSCALL_BIT is defined on __x86_64__, move fallback definitions from various files to x86_64/arch_defs_.h. * linux/x86_64/arch_defs_.h [!__X32_SYSCALL_BIT] (__X32_SYSCALL_BIT): Define. * linux/x86_64/arch_get_personality.c [!__X32_SYSCALL_BIT] (__X32_SYSCALL_BIT): Remove. * linux/x86_64/get_scno.c: Likewise. * tests/filter_seccomp-flag.c [__x86_64__]: Likewise. Complements: v5.3~7 "Introduce seccomp-assisted syscall filtering"
* xlat: add UFFDIO_COPY_MODE_WP to uffd_copy_flagsEugene Syromyatnikov2020-04-152-1/+9
| | | | | | | * xlat/uffd_copy_flags.in (UFFDIO_COPY_MODE_WP): New constant, introduced by Linux commit v5.7-rc1~58^2~121. (UFFDIO_COPY_MODE_DONTWAKE): Add fall-back value. * tests/ioctl_uffdio.c: Add a check for the new flag.
* xlat: update mremap_flagsEugene Syromyatnikov2020-04-151-2/+3
| | | | | | * xlat/mremap_flags.in: Add fallback values. (MREMAP_DONTUNMAP): New constant, introduced by Linux commit v5.7-rc1~124^2~49.
* xlat: update lwtunnel_encap_typesEugene Syromyatnikov2020-04-151-7/+9
| | | | | | | * xlat/lwtunnel_encap_types.in (LWTUNNEL_ENCAP_SEG6_LOCAL): New constant, introduced by Linux commit v4.14-rc1~130^2~348^2~2. (LWTUNNEL_ENCAP_RPL): New constant, introduced by Linux commit v5.7-rc1~146^2~38^2.
* xlat: add XDP_FLAGS_REPLACE to xdp_flagsEugene Syromyatnikov2020-04-151-5/+6
| | | | | | * xlat/xdp_flags.in: Add leading zeroes to fallback values. (XDP_FLAGS_REPLACE): New constant, introduced by Linux commit v5.7-rc1~146^2~10^2~13^2~3.
* xlat: add FAN_DIR_MODIFY to fan_event_flagsEugene Syromyatnikov2020-04-152-2/+4
| | | | | | * xlat/fan_event_flags.in (FAN_DIR_MODIFY): New constant, introduced by Linux commit v5.7-rc1~72^2~5. * tests/fanotify_mark.c: Update expected output.
* xlat: update v4l2_pix_fmtsEugene Syromyatnikov2020-04-151-0/+5
| | | | | | | | * xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_SBGGR14, V4L2_PIX_FMT_SGBRG14, V4L2_PIX_FMT_SGRBG14, V4L2_PIX_FMT_SRGGB14): New constants, introduced by Linux commit v5.7-rc1~193^2~35. (V4L2_PIX_FMT_Y14): New constant, introduced by Linux commit v5.7-rc1~193^2~34.
* xlat: update uring_opsEugene Syromyatnikov2020-04-152-6/+9
| | | | | | | | | | * xlat/uring_ops.in (IORING_OP_SPLICE): New constant, introduced by Linux commit v5.7-rc1~201^2~46. (IORING_OP_PROVIDE_BUFFERS): New constant, introduced by Linux commit v5.7-rc1~201^2~23. (IORING_OP_REMOVE_BUFFERS): New constant, introduced by Linux commit v5.7-rc1~201^2~18. * tests/io_uring_register.c: Update expected output.
* xlat: add SECCOMP_FILTER_FLAG_TSYNC_ESRCH to seccomp_filter_flagsEugene Syromyatnikov2020-04-153-8/+11
| | | | | | | | * xlat/seccomp_filter_flags.in: Use (1<<BIT) syntax. (SECCOMP_FILTER_FLAG_TSYNC_ESRCH): New constant, introduced by Linux commit v5.7-rc1~198^2~1. * tests/seccomp-filter.c: Update expected output. * tests/seccomp-filter-v.c: Likewise.
* xlat: add IORING_FEAT_FAST_POLL to uring_setup_featuresEugene Syromyatnikov2020-04-151-0/+1
| | | | | * xlat/uring_setup_features.in (IORING_FEAT_FAST_POLL): New constant, introduced by Linux commit v5.7-rc1~201^2~36.
* xlat: add V4L2_CID_USER_ATMEL_ISC_BASE to v4l2_control_id_basesEugene Syromyatnikov2020-04-151-0/+1
| | | | | * xlat/v4l2_control_id_bases.in (V4L2_CID_USER_ATMEL_ISC_BASE): New constant, introdued by Linux commit v5.7-rc1~193^2~219.
* xlat: add KVM_CAP_S390_PROTECTED and KVM_CAP_PPC_SECURE_GUEST to kvm_capEugene Syromyatnikov2020-04-151-0/+2
| | | | | | | * xlat/kvm_cap.in (KVM_CAP_S390_PROTECTED): New constant, introduced by Linux commit v5.7-rc1~121^2~15^2~4. (KVM_CAP_PPC_SECURE_GUEST): New constant, introduced by Linux commit v5.7-rc1~121^2~12^2.
* xlat: add PERF_SAMPLE_BRANCH_HW_INDEX to perf_branch_sample_typeEugene Syromyatnikov2020-04-152-3/+5
| | | | | | * xlat/perf_branch_sample_type.in (PERF_SAMPLE_BRANCH_HW_INDEX): New constant, introduced by Linux commit v5.7-rc1~180^2~23. * tests/perf_event_open.c: Update expected output.
* tests: allow passing arguments to netlink_sock_diag.testEugene Syromyatnikov2020-04-154-16/+2
| | | | | | | | | | | And remove netlink_sock_diag-v.sh, since it is no longer needed. * tests/netlink_sock_diag.test: Pass script's arguments to run_strace_match_diff call. * tests/gen_tests.in (nlattr_packet_diag_msg): Call netlink_sock_diag.test with -v instead of netlink_sock_diag-v.sh.. * tests/netlink_sock_diag-v.sh: Remove. * tests/Makefile.am (EXTRA_DIST): Remove netlink_sock_diag-v.sh.
* tests: use the FLAG macro instead of a locally defined one in clone3 testEugene Syromyatnikov2020-04-151-9/+5
| | | | | * tests/clone3.c (_): Remove. (enum validity_flags): Use FLAG() instead of _().
* clone: add more elaborate comments for struct strace_clone_args fieldEugene Syromyatnikov2020-04-151-7/+7
| | | | | | | Try to capture field semantics and type. * clone.c (struct strace_clone_args): Add/extend comments for the fields.
* ptrace_syscall_info.c: fix build without forkFabrice Fontaine2020-04-141-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | Build without fork fails on: ptrace_syscall_info.c:33:27: error: 'expected_entry_size' defined but not used [-Werror=unused-const-variable=] static const unsigned int expected_entry_size = ^~~~~~~~~~~~~~~~~~~ ptrace_syscall_info.c:31:27: error: 'expected_none_size' defined but not used [-Werror=unused-const-variable=] static const unsigned int expected_none_size = ^~~~~~~~~~~~~~~~~~ ptrace_syscall_info.c:24:1: error: 'kill_tracee' defined but not used [-Werror=unused-function] kill_tracee(pid_t pid) ^~~~~~~~~~~ Fixes: - http://autobuild.buildroot.org/results/ffc81d3798379a9c34c7a708ebbdea27409f755d Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> * ptrace_syscall_info.c (kill_tracee, expected_none_size, expected_entry_size): Move definitions under [HAVE_FORK] guard. Resolves: https://github.com/strace/strace/pull/135
* bpf: update BPF_* constantsPaul Chaignon2020-04-135-10/+16
| | | | | | | | | | | | | | | * xlat/bpf_attach_types.in (BPF_MODIFY_RETURN): New constant introduced by Linux kernel commit v5.7-rc1~146^2~174^2~45^2~4. (BPF_LSM_MAC): New constant introduced by Linux kernel commit v5.7-rc1~146^2~10^2~9^2~7. * xlat/bpf_prog_types.in (BPF_PROG_TYPE_LSM): New constant introduced by Linux kernel commit v5.7-rc1~146^2~10^2~9^2~7. * NEWS: Mention this. * tests/bpf.c (BPF_PROG_LOAD_checks, BPF_PROG_QUERY_checks): Update checks and their expected output. * tests/kernel_version.c (print_bpf_attr, main): Likewise. Signed-off-by: Paul Chaignon <paul@cilium.io>
* Makefile.am: move almost all of strace_SOURCES to libstrace_a_SOURCESDmitry V. Levin2020-04-121-24/+21
| | | | | | | There is no need to track files that are used conditionally. * Makefile.am (strace_SOURCES): Move all except strace.c ... (libstrace_a_SOURCES): ... here.
* Rewrite decoders of getdents, getdents64, and readdir syscallsDmitry V. Levin2020-04-126-188/+287
| | | | | | | | | | | | | | | | | | | | | | | | | | | The old approach of allocating memory for all dentries returned by getdents/getdents64 was problematic, fix it by fetching and printing dentries sequentially. * dirent_types.c: New file. * xgetdents.c: Likewise. * xgetdents.h: Likewise. * Makefile.am (strace_SOURCES): Add them. * dirent.c: Include "xgetdents.h" and "print_fields.h". (header_size): New variable. (print_dentry_head, decode_dentry_head, decode_dentry_tail): New functions. (print_old_dirent): Rewrite using print_dentry_head. (SYS_FUNC(getdents)): Rewrite using xgetdents, decode_dentry_head, and decode_dentry_tail. * dirent64.c: Include "xgetdents.h", "kernel_dirent.h" and "print_fields.h" instead of "defs.h", <dirent.h> and "xlat/dirent_types.h". (decode_dentry_head, decode_dentry_tail): New functions. (SYS_FUNC(getdents64)): Rewrite using xgetdents, decode_dentry_head, and decode_dentry_tail. Resolves: https://github.com/strace/strace/issues/19 Resolves: https://github.com/strace/strace/pull/20
* Guard against invalid return values of getdents/getdents64 syscallsDmitry V. Levin2020-04-112-2/+4
| | | | | | | | | The kernel is not expected to return more bytes than requested. If this ever happens, treat it as an error. * dirent.c (SYS_FUNC(getdents)): Treat the return value greater than the third argument of syscall as an error. * dirent64.c (SYS_FUNC(getdents64)): Likewise.
* Print the second argument of getdents/getdents64 syscalls in abbrev modeDmitry V. Levin2020-04-113-21/+28
| | | | | | | * dirent.c (SYS_FUNC(getdents)) [!abbrev(tcp)]: Print u_arg[1] along with the number of entries. * dirent64.c (SYS_FUNC(getdents64)) [!abbrev(tcp)]: Likewise. * tests/xgetdents.c (ls): Update expected output.
* tests: check abbreviated decoding of getdents and getdents64 syscallsDmitry V. Levin2020-04-118-6/+48
| | | | | | | | | | | | | | * tests/getdents-v.c: New file. * tests/getdents64-v.c: Likewise. * tests/pure_executables.list: Add getdents-v and getdents64-v. * tests/.gitignore: Likewise. * tests/gen_tests.in (getdents-v, getdents64-v): New entries. (getdents, getdents64): Update. * tests/getdents.c (print_dirent): Define only if [VERBOSE]. * tests/getdents64.c (print_dirent): Likewise. * tests/xgetdents.c (str_d_type): Likewise. (ls): Handle [!VERBOSE] case. (main) [VERBOSE]: Add "-v" to dname.
* tests: refactor getdents and getdents64 testsDmitry V. Levin2020-04-114-194/+152
| | | | | | | * tests/xgetdents.c: New file. * tests/Makefile.am (EXTRA_DIST): Add xgetdents.c. * tests/getdents.c: Rewrite using xgetdents.c. * tests/getdents64.c: Likewise.
* Move kernel_dirent64 definition to kernel_dirent.hDmitry V. Levin2020-04-112-12/+13
| | | | | | | | | ... and rename kernel_dirent64 type to kernel_dirent64_t * tests/getdents64.c: Include "kernel_dirent.h", rename kernel_dirent64 to kernel_dirent64_t. (kernel_dirent64_t): Move ... * kernel_dirent.h: ... here.