summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* util: introduce get_finfo_for_dev functionMasatake YAMATO2023-02-192-7/+47
| | | | | | | | | | | | | | | | printdev() function does two things: it first obtains the information about the given fd and then prints it. Introduce get_finfo_for_dev() to implement the first part of printdev(). struct finfo is a new data structure for keeping information passed from get_finfo_for_dev() to printdev(). * src/defs.h (struct finfo): New data structure. * src/utils.c (get_finfo_for_dev): New function derived from printdev. (printdev): Use it. Signed-off-by: Masatake YAMATO <yamato@redhat.com> Signed-off-by: Dmitry V. Levin <ldv@strace.io>
* tests: enhance ptrace_syscall_info error diagnosticsDmitry V. Levin2023-02-191-57/+51
| | | | | | * tests/ptrace_syscall_info.c (test_none, test_entry, test_exit): In case of a fatal mismatch, print more expected output before termination, this helps in diagnostics of linux kernel bugs.
* Update .mailmapDmitry V. Levin2023-02-181-1/+1
| | | | * .mailmap: Update email addresses of Elvira Khabirova.
* tests: remove getpid and getppid from check_PROGRAMSElvira Khabirova2023-02-181-2/+0
| | | | | | | | | | getpid and getppid are already listed in $(PURE_EXECUTABLES). Remove the duplicate entries. * tests/Makefile.am (check_PROGRAMS): Remove getpid and getppid. Fixes: v4.17~123 ("tests: add tests for getpid and getppid syscalls") Signed-off-by: Elvira Khabirova <lineprinter0@gmail.com>
* strace: declare nflag variable as staticDmitry V. Levin2023-02-151-1/+1
| | | | | | | | | | Apparently, nflag is not used outside the compilation unit where it is defined. * src/strace.c (nflag): Add static qualifier. Reported-by: Masatake YAMATO <yamato@redhat.com> Fixes: v5.9~55 "strace: add an option for printing syscall numbers"
* treewide: replace "sed -r" with "sed -E"Dmitry V. Levin2023-02-1419-38/+38
| | | | | | | | | Use -E option instead of -r to enable use extended regular expression syntax in sed expressions. It has been supported for years by GNU sed, and is now included in POSIX. Link: https://www.austingroupbugs.net/view.php?id=528 Resolves: https://github.com/strace/strace/issues/216
* xlat: update V4L2_CTRL_TYPE_* constantsDmitry V. Levin2023-02-132-2/+11
| | | | | | | | | | | | | * src/xlat/v4l2_control_types.in (V4L2_CTRL_TYPE_MPEG2_QUANTISATION, V4L2_CTRL_TYPE_MPEG2_SEQUENCE, V4L2_CTRL_TYPE_MPEG2_PICTURE): New constants introduced by Linux kernel commit v5.14-rc1~165^2~241. (V4L2_CTRL_TYPE_VP9_COMPRESSED_HDR, V4L2_CTRL_TYPE_VP9_FRAME): New constants introduced by Linux kernel commit v5.17-rc1~114^2~207. (V4L2_CTRL_TYPE_HEVC_SPS, V4L2_CTRL_TYPE_HEVC_PPS, V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS, V4L2_CTRL_TYPE_HEVC_SCALING_MATRIX, V4L2_CTRL_TYPE_HEVC_DECODE_PARAMS): New constants introduced by Linux kernel commit v6.0-rc1~139^2~93. * NEWS: Mention this change.
* xlat: update V4L2_CTRL_FLAG_* constantsDmitry V. Levin2023-02-133-5/+9
| | | | | | | * src/xlat/v4l2_control_flags.in (V4L2_CTRL_FLAG_DYNAMIC_ARRAY): New constant introduced by Linux kernel commit v6.0-rc1~139^2~104. * tests/ioctl_v4l2-success.c (main): Update expected output. * NEWS: Mention this change.
* xlat: update V4L2_PIX_FMT_* constantsDmitry V. Levin2023-02-132-1/+9
| | | | | | | | | | | | | | | | * src/xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_P010): New constant introduced by Linux kernel commit v6.0-rc1~139^2~420. (V4L2_PIX_FMT_YUVA32, V4L2_PIX_FMT_YUVX32): New constants introduced by Linux kernel commit v6.0-rc1~139^2~126. (V4L2_PIX_FMT_HEVC_SLICE): New constant introduced by Linux kernel commit v6.0-rc1~139^2~94. (V4L2_PIX_FMT_P010_4L4): New constant introduced by Linux kernel commit v6.0-rc1~139^2~73. (V4L2_PIX_FMT_AJPG): New constant introduced by Linux kernel commit v6.2-rc1~125^2~249^2~13. V4L2_PIX_FMT_NV12_8L128, V4L2_PIX_FMT_NV12_10BE_8L128): New constants introduced by Linux kernel commit v6.2-rc1~125^2~50. * NEWS: Mention this change.
* xlat: update V4L2_CID_* constantsDmitry V. Levin2023-02-133-1/+5
| | | | | | | | | | | | * src/xlat/v4l2_control_id_bases.in (V4L2_CID_USER_ISL7998X_BASE): New constant introduced by Linux kernel commit v5.18-rc1~153^2~82^2~6. (V4L2_CID_USER_DW100_BASE): New constant introduced by Linux kernel commit v6.1-rc1~130^2~98. (V4L2_CID_USER_ASPEED_BASE): New constant introduced by Linux kernel commit v6.2-rc1~125^2~249^2~12. * src/xlat/v4l2_control_ids.in (V4L2_CID_COLORFX_RGB): New constant introduced by Linux kernel commit v5.17-rc1~114^2~388. * NEWS: Mention this change.
* xlat: update NFT_MSG_* constantsDmitry V. Levin2023-02-123-1/+3
| | | | | | | * src/xlat/nf_nftables_msg_types.in (NFT_MSG_GETRULE_RESET): New constant introduced by Linux kernel commit v6.2-rc1~99^2~210^2~2. * src/netlink.c (decode_nlmsg_flags_netfilter) Handle it. * NEWS: Mention this change.
* xlat: update NTF_EXT_* constantsDmitry V. Levin2023-02-113-3/+6
| | | | | | | * src/xlat/neighbor_cache_entry_ext_flags.in (NTF_EXT_LOCKED): New constant introduced by Linux kernel commit v6.2-rc1~99^2~297^2~1. * tests/nlattr_ndmsg.c (main): Update expected output. * NEWS: Mention this change.
* xlat: update LANDLOCK_ACCESS_FS_* constantsDmitry V. Levin2023-02-104-5/+6
| | | | | | | | * src/xlat/landlock_ruleset_access_fs.in (LANDLOCK_ACCESS_FS_TRUNCATE): New constant introduced by Linux kernel commit v6.2-rc1~138^2~8. * tests/landlock_add_rule.c (main): Update expected output. * tests/landlock_create_ruleset.c: Likewise. * NEWS: Mention this change.
* xlat: update KVM_* constantsDmitry V. Levin2023-02-092-1/+4
| | | | | | | | * src/xlat/kvm_cap.in (KVM_CAP_S390_PROTECTED_ASYNC_DISABLE): New constant introduced by Linux kernel commit v6.2-rc1~77^2~5^2~5. (KVM_CAP_DIRTY_LOG_RING_WITH_BITMAP): New constant introduced by Linux kernel commit v6.2-rc1~77^2~4. * NEWS: Mention this change.
* Revert "Update .mailmap"Dmitry V. Levin2023-02-081-1/+0
| | | | | | * .mailmap: Remove email addresses of Sven Schnelle per request. This reverts commit 3c26d12962a8d907f276d218bf9acc2e522e9340.
* tests: check umovestr return value when the string crosses a page boundaryDmitry V. Levin2023-02-071-0/+19
| | | | * tests/ioctl_kd.c (check_kbdsent): New check.
* ucopy: fix umovestr return value when the string crosses page boundariesDmitry V. Levin2023-02-061-1/+1
| | | | | | | * src/ucopy.c (umovestr): When the string crosses page boundaries, take the length on each page into account. Resolves: https://github.com/strace/strace/issues/217
* src: fix typo in commentsDmitry V. Levin2023-02-051-2/+2
| | | | * src/util.c: Replace umovenstr with umovestr in comments.
* pc.test: Fix up order of strace messages againHelge Deller2023-01-311-1/+1
| | | | | | | | | | It seems I managed to swap two lines with my last patch. This fixes it up again and brings it in the correct logical order. There is no functional change. The testcase succeeds in both cases. Fixes: 1b828bb0f48a ("hppa: Fix pc.test testcase on hppa architecture") Signed-off-by: Helge Deller <deller@gmx.de>
* membarrier: add MEMBARRIER_CMD_GET_REGISTRATIONS flagSven Schnelle2023-01-303-1/+12
| | | | | | | | | Signed-off-by: Sven Schnelle <svens@linux.ibm.com> * src/xlat/membarrier_cmds.in (MEMBARRIER_CMD_GET_REGISTRATIONS): New constant which is likely to be introduced in Linux kernel v6.3. * tests/membarrier.c (main): Update expected output. * NEWS: Mention the change.
* Update ioctl entries from linux v6.2Gleb Fotengauer-Malinovskiy2023-01-3013-9/+66
| | | | | | | | | | | | | | | | | * src/linux/32/ioctls_inc_align16.h: Update from linux v6.2-rc6 using ioctls_gen.sh. * src/linux/32/ioctls_inc_align32.h: Likewise. * src/linux/32/ioctls_inc_align64.h: Likewise. * src/linux/64/ioctls_inc.h: Likewise. * src/linux/x32/ioctls_inc0.h: Likewise. * src/linux/aarch64/ioctls_arch0.h: Likewise. * src/linux/i386/ioctls_arch0.h: Likewise. * src/linux/mips/ioctls_arch0.h: Likewise. * src/linux/powerpc/ioctls_arch0.h: Likewise. * src/linux/s390/ioctls_arch0.h: Likewise. * src/linux/s390x/ioctls_arch0.h: Likewise. * src/linux/x86_64/ioctls_arch0.h: Likewise. * NEWS: Mention this.
* hppa: Fix pc.test testcase on hppa architectureHelge Deller2023-01-291-2/+3
| | | | | | | | | | | | | | On hppa the lowest 2 bits of an address encodes the (parisc-specific) address space in which a program runs. For userspace processes the space number is 3, which is why an instruction at e.g. 0x100 shows up in the address registers as 0x103. This behaviour is different than on other architectures, which is why the pc.test testcase fails on hppa. Fix the testcase by simply dropping the last nibble of the address when comparing the output, e.g. search for "0x10?" instead of "0x100". Signed-off-by: Helge Deller <deller@gmx.de>
* hppa: Drop special handling of fanotify syscalls on pariscHelge Deller2023-01-292-9/+0
| | | | | | | | The fanotify syscall in the parisc kernel has been fixed by Linux kernel commit v3.16-rc5~6^2~1 and now behaves like the other architectures, so drop the special workaround for hppa. Signed-off-by: Helge Deller <deller@gmx.de>
* hppa: Fix display of mask for rt_sigreturn syscallHelge Deller2023-01-292-8/+37
| | | | | | | | | | | | | | | | | | | Fix FUNC_GET_RT_SIGFRAME_ADDR to return correct address to the sigframe so that the mask can be shown for the rt_sigreturn syscall. This patch cleans up and simplifies the address calculation when running on Linux kernels < 5.18, where the signal trampoline code was stored in the executable stack. With kernel 5.18 we added a VDSO with the trampoline code, could drop the neccessarity of an executable stack and provided the offset to the ucontext of the rt_sigframe struct for gdb and to simplify the calculation sigframe address. With this patch the rt_sigreturn.gen.test passes for 5.16 and 6.1 kernels on hppa. Signed-off-by: Helge Deller <deller@gmx.de>
* hppa: Disable workaround for hppa in syscall number tamperingHelge Deller2023-01-291-1/+1
| | | | | | | | | | | | This basically disables the workaround added by commit ce494f63d2 ("hppa: workaround kernel bug in syscall number tampering"). It's not needed any longer and has been fixed in upstream kernels by Linux kernel commit v5.0-rc8~9^2~1. Basically the remaining part of that commit could go as well, since hppa was the only user. Signed-off-by: Helge Deller <deller@gmx.de>
* hppa: Switch to getregset call on hppaHelge Deller2023-01-291-1/+1
| | | | | | | | | PTRACE_GETREGSET support was introduced in the parisc kernel by Linux kernel commit v4.7-rc1~58^2~10. This fixes the tampering of syscall return values. Signed-off-by: Helge Deller <deller@gmx.de>
* ci: Add missing permission `security-events`Jan Macku2023-01-261-0/+3
| | | | | | | | | | Differential ShellCheck requires permission `security-events: write` to successfully upload the SARIF file to GitHub. This permission might be optional for some repositories since they allow all permissions for all workflows in settings. But I wouldn't advise this setting since the best security practice is to allow only a minimal set of required permissions.
* xlat: update KEY_* constantsDmitry V. Levin2023-01-212-1/+4
| | | | | | | * src/xlat/evdev_keycode.in (KEY_CAMERA_ACCESS_ENABLE, KEY_CAMERA_ACCESS_DISABLE, KEY_CAMERA_ACCESS_TOGGLE): New constants introduced by Linux kernel commit v6.2-rc1~116^2^2~117. * NEWS: Mention this.
* xlat: update IFLA_* constantsDmitry V. Levin2023-01-206-3/+11
| | | | | | | | | | | | * src/xlat/rtnl_ifla_brport_attrs.in (IFLA_BRPORT_MAB): New constant introduced by Linux kernel commit v6.2-rc1~99^2~297^2~1. * src/xlat/rtnl_link_attrs.in (IFLA_DEVLINK_PORT): New constant introduced by Linux kernel commit v6.2-rc1~99^2~296^2. * src/rtnl_link.c (ifla_brport_nla_decoders): Add IFLA_BRPORT_MAB. (ifinfomsg_nla_decoders): Add IFLA_DEVLINK_PORT. * tests/nlattr_ifla_brport.c (main): Update expected output. * tests/nlattr_ifla_linkinfo.c: Likewise. * NEWS: Mention this.
* ci(lint): add shell linter - Differential ShellCheckJan Macku2023-01-161-0/+38
| | | | | | | | It performs differential ShellCheck scans and report results directly in pull request. documentation: https://github.com/redhat-plumbers-in-action/differential-shellcheck
* xlat: update BPF_* constantsDmitry V. Levin2023-01-063-6/+7
| | | | | | | * src/xlat/bpf_map_types.in (BPF_MAP_TYPE_CGRP_STORAGE): New constant introduced by Linux kernel commit v6.2-rc1~99^2~309^2~7^2~6. * NEWS: Mention this change. * tests/bpf.c (BPF_MAP_CREATE_checks): Update.
* xlat: update ALG_* constantsDmitry V. Levin2023-01-052-6/+8
| | | | | | * src/xlat/sock_alg_options.in (ALG_SET_KEY_BY_KEY_SERIAL): New constant introduced by Linux kernel commit v6.2-rc1~87^2~128. * NEWS: Mention this change.
* bundled: update linux UAPI headers to v6.2-rc2Dmitry V. Levin2023-01-0421-95/+552
| | | | | | | | | | | | | | | | | | | | | | | | | * bundled/linux/include/uapi/linux/btrfs.h: Update to headers_install'ed Linux kernel v6.2-rc2. * bundled/linux/include/uapi/linux/btrfs_tree.h: Likewise. * bundled/linux/include/uapi/linux/dcbnl.h: Likewise. * bundled/linux/include/uapi/linux/fscrypt.h: Likewise. * bundled/linux/include/uapi/linux/if_alg.h: Likewise. * bundled/linux/include/uapi/linux/if_bridge.h: Likewise. * bundled/linux/include/uapi/linux/if_link.h: Likewise. * bundled/linux/include/uapi/linux/input-event-codes.h: Likewise. * bundled/linux/include/uapi/linux/io_uring.h: Likewise. * bundled/linux/include/uapi/linux/landlock.h: Likewise. * bundled/linux/include/uapi/linux/mptcp.h: Likewise. * bundled/linux/include/uapi/linux/neighbour.h: Likewise. * bundled/linux/include/uapi/linux/netfilter/ipset/ip_set.h: Likewise. * bundled/linux/include/uapi/linux/netfilter/nf_tables.h: Likewise. * bundled/linux/include/uapi/linux/netfilter/nfnetlink_cttimeout.h: Likewise. * bundled/linux/include/uapi/linux/tcp.h: Likewise. * bundled/linux/include/uapi/linux/v4l2-common.h: Likewise. * bundled/linux/include/uapi/linux/v4l2-controls.h: Likewise. * bundled/linux/include/uapi/linux/version.h: Likewise. * bundled/linux/include/uapi/linux/videodev2.h: Likewise. * bundled/linux/include/uapi/rdma/ib_user_verbs.h: Likewise.
* io_uring: prepare for <linux/io_uring.h> updateDmitry V. Levin2023-01-033-0/+8
| | | | | | | * src/io_uring.c: Include "kernel_time_types.h". (UAPI_LINUX_IO_URING_H_SKIP_LINUX_TIME_TYPES_H): New macro. * tests/io_uring_register.c: Likewise. * tests/io_uring_setup.c: Likewise.
* tests: enable time_types.h based tests unconditionallyDmitry V. Levin2023-01-022-26/+2
| | | | | | | | | | | | * tests/msg_control.c: Do not include <linux/time_types.h>, include "kernel_time_types.h" unconditionally instead. (test_scm_timestamp_new, test_scm_timestampns_new): Compile unconditionally. (test_sol_socket): Call them unconditionally. * tests/sockopt-timestamp.c: Do not include <linux/time_types.h>, include "kernel_time_types.h" unconditionally instead. (print_timestamp_new, print_timestampns_new): Compile unconditionally. (main): Call them unconditionally.
* Provide fallback definitions for __kernel_sock_timeval and __kernel_timespecDmitry V. Levin2023-01-013-2/+34
| | | | | | | | | | | | | If kernel headers do not provide linux/time_types.h, provide fallback definitions for __kernel_sock_timeval and __kernel_timespec. * src/kernel_timespec.h [!HAVE_STRUCT___KERNEL_TIMESPEC] (__kernel_timespec): New macro. * src/kernel_timespec.h (struct kernel_timespec64_t, struct kernel_timespec32_t): New types. * src/kernel_time_types.h: New file. * src/Makefile.am (libstrace_a_SOURCES): Add it.
* src: introduce tprint*_sysret_* helpersDmitry V. Levin2022-12-313-28/+77
| | | | | | | | | * src/print_fields.h (tprint_sysret_begin, tprints_sysret_next, tprints_sysret_string, tprint_sysret_pseudo_rval, tprint_sysret_end): New functions. * src/strace.c (print_event_exit): Use them. * src/syscall.c (print_err_ret, print_injected_note, print_erestart, syscall_exiting_trace): Likewise.
* print_syscall_resume: always update printing_tcpDmitry V. Levin2022-12-302-2/+1
| | | | | | | | * src/syscall.c (print_syscall_resume): Explicitly update printing_tcp so that printing_tcp is updated even if printleader is not invoked. (syscall_exiting_trace): Do not update printing_tcp after print_syscall_resume invocation. * src/strace.c (print_event_exit): Likewise.
* printleader: do not mark output as unfinished unnecessarilyDmitry V. Levin2022-12-295-3/+96
| | | | | | | | | | | * src/strace.c (printleader): Do not mark staged output in other processes as unfinished. * tests/status-successful-threads.c: New file. * tests/status-successful-threads.test: New test. * tests/.gitignore: Add status-successful-threads. * tests/Makefile.am (check_PROGRAMS): Likewise. (status_successful_threads_LDADD): New variable. (MISC_TESTS): Add status-successful-threads.test.
* print_event_exit: do not mark output as unfinished unnecessarilyDmitry V. Levin2022-12-285-1/+77
| | | | | | | | | | | * src/strace.c (print_event_exit): When handling PTRACE_EVENT_EXIT for a process, do not mark staged output in other processes as unfinished. * tests/status-detached-threads.c: New file. * tests/status-detached-threads.test: New test. * tests/.gitignore: Add status-detached-threads. * tests/Makefile.am (check_PROGRAMS): Likewise. (status_detached_threads_LDADD): New variable. (MISC_TESTS): Add status-detached-threads.test.
* src: do not use STRACE_PRINTF outside print_fields.hDmitry V. Levin2022-12-271-1/+1
| | | | | | | This macro was not intended to be used outside print_fields.h * src/v4l2.c (PRINT_FIELD_FRACT): Replace STRACE_PRINTF with tprintf_string.
* tprints_comment: use tprint_comment_* helpersDmitry V. Levin2022-12-261-2/+5
| | | | | * src/strace.c (tprints_comment): Use tprint_comment_begin and tprint_comment_end.
* syscall: introduce print_erestart helperDmitry V. Levin2022-12-251-4/+10
| | | | | * src/syscall.c (print_erestart): New function. (syscall_exiting_trace): Use it.
* syscall: simplify syscall_exiting_trace a bitDmitry V. Levin2022-12-241-8/+3
| | | | | * src/syscall.c (syscall_exiting_trace): Print the auxiliary string and the injection note just in one location.
* syscall: print injection note after the auxiliary stringDmitry V. Levin2022-12-231-1/+1
| | | | | | * src/syscall.c (syscall_exiting_trace): In all cases where injection note is printed, make sure it is printed after the auxiliary string, not before it.
* src: introduce tprint_arg_name_end helperFabrice Le Fessant2022-12-222-0/+11
| | | | | | | * src/defs.h (tprint_arg_name_end): New function. * src/clone.c (SYS_FUNC(clone)): Use it. Co-authored-by: Dmitry V. Levin <ldv@strace.io>
* src: rename tprints_arg_name to tprints_arg_name_beginFabrice Le Fessant2022-12-212-7/+7
| | | | Co-authored-by: Dmitry V. Levin <ldv@strace.io>
* src: rename tprintf to tprintf_stringFabrice Le Fessant2022-12-2016-91/+93
| | | | Co-authored-by: Dmitry V. Levin <ldv@strace.io>
* src: rename tprints to tprints_stringFabrice Le Fessant2022-12-1932-87/+87
| | | | Co-authored-by: Dmitry V. Levin <ldv@strace.io>
* src: introduce printflags_in and printflags64_in helpersFabrice Le Fessant2022-12-1815-23/+38
| | | | | | | | | | | | | | | | | | | | | | | | * src/defs.h (printflags64_in): Rename from printflags64. (printflags_in): Rename from printflags. Use printflags64_in. (printflags64, printflags): New functions. * src/capability.c (print_cap_bits): Use printflags_in instead of printflags. * src/fanotify.c (SYS_FUNC(fanotify_init)): Likewise. * src/ipc_msg.c (SYS_FUNC(msgget)): Likewise. * src/ipc_sem.c (SYS_FUNC(semget)): Likewise. * src/ipc_shm.c (SYS_FUNC(shmget)): Likewise. * src/net.c (tprint_sock_type): Likewise. * src/personality.c (SYS_FUNC(personality)): Likewise. * src/statx.c (SYS_FUNC(statx)): Likewise. * src/swapon.c (SYS_FUNC(swapon)): Likewise. * src/v4l2.c (print_v4l2_buffer_flags, print_v4l2_cid): Likewise. * src/clone.c (SYS_FUNC(clone)): Use printflags64_in instead of printflags64. * src/kexec.c (SYS_FUNC(kexec_load)): Likewise. * src/mount.c (SYS_FUNC(mount)): Likewise. * src/term.c (decode_oflag, decode_cflag): Likewise. Co-authored-by: Dmitry V. Levin <ldv@strace.io>