2023-10-31  Dmitry V. Levin  <ldv@strace.io>

	Prepare for 6.6 release.
	* NEWS: Update for 6.6 release.

2023-10-30  Dmitry V. Levin  <ldv@strace.io>

	Update copyright headers.
	Headers updated automatically using maint/update_copyright_years.sh
	script.

2023-10-29  Dmitry V. Levin  <ldv@strace.io>

	Fix preprocessor indentation.
	Indent the C preprocessor directives to reflect their nesting
	using the following script:

	$ cppi -l $(git grep -El '^[[:space:]]*#[[:space:]]*(if|ifdef|ifndef|elif|else|endif|define|pragma)[[:space:]]' src tests |grep -Ev '\.(sh|test)$') |while read f; do
		cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
	done

2023-10-24  Dmitry V. Levin  <ldv@strace.io>

	xlat: update ARCH_* constants.
	* src/xlat/archvals.in (ARCH_GET_UNTAG_MASK, ARCH_ENABLE_TAGGED_ADDR,
	ARCH_GET_MAX_TAG_BITS): New constants introduced by Linux kernel commit
	v6.4-rc1~97^2~11.
	(ARCH_FORCE_TAGGED_SVA): New constant introduced by Linux kernel commit
	v6.4-rc1~97^2~8.
	(ARCH_SHSTK_ENABLE, ARCH_SHSTK_DISABLE, ARCH_SHSTK_LOCK): New constants
	introduced by Linux kernel commit v6.6-rc1~117^2~21.
	(ARCH_SHSTK_UNLOCK): New constant introduced by Linux kernel commit
	v6.6-rc1~117^2~6.
	(ARCH_SHSTK_STATUS): New constant introduced by Linux kernel commit
	v6.6-rc1~117^2~5.
	* NEWS: Mention this change.

2023-10-23  Dmitry V. Levin  <ldv@strace.io>

	xlat: update PTRACE_* constants.
	* src/xlat/ptrace_cmds.in (PTRACE_GETFDPIC): Update definitions
	for m68k, riscv, and xtensa.
	(PTRACE_SYSEMU, PTRACE_SYSEMU_SINGLESTEP): Update definitions
	for loongarch.
	* NEWS: Mention this change.

2023-10-22  Dmitry V. Levin  <ldv@strace.io>

	xlat: update MAP_* constants.
	* src/xlat/mmap_flags.in (MAP_ABOVE4G): New constant introduced
	by Linux kernel commit v6.6-rc1~117^2~27.
	* NEWS: Mention this change.

2023-10-21  Dmitry V. Levin  <ldv@strace.io>

	tests: check how strace handles $PATH.
	* tests/exec-PATH.test: New test.
	* tests/Makefile.am (MISC_TESTS): Add exec-PATH.test.

2023-10-20  Dmitry V. Levin  <ldv@strace.io>

	startup_child: enhance error diagnostics.
	* src/strace.c (startup_child): Differentiate between the case when
	the specified executable does not exist and the case when it could
	not be found in the list of directory pathnames specified in the PATH
	environment variable.

2023-10-19  Dmitry V. Levin  <ldv@strace.io>

	Remove some dead code.
	* src/strace.c [USE_DEBUGGING_EXEC]: Remove.

2023-10-18  Dmitry V. Levin  <ldv@strace.io>

	Implement decoding of map_shadow_stack syscall.
	This new syscall for x86_64 architecture was introduced
	by Linux kernel commit v6.6-rc1~117.

	* src/map_shadow_stack.c: New file.
	* src/xlat/shadow_stack_flags.in: Likewise.
	* src/Makefile.am (libstrace_a_SOURCES): Add map_shadow_stack.c.
	* src/linux/x86_64/syscallent.h [453]: Wire up map_shadow_stack.
	* src/linux/x32/syscallent.h: Likewise.
	* tests/tests.h (XLAT_name): New macro.
	* tests/map_shadow_stack.c: New file.
	* tests/map_shadow_stack-Xabbrev.c: Likewise.
	* tests/map_shadow_stack-Xraw.c: Likewise.
	* tests/map_shadow_stack-Xverbose.c: Likewise.
	* tests/pure_executables.list: Add map_shadow_stack, map_shadow_stack-Xabbrev,
	map_shadow_stack-Xraw, and map_shadow_stack-Xverbose.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (map_shadow_stack, map_shadow_stack-Xabbrev,
	map_shadow_stack-Xraw, map_shadow_stack-Xverbose): New tests.
	* NEWS: Mention this change.

2023-10-17  Dmitry V. Levin  <ldv@strace.io>

	tests: extend -u coverage.
	* tests/options-syntax.test: Use fakeroot to extend -u coverage.

2023-10-16  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v6.6.
	* src/linux/32/ioctls_inc_align16.h: Update from linux v6.6-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.
	* NEWS: Mention this.

2023-10-16  Dmitry V. Levin  <ldv@strace.io>

	tests: enhance termsig test.
	* tests/termsig.test: Check -D mode as well.

	tests: cleanup termsig test.
	* tests/termsig.test: Fold two identical blocks into a loop.

2023-10-15  Dmitry V. Levin  <ldv@strace.io>

	tests: check how strace handles attempts to trace itself.
	* tests/strace-self.test: New file.
	* tests/Makefile.am (MISC_TESTS): Add strace-self.test.

2023-10-14  Dmitry V. Levin  <ldv@strace.io>

	tests: fix so_peerpidfd test.
	* tests/so_peerpidfd.c (print_pidfd): Fix expected output.

	Fixes: v6.5~38 "net: implement decoding of SO_PEERPIDFD socket option"
	Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2243631

2023-10-13  Dmitry V. Levin  <ldv@strace.io>

	Set PTRACE_O_EXITKILL option along with PTRACE_O_TRACESECCOMP.
	When --seccomp-bpf is enabled and -p/--attach option is not used,
	a seccomp filter is being assigned to all tracees.  In that case also set
	PTRACE_O_EXITKILL option for all tracee processes and do not detach them
	on cleanup so they will not be left running after the tracer exit.

	* doc/strace.1.in: Document this.
	* src/strace.c (init) <seccomp_filtering>: Add PTRACE_O_EXITKILL
	to ptrace_setoptions when all conditions are met.
	* tests/filter_seccomp-exitkill.test: New test.
	* tests/Makefile.am (MISC_TESTS): Add filter_seccomp-exitkill.test.
	* NEWS: Mention this change.

2023-10-12  Dmitry V. Levin  <ldv@strace.io>

	Introduce --kill-on-exit option.
	This new option instructs the tracer to set PTRACE_O_EXITKILL option for
	all tracees and not to detach them on cleanup so they will not be left
	running after the tracer exit.

	* src/exitkill.c: New file.
	* src/exitkill.h: Likewise.
	* src/Makefile.am (libstrace_a_SOURCES): Add exitkill.c and exitkill.h.
	* src/strace.c: Include "exitkill.h".
	(init): Handle --kill-on-exit option.
	(cleanup): Do not detach tracees if PTRACE_O_EXITKILL is added
	to ptrace_setoptions.
	(usage): Document --kill-on-exit option.
	* doc/strace.1.in: Likewise.
	* tests/bexecve.test: Check that --kill-on-exit option works
	with -b execve.
	* tests/kill-on-exit.sh: New file.
	* tests/kill-on-exit.test: New test.
	* tests/options-syntax.test: Check invalid use of --kill-on-exit option.
	* tests/Makefile.am (MISC_TESTS): Add kill-on-exit.test.
	(EXTRA_DIST): Add kill-on-exit.sh.
	* NEWS: Mention this change.

2023-10-12  Dmitry V. Levin  <ldv@strace.io>

	Print a debug message containing the pid of the daemonized tracer process
	* src/strace.c (startup_attach) <daemonized_tracer>: Print a debug
	message containing the tracer pid.

2023-10-11  Dmitry V. Levin  <ldv@strace.io>

	Disable seccomp filtering when all tracees are attached using -p option.
	* src/strace.c (init): Optimize disabling of seccomp filtering
	when it is not going to be used anyway.

	Reorder --seccomp-bpf incompatibility diagnostic messages.
	* src/strace.c (init): Reorder --seccomp-bpf incompatibility diagnostic
	messages.
	* tests/bexecve.test: Update.

2023-10-10  Dmitry V. Levin  <ldv@strace.io>

	Unexport ptrace_setoptions variable.
	* src/strace.c (ptrace_setoptions): Add static qualifier.
	* src/defs.h (ptrace_setoptions): Remove declaration.

	Complements: v4.10~73 "Remove support for systems without PTRACE_SETOPTIONS"

2023-10-09  Dmitry V. Levin  <ldv@strace.io>

	tests: extend UFFDIO_* ioctl coverage.
	* tests/ioctl_uffdio.c: Check UFFDIO_* ioctl decoding even when
	the kernel does not provide userfaultfd support.

2023-10-08  Dmitry V. Levin  <ldv@strace.io>

	userfaultfd: implement decoding of UFFDIO_POISON ioctl.
	* src/linux/32/ioctls_inc_align16.h (UFFDIO_POISON): New
	constant introduced by Linux kernel commit v6.6-rc1~53^2~425.
	* 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/xlat/uffd_poison_mode_flags.in: New file.
	* src/userfaultfd.c: Include "xlat/uffd_poison_mode_flags.h".
	(uffdio_ioctl): Decode UFFDIO_POISON command.
	* tests/ioctl_uffdio.c (main): Check it.
	* NEWS: Mention this change.

2023-10-05  Dmitry V. Levin  <ldv@strace.io>

	userfaultfd: implement decoding of UFFDIO_CONTINUE ioctl.
	* src/xlat/uffd_continue_mode_flags.in: New file.
	* src/userfaultfd.c: Include "xlat/uffd_continue_mode_flags.h".
	(uffdio_ioctl): Decode UFFDIO_CONTINUE command introduced
	by Linux kernel commit v5.13-rc1~39^2~86.
	* tests/ioctl_uffdio.c (main): Check it.
	* NEWS: Mention this change.

2023-10-04  Dmitry V. Levin  <ldv@strace.io>

	userfaultfd: implement decoding of UFFDIO_WRITEPROTECT ioctl.
	* src/xlat/uffd_writeprotect_mode_flags.in: New file.
	* src/userfaultfd.c: Include "xlat/uffd_writeprotect_mode_flags.h".
	(uffdio_ioctl): Decode UFFDIO_WRITEPROTECT command introduced
	by Linux kernel commit v5.7-rc1~58^2~113.
	* tests/ioctl_uffdio.c (main): Check it.
	* NEWS: Mention this change.

2023-10-03  Dmitry V. Levin  <ldv@strace.io>

	xlat: update V4L2_* constants.
	* src/xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_MT2110T): New constant
	introduced by Linux kernel commit v6.6-rc1~97^2~156.
	(V4L2_PIX_FMT_MT2110R): New constant introduced by Linux kernel
	commit v6.6-rc1~97^2~155.
	* NEWS: Mention this change.

2023-10-02  Dmitry V. Levin  <ldv@strace.io>

	Update copyright year number range.
	* COPYING: Update copyright year number range.
	* tests/COPYING: Likewise.
	* debian/copyright: Likewise.

	Resolves: https://github.com/strace/strace/issues/267

2023-10-01  Dmitry V. Levin  <ldv@strace.io>

	xlat: update UFFD_* constants.
	* src/xlat/uffd_api_features.in (UFFD_FEATURE_POISON): New constant
	introduced by Linux kernel commit v6.6-rc1~53^2~422.
	* src/xlat/uffd_register_ioctl_flags.in (1<<_UFFDIO_POISON): Likewise.
	* NEWS: Mention this change.

2023-09-28  Dmitry V. Levin  <ldv@strace.io>

	Implement decoding of SECCOMP_IOCTL_NOTIF_SET_FLAGS ioctl.
	* src/linux/32/ioctls_inc_align16.h (SECCOMP_IOCTL_NOTIF_SET_FLAGS): New
	constant introduced by Linux kernel commit v6.6-rc1~205^2~6.
	* 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/xlat/seccomp_ioctl_notif_flags.in: New file.
	* src/seccomp_ioctl.c: Include "xlat/seccomp_ioctl_notif_flags.h"
	(seccomp_ioctl): Decode SECCOMP_IOCTL_NOTIF_SET_FLAGS command.
	* tests/ioctl_seccomp.c (main): Check it.
	* tests/gen_tests.in (ioctl_seccomp-y-success--pidns-translation-Xraw,
	ioctl_seccomp-y-success-Xraw): Update the argument for -a option.
	* NEWS: Mention this change.

2023-09-27  Dmitry V. Levin  <ldv@strace.io>

	xlat: update QFMT_* constants.
	* src/xlat/quota_formats.in (QFMT_SHMEM): New constant introduced
	by Linux kernel commit v6.6-rc1~219^2~16.
	* tests/quotactl.c (print_dqfmt): Update expected output.
	* NEWS: Mention this change.

2023-09-26  Dmitry V. Levin  <ldv@strace.io>

	Implement decoding of FSCONFIG_CMD_CREATE_EXCL fsconfig command.
	* src/xlat/fsconfig_cmds.in (FSCONFIG_CMD_CREATE_EXCL): New constant
	introduced by Linux kernel commit v6.6-rc1~221^2.
	* src/fsconfig.c (SYS_FUNC(fsconfig)): Handle it.
	* tests/fsconfig.c (main): Check it.
	(test_fsconfig_unknown): Update expected output.
	* NEWS: Mention this change.

2023-09-25  Dmitry V. Levin  <ldv@strace.io>

	xlat: update KEXEC_* constants.
	* src/xlat/kexec_load_flags.in (KEXEC_UPDATE_ELFCOREHDR):
	New constant introduced by Linux kernel commit v6.6-rc1~155^2~4.
	* tests/kexec_load.c (main): Update expected output.
	* NEWS: Mention this change.

2023-09-24  Dmitry V. Levin  <ldv@strace.io>

	xlat: update DEVCONF_* constants.
	* src/xlat/inet6_devconf_indices.in (DEVCONF_ACCEPT_RA_MIN_LFT):
	New constant introduced by Linux kernel commit v6.6-rc1~162^2~302.
	* NEWS: Mention this change.

2023-09-23  Dmitry V. Levin  <ldv@strace.io>

	xlat: update IORING_SETUP_* constants.
	* src/xlat/uring_setup_flags.in (IORING_SETUP_NO_SQARRAY):
	New constant introduced by Linux kernel commit v6.6-rc1~152^2~5.
	* tests/io_uring_setup.c (main): Update expected output.
	* NEWS: Mention this change.

2023-09-22  Dmitry V. Levin  <ldv@strace.io>

	xlat: update XDP_* constants.
	* src/xlat/xdp_sockaddr_flags.in (XDP_USE_SG): New constant introduced
	by Linux kernel commit v6.6-rc1~162^2~371^2~3^2~22.
	* tests/sockaddr_xlat.c (check_xdp): Update expected output.
	* NEWS: Mention this change.

2023-09-21  Dmitry V. Levin  <ldv@strace.io>

	Implement decoding of IFLA_BRPORT_BACKUP_NHID netlink attribute.
	* src/xlat/rtnl_ifla_brport_attrs.in (IFLA_BRPORT_BACKUP_NHID):
	New constant introduced by Linux kernel commit v6.6-rc1~162^2~377^2~1.
	* src/rtnl_link.c (ifla_brport_nla_decoders): Add it.
	* tests/nlattr_ifla_brport.c (main): Update expected output.
	* tests/nlattr_ifla_linkinfo.c (main): Likewise.
	* NEWS: Mention this change.

2023-09-20  Dmitry V. Levin  <ldv@strace.io>

	xlat: update NT_* constants.
	* src/xlat/nt_descriptor_types.in (NT_X86_SHSTK): New constant
	introduced by Linux kernel commit v6.6-rc1~117^2~7.
	(NT_RISCV_CSR, NT_RISCV_VECTOR): New constants introduced
	by Linux kernel commit v6.6-rc1~10^2~6^2.
	* NEWS: Mention this change.

2023-09-19  Dmitry V. Levin  <ldv@strace.io>

	xlat: update BPF_* constants.
	* src/xlat/bpf_attach_flags.in( BPF_F_BEFORE, BPF_F_AFTER, BPF_F_ID,
	BPF_F_LINK): New constants introduced by Linux kernel commit
	v6.6-rc1~162^2~371^2~2^2~7.
	* src/xlat/bpf_attach_type.in (BPF_TCX_INGRESS, BPF_TCX_EGRESS): New
	constants introduced by Linux kernel commit v6.6-rc1~162^2~371^2~2^2~6.
	(BPF_TRACE_UPROBE_MULTI): New constant introduced by Linux kernel
	commit v6.6-rc1~10^2~4^2~16^2~25.
	* src/xlat/ebpf_mode.in (BPF_MEMSX): New constant introduced
	by Linux kernel commit v6.6-rc1~162^2~233^2~17^2~16.
	* tests/bpf.c: Update expected output.
	* NEWS: Mention this change.

2023-09-18  Dmitry V. Levin  <ldv@strace.io>

	xlat: update SEGV_* constants.
	* src/xlat/sigsegv_codes.in (SEGV_CPERR): New constant
	introduced by Linux kernel commit v6.6-rc1~117^2~20.
	* tests/ptrace.c (main): Update expected output.
	* NEWS: Mention this change.

2023-09-17  Dmitry V. Levin  <ldv@strace.io>

	bundled: update linux UAPI headers to v6.6-rc2.
	* bundled/linux/include/uapi/linux/blkzoned.h: Update to
	headers_install'ed Linux kernel v6.6-rc2.
	* bundled/linux/include/uapi/linux/btrfs_tree.h: Likewise.
	* bundled/linux/include/uapi/linux/if_link.h: Likewise.
	* bundled/linux/include/uapi/linux/if_xdp.h: Likewise.
	* bundled/linux/include/uapi/linux/io_uring.h: Likewise.
	* bundled/linux/include/uapi/linux/kexec.h: Likewise.
	* bundled/linux/include/uapi/linux/mount.h: Likewise.
	* bundled/linux/include/uapi/linux/netfilter/nf_tables.h: Likewise.
	* bundled/linux/include/uapi/linux/perf_event.h: Likewise.
	* bundled/linux/include/uapi/linux/pkt_sched.h: Likewise.
	* bundled/linux/include/uapi/linux/quota.h: Likewise.
	* bundled/linux/include/uapi/linux/seccomp.h: Likewise.
	* bundled/linux/include/uapi/linux/userfaultfd.h: Likewise.
	* bundled/linux/include/uapi/linux/version.h: Likewise.
	* bundled/linux/include/uapi/linux/videodev2.h: Likewise.

2023-09-15  Dmitry V. Levin  <ldv@strace.io>

	.github: switch x32 runners from ubuntu-latest to ubuntu-20.04.
	Apparently, ubuntu-22.04 runners no longer support x32 executables,
	so downgrade these runners to ubuntu-20.04.  As ubuntu-20.04 does not
	provide gcc12, remove gcc12-x32-* runners.

	* .github/workflows/ci.yml (gcc13-x32-kheaders, gcc13-x32-nostacktrace,
	gcc11-x32-kheaders, gcc11-x32-nostacktrace): Replace ubuntu-latest with
	ubuntu-20.04.
	(gcc12-x32-kheaders, gcc12-x32-nostacktrace): Remove.

2023-09-14  Dmitry V. Levin  <ldv@strace.io>

	xlat: add fallback definition for BTRFS_EXTENT_REF_V0_KEY.
	* src/xlat/btrfs_key_types.in (#unconditional): Remove.
	(BTRFS_EXTENT_REF_V0_KEY): Provide fallback definition for the constant
	that was introduced by Linux kernel commit v2.6.31-rc1~315^2~22 and
	later removed by Linux kernel commit v6.6-rc1~207^2~16.

2023-09-13  Dmitry V. Levin  <ldv@strace.io>

	tests: introduce RVAL_E2BIG macro.
	* tests/tests.h (RVAL_E2BIG): New macro.
	* tests/ioctl_kvm_run_common.c: Use it.

2023-09-12  Dmitry V. Levin  <ldv@strace.io>

	tests: introduce RVAL_EOVERFLOW macro.
	* tests/tests.h (RVAL_EOVERFLOW): New macro.
	* tests/btrfs.c: Use it.
	* tests/file_handle.c: Likewise.

2023-09-11  Dmitry V. Levin  <ldv@strace.io>

	tests: introduce RVAL_ENOSYS macro.
	* tests/tests.h (RVAL_ENOSYS): New macro.
	* tests/futex.c: Use it.
	* tests/pause.c: Likewise.
	* tests/setresugid.c: Likewise.
	* tests/setreugid.c: Likewise.

2023-09-10  Dmitry V. Levin  <ldv@strace.io>

	tests: introduce RVAL_EAGAIN macro.
	* tests/tests.h (RVAL_EAGAIN): New macro.
	* tests/rt_sigtimedwait.c: Use it.

2023-09-09  Dmitry V. Levin  <ldv@strace.io>

	tests: introduce RVAL_ENOENT macro.
	* tests/tests.h (RVAL_ENOENT): New macro.
	* tests/attach-f-p.c: Use it.
	* tests/fork-f.c: Likewise.
	* tests/readlink.c: Likewise.
	* tests/readlinkat.c: Likewise.
	* tests/tests.h: Likewise.
	* tests/umovestr2.c: Likewise.
	* tests/vfork-f.c: Likewise.

2023-09-08  Dmitry V. Levin  <ldv@strace.io>

	tests: introduce RVAL_EFAULT macro.
	* tests/tests.h (RVAL_EFAULT): New macro.
	* tests/clock_nanosleep.c: Use it.
	* tests/getresugid.c: Likewise.
	* tests/ioctl_kvm_run_common.c: Likewise.
	* tests/ipc.c: Likewise.
	* tests/poll.c: Likewise.
	* tests/pread64-pwrite64.c: Likewise.
	* tests/read-write.c: Likewise.
	* tests/rt_sigpending.c: Likewise.
	* tests/rt_sigprocmask.c: Likewise.
	* tests/seccomp-filter-v.c: Likewise.
	* tests/sendfile.c: Likewise.
	* tests/sendfile64.c: Likewise.
	* tests/sigaction.c: Likewise.
	* tests/sigpending.c: Likewise.
	* tests/sysinfo.c: Likewise.
	* tests/times-fail.c: Likewise.

2023-09-07  Dmitry V. Levin  <ldv@strace.io>

	tests: introduce RVAL_EINVAL macro.
	* tests/tests.h (RVAL_EINVAL): New macro.
	* tests/clock_nanosleep.c: Use it.
	* tests/file_handle.c: Likewise.
	* tests/getrandom.c: Likewise.
	* tests/pread64-pwrite64.c: Likewise.
	* tests/preadv.c: Likewise.
	* tests/rt_sigpending.c: Likewise.
	* tests/rt_sigprocmask.c: Likewise.
	* tests/rt_sigsuspend.c: Likewise.
	* tests/rt_sigtimedwait.c: Likewise.
	* tests/seccomp-filter-v.c: Likewise.
	* tests/sendfile.c: Likewise.
	* tests/sendfile64.c: Likewise.
	* tests/sigaction.c: Likewise.
	* tests/timer_xettime.c: Likewise.

2023-09-06  Dmitry V. Levin  <ldv@strace.io>

	tests: use RVAL_EBADF macro more consistently.
	* tests/ioctl_nbd.c (RVAL_EBADF): Move macro ...
	* tests/tests.h: ... here.
	* tests/btrfs.c: Use it.
	* tests/ioctl.c: Likewise.
	* tests/ioctl_block.c: Likewise.
	* tests/ioctl_dm.c: Likewise.
	* tests/ioctl_evdev.c: Likewise.
	* tests/ioctl_inotify.c: Likewise.
	* tests/ioctl_kd.c: Likewise.
	* tests/ioctl_loop.c: Likewise.
	* tests/ioctl_nsfs.c: Likewise.
	* tests/ioctl_perf.c: Likewise.
	* tests/ioctl_scsi.c: Likewise.
	* tests/ioctl_seccomp.c: Likewise.
	* tests/ioctl_sg_io_v3.c: Likewise.
	* tests/ioctl_sg_io_v4.c: Likewise.
	* tests/ioctl_v4l2.c: Likewise.
	* tests/mmap.c: Likewise.
	* tests/net-sockaddr.c: Likewise.
	* tests/sendfile.c: Likewise.
	* tests/sendfile64.c: Likewise.
	* tests/ioctl_random.c (RVAL_EBADF): Remove.
	* tests/ioctl_tee.c: Likewise.
	* tests/ioctl_watchdog.c: Likewise.

2023-09-05  Dmitry V. Levin  <ldv@strace.io>

	tests: cleanup use of errno2name()
	* tests/acct.c: Use sprintrc() instead of errno2name() and %m.
	* tests/copy_file_range.c: Likewise.
	* tests/epoll_create.c: Likewise.
	* tests/epoll_pwait.c: Likewise.
	* tests/epoll_wait.c: Likewise.
	* tests/execveat.c: Likewise.
	* tests/fchdir.c: Likewise.
	* tests/fdatasync.c: Likewise.
	* tests/file_handle.c: Likewise.
	* tests/flock.c: Likewise.
	* tests/fsync.c: Likewise.
	* tests/ftruncate.c: Likewise.
	* tests/ftruncate64.c: Likewise.
	* tests/get_mempolicy.c: Likewise.
	* tests/ioctl_uffdio.c: Likewise.
	* tests/ioperm.c: Likewise.
	* tests/iopl.c: Likewise.
	* tests/ipc.c: Likewise.
	* tests/kill.c: Likewise.
	* tests/link.c: Likewise.
	* tests/linkat.c: Likewise.
	* tests/llseek.c: Likewise.
	* tests/lseek.c: Likewise.
	* tests/migrate_pages.c: Likewise.
	* tests/mincore.c: Likewise.
	* tests/mknodat.c: Likewise.
	* tests/mlock2.c: Likewise.
	* tests/mmsg_name.c: Likewise.
	* tests/msg_control.c: Likewise.
	* tests/msg_name.c: Likewise.
	* tests/prctl-seccomp-strict.c: Likewise.
	* tests/preadv-pwritev.c: Likewise.
	* tests/preadv2-pwritev2.c: Likewise.
	* tests/pwritev.c: Likewise.
	* tests/readv.c: Likewise.
	* tests/rename.c: Likewise.
	* tests/renameat.c: Likewise.
	* tests/renameat2.c: Likewise.
	* tests/rmdir.c: Likewise.
	* tests/sched_xetparam.c: Likewise.
	* tests/seccomp-filter.c: Likewise.
	* tests/setdomainname.c: Likewise.
	* tests/shmxt.c: Likewise.
	* tests/shutdown.c: Likewise.
	* tests/socketcall.c: Likewise.
	* tests/splice.c: Likewise.
	* tests/swap.c: Likewise.
	* tests/symlinkat.c: Likewise.
	* tests/sync_file_range.c: Likewise.
	* tests/sync_file_range2.c: Likewise.
	* tests/tee.c: Likewise.
	* tests/timer_create.c: Likewise.
	* tests/truncate.c: Likewise.
	* tests/truncate64.c: Likewise.
	* tests/umode_t.c: Likewise.
	* tests/umount.c: Likewise.
	* tests/umovestr3.c: Likewise.
	* tests/unlink.c: Likewise.
	* tests/unlinkat.c: Likewise.
	* tests/waitpid.c: Likewise.

2023-09-04  Dmitry V. Levin  <ldv@strace.io>

	msghdr: print cmsg_data for unknown cmsg_type.
	* src/msghdr.c (print_cmsg_type_data): Make sure cmsg_data is always
	printed when cmsg_data length is non-zero.  If cmsg_type is unknown or
	there is no specific printer for the given cmsg_type and cmsg_data
	length, print the raw data.
	* tests/msg_control.c (print_fds, test_unknown_type,
	test_unknown_level): Check it.

	Resolves: https://github.com/strace/strace/issues/261

2023-09-03  Dmitry V. Levin  <ldv@strace.io>

	configure: use proper quoting of AC_LANG_PROGRAM arguments.
	AC_LANG_PROGRAM arguments that should be treated as literals
	must be quoted twice.

	* configure.ac: Use double quoting of AC_LANG_PROGRAM arguments
	in the check whether to use bundled linux kernel headers.

2023-09-03  Dmitry V. Levin  <ldv@strace.io>

	configure: use AC_LANG_PROGRAM instead of AC_LANG_SOURCE.
	Consistently use AC_LANG_PROGRAM for arguments passed to
	AC_COMPILE_IFELSE.

	* configure.ac: Replace AC_LANG_SOURCE with AC_LANG_PROGRAM.

2023-09-03  Dmitry V. Levin  <ldv@strace.io>

	configure: stop using AC_TRY_COMPILE.
	* configure.ac (AC_TRY_COMPILE): Replace with AC_COMPILE_IFELSE
	as suggested by autoupdate.

2023-09-03  Dmitry V. Levin  <ldv@strace.io>

	configure: stop using AC_PROG_CC_STDC.
	This macro became obsolete with GNU Autoconf 2.70.

	* configure.ac (AC_PROG_CC_STDC): Remove.

2023-09-02  Dmitry V. Levin  <ldv@strace.io>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 6.5-1.
	* strace.spec.in: Likewise.

2023-09-01  Dmitry V. Levin  <ldv@strace.io>

	Prepare for 6.5 release.
	* NEWS: Update for 6.5 release.

	Update copyright headers.
	Headers updated automatically using maint/update_copyright_years.sh
	script.

2023-09-01  Dmitry V. Levin  <ldv@strace.io>

	Fix preprocessor indentation.
	Indent the C preprocessor directives to reflect their nesting
	using the following script:

	$ cppi -l $(git grep -El '^[[:space:]]*#[[:space:]]*(if|ifdef|ifndef|elif|else|endif|define|pragma)[[:space:]]' src tests |grep -Ev '\.(sh|test)$') |while read f; do
		cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
	done

2023-08-31  Dmitry V. Levin  <ldv@strace.io>

	tests: avoid libc definition for time_t in direct syscalls.
	Following up the commit that stopped using of struct timespec and struct
	timeval as arguments of syscalls, avoid using time_t in initializations
	of kernel_old_timespec_t and kernel_old_timeval_t structures.

	* tests/aio.c (main): Do not use time_t in the initialization of tv_sec.
	* tests/aio_pgetevents.c (main): Likewise.
	* tests/clock_nanosleep.c (main): Likewise.
	* tests/futex.c (main): Likewise.
	* tests/futimesat.c (main): Likewise.
	* tests/nanosleep.c (main): Likewise.
	* tests/ppoll.c (main): Likewise.
	* tests/rt_sigtimedwait.c (main): Likewise.
	* tests/timer_xettime.c (main): Likewise.
	* tests/timerfd_xettime.c (main): Likewise.
	* tests/utimensat.c (main): Likewise.
	* tests/xettimeofday.c (main): Likewise.

2023-08-30  Dmitry V. Levin  <ldv@strace.io>

	tests: do not use struct timespec in clock_nanosleep syscall.
	* tests/mq_sendrecv.c (do_send, do_recv, main): Replace struct timespec
	with kernel_old_timespec_t in direct invocations of clock_nanosleep
	syscall.
	* tests/threads-execve.c (thread, main): Likewise.

	Complements: v6.4-41-g51cb6c52e394 "tests: do not use libc definitions
	for timespec/timeval in direct syscalls"

2023-08-30  Dmitry V. Levin  <ldv@strace.io>

	tests: do not use struct timeval in gettimeofday syscall arguments.
	* tests/delay.c: Include "kernel_timeval.h".
	(usecs_from_tv, check_delay, run): Replace struct timeval with
	kernel_old_timeval_t in direct invocations of gettimeofday syscall.

	Complements: v6.4-41-g51cb6c52e394 "tests: do not use libc definitions
	for timespec/timeval in direct syscalls"

2023-08-30  Dmitry V. Levin  <ldv@strace.io>

	Use the proper type for decoding the time syscall.
	Do not use time_t type provided by libc to decode the time syscall as
	the latter uses kernel_long_t which does not necessarily match the type
	provided by libc.

	* src/print_time.c (kernel_time_t): New type, defined to kernel_ulong_t.
	Use it instead of time_t.
	* tests/time.c (kernel_time_t): Likewise.
	(k_time): New function.
	(main): Use it.

2023-08-30  Alexander Kanavin  <alex@linutronix.de>

	tests/clock_nanosleep.c: avoid use of CLOCK_ABSTIME on systems with 32 bit time_t.
	This does break (syscall returning -EINVAL) if system date is set to post-2038.

	Resolves: https://github.com/strace/strace/pull/265

2023-08-30  Alexander Kanavin  <alex@linutronix.de>

	tests/time.c: print syscall return values as unsigned decimal.
	strace prints them that way, and so the test has to follow,
	even if the actual time_t is signed.

	Resolves: https://github.com/strace/strace/pull/264

2023-08-30  Alexander Kanavin  <alex@linutronix.de>

	tests: do not use libc definitions for timespec/timeval in direct syscalls
	libc does not guarantee that they match syscall structures,
	and indeed, they don't if components are built against glibc
	with -D_TIME_BITS=64 on 32 bit platforms (to avoid collapse
	in 2038).

	* tests/tests.h: Include "kernel_old_timespec.h".
	(struct timespec): Remove forward declaration.
	(recv_mmsg): Replace struct timespec with kernel_old_timespec_t.
	* tests/aio.c (main): Replace struct timespec with kernel_old_timespec_t.
	* tests/aio_pgetevents.c (main): Likewise.
	* tests/clock_nanosleep.c (main): Likewise.
	* tests/futex.c (main): Likewise.
	* tests/libmmsg.c (recv_mmsg): Likewise.
	* tests/mmsg-silent.c (main): Likewise.
	* tests/ppoll.c (main): Likewise.
	* tests/recvmmsg-timeout.c (main): Likewise.
	* tests/rt_sigtimedwait.c (k_sigtimedwait, iterate, main): Likewise.
	* tests/sched_rr_get_interval.c (main): Likewise.
	* tests/utimensat.c (print_ts): Likewise.
	* tests/futimesat.c: Include "kernel_timeval.h".
	(print_tv, main): Replace struct timeval with kernel_old_timeval_t.
	* tests/utimes.c: Include "kernel_timeval.h".
	(TEST_STRUCT): Replace struct timeval with kernel_old_timeval_t.
	* tests/xettimeofday.c: Include "kernel_timeval.h".
	(main): Replace struct timeval with kernel_old_timeval_t.
	* tests/xselect.c: Likewise.

	Resolves: https://github.com/strace/strace/issues/250
	Resolves: https://github.com/strace/strace/pull/263

2023-08-29  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v6.5.
	* src/linux/32/ioctls_inc_align16.h: Update from linux v6.5 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/s390/ioctls_arch0.h: Likewise.
	* src/linux/s390x/ioctls_arch0.h: Likewise.
	* NEWS: Mention this.

	maint: Add support for *_IOCTL wrappers, such as ARMADA_IOCTL and UVIO_IOCTL
	* maint/ioctls_sym.sh (r_io): Add ([A-Z]+)?_S?IOCTL.

2023-08-29  Dmitry V. Levin  <ldv@strace.io>

	xlat: update NT_* constants.
	* src/xlat/nt_descriptor_types.in (NT_RISCV_VECTOR): Remove constant
	introduced by Linux kernel commit v6.5-rc1~120^2~17^2~15 and removed
	by Linux kernel commit commit v6.5~8^2~1^2~1.

2023-08-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/sched_xetaffinity: do not assume that cpuset_size is big enough.
	Commit v5.15~160 ("tests/sched_xetaffinity: add a check
	for a non-properly-sized CPU set") added a check that implicitly assumed
	that cpuset_size is at least 8, which is not the case on 32-bit userspace
	with less than 33 CPUs, and that has led to skipping the test altogether
	on such systems due to syscall returning EFAULT.  Fix it by allocating
	a separate set of the expected size and perform the check on it.

	* tests/sched_xetaffinity.c (main): Add crop_size constant, set to 8;
	add crop_cpuset variable;  use them instead of cpuset_size and cpuset,
	respectively, in the non-properly-sized CPU set check.

	Fixes: v5.15~160 "tests/sched_xetaffinity: add a check for a non-properly-sized CPU set"
	Reported-by: Sven Schnelle <svens@linux.ibm.com>

2023-08-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	ptp: provide additional information about max_phase_adj.
	Since we know that it is in nanosecond, we can provide a comment to make
	it more human-readable.

	* src/ptp.c (ptp_ioctl): Use PRINT_FIELD_TICKS_D instead
	of PRINT_FIELD_D for max_phase_adj field printing.
	* tests/ioctl_ptp.c: Update expected output.

2023-08-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	util: add print_ticks_d and PRINT_FIELD_TICKS{,_D}
	print_ticks_d is similar to print_ticks, but handles signed numbers.

	* src/defs.h (print_ticks_d): New declaration.
	* src/util.c (print_ticks_d): New function.
	* src/print_fields.h (PRINT_FIELD_TICKS, PRINT_FIELD_TICKS_D): New
	macros, wrappers for print_ticks and print_ticks_d, respectivaly.

2023-08-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.spec: try to comply with the new Fedora package license policy.
	New Fedora policies[1][2] require the usage of the SPDX identifiers
	with pretty specific syntax[3], and [4] requires refraining from any
	"license analysis" and listing all the licenses verbatim (which is especially
	fun with all the bundled sources), so here we are.  The %changelog entry
	mention is added per [5].

	[1] https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_2
	[2] https://docs.fedoraproject.org/en-US/legal/update-existing-packages/
	[3] https://docs.fedoraproject.org/en-US/legal/license-field/#_conjunctive_and_licensing
	[4] https://docs.fedoraproject.org/en-US/legal/license-field/#_no_effective_license_analysis
	[5] https://docs.fedoraproject.org/en-US/legal/update-existing-packages/#_changelog_entry

	* strace.spec.in [0%{?fedora} >= 35 || 0%{?centos} >= 9 || 0%{?rhel} >= 9]
	(License): Update the license expression and add an appropriate comment.
	(%changelog): Mention it.

2023-08-10  Dmitry V. Levin  <ldv@strace.io>

	strace.spec.in: configure using --enable-bundled=yes.
	* strace.spec.in (%build): Pass --enable-bundled=yes to %configure
	so that package builds wouldn't break unexpectedly when unreleased
	kernel headers are installed into the build environment.

2023-08-09  Dmitry V. Levin  <ldv@strace.io>

	xlat: remove BPF_F_PATH_FD from bpf_map_flags.
	BPF_F_PATH_FD is applicable to BPF_OBJ_PIN and BPF_OBJ_GET commands
	only, and therefore should be listed in bpf_file_flags only.

	This reverts commit c16832d01c09e8c249082a7fb04fc9f06fc9d00d.

	* src/xlat/bpf_map_flags.in (BPF_F_PATH_FD): Remove.
	* tests/bpf.c: Update expected output.

2023-08-08  Dmitry V. Levin  <ldv@strace.io>

	bpf: update decoding of BPF_OBJ_PIN and BPF_OBJ_GET commands.
	* src/print_fields.h (PRINT_FIELD_DIRFD): New macro.
	* src/xlat/bpf_file_flags.in: New file.
	* src/bpf_attr.h (BPF_OBJ_PIN_struct): Add path_fd field introduced
	by Linux commit v6.5-rc1~163^2~215^2~9.
	(BPF_OBJ_PIN_struct_size, expected_BPF_OBJ_PIN_struct_size): Update.
	* src/bpf.c: Include "xlat/bpf_file_flags.h".
	(BEGIN_BPF_CMD_DECODER(BPF_OBJ_PIN)): Decode path_fd.
	* tests/bpf.c: Include "xmalloc.h".
	(at_fdcwd_str): New variable.
	(main): Initialize it.
	(init_BPF_OBJ_PIN_str): New function.
	(BPF_OBJ_PIN_checks): Check path_fd decoding.
	* tests/bpf-success-long-y.c (YFLAG): Define.
	* NEWS: Mention this.

2023-08-07  Dmitry V. Levin  <ldv@strace.io>

	bpf: implement decoding of BPF_PROG_BIND_MAP command.
	* src/bpf_attr.h (BPF_PROG_BIND_MAP_struct): New structure introduced
	by Linux commit v5.10-rc1~107^2~169^2~20^2~3.
	(BPF_PROG_BIND_MAP_struct_size, expected_BPF_PROG_BIND_MAP_struct_size):
	New macros.
	* src/bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_BIND_MAP)): New function.
	(SYS_FUNC(bpf)) <bpf_cmd_decoders[]>: Use it.
	* NEWS: Mention this.
	* tests/bpf.c (union bpf_attr_data): Add
	BPF_ATTR_DATA_FIELD(BPF_PROG_BIND_MAP).
	(BPF_PROG_BIND_MAP_checks): New checks array.
	(main) <checks>: Add CHK(BPF_PROG_BIND_MAP).

2023-08-06  Dmitry V. Levin  <ldv@strace.io>

	bpf: implement decoding of BPF_LINK_DETACH command.
	* src/bpf_attr.h (BPF_LINK_DETACH_struct): New structure introduced
	by Linux commit v5.9-rc1~133^2~23^2~6^2~4.
	(BPF_LINK_DETACH_struct_size, expected_BPF_LINK_DETACH_struct_size):
	New macros.
	* src/bpf.c (BEGIN_BPF_CMD_DECODER(BPF_LINK_DETACH)): New function.
	(SYS_FUNC(bpf)) <bpf_cmd_decoders[]>: Use it.
	* NEWS: Mention this.
	* tests/bpf.c (union bpf_attr_data): Add
	BPF_ATTR_DATA_FIELD(BPF_LINK_DETACH).
	(BPF_LINK_DETACH_checks): New checks array.
	(main) <checks>: Add CHK(BPF_LINK_DETACH).

2023-08-03  Dmitry V. Levin  <ldv@strace.io>

	bpf: implement decoding of BPF_ITER_CREATE command.
	* src/bpf_attr.h (BPF_ITER_CREATE_struct): New structure introduced
	by Linux commit v5.8-rc1~165^2~185^2~16^2~15.
	(BPF_ITER_CREATE_struct_size, expected_BPF_ITER_CREATE_struct_size):
	New macros.
	* src/bpf.c (BEGIN_BPF_CMD_DECODER(BPF_ITER_CREATE)): New function.
	(SYS_FUNC(bpf)) <bpf_cmd_decoders[]>: Use it.
	* NEWS: Mention this.
	* tests/bpf.c (union bpf_attr_data): Add
	BPF_ATTR_DATA_FIELD(BPF_ITER_CREATE).
	(BPF_ITER_CREATE_checks): New checks array.
	(main) <checks>: Add CHK(BPF_ITER_CREATE).

2023-08-02  Dmitry V. Levin  <ldv@strace.io>

	bpf: implement decoding of BPF_ENABLE_STATS command.
	* src/xlat/bpf_stats_type.in: New file.
	* src/bpf_attr.h (BPF_ENABLE_STATS_struct): New structure introduced
	by Linux commit v5.8-rc1~165^2~343^2~3^2~2.
	(BPF_ENABLE_STATS_struct_size, expected_BPF_ENABLE_STATS_struct_size):
	New macros.
	* src/bpf.c: Include "xlat/bpf_stats_type.h".
	(BEGIN_BPF_CMD_DECODER(BPF_ENABLE_STATS)): New function.
	(SYS_FUNC(bpf)) <bpf_cmd_decoders[]>: Use it.
	* NEWS: Mention this.
	* tests/bpf.c (union bpf_attr_data): Add
	BPF_ATTR_DATA_FIELD(BPF_ENABLE_STATS).
	(BPF_ENABLE_STATS_checks): New checks array.
	(main) <checks>: Add CHK(BPF_ENABLE_STATS).

2023-08-01  Dmitry V. Levin  <ldv@strace.io>

	Implement decoding of fchmodat2 syscall.
	This new syscall is expected to be introduced in Linux kernel v6.6-rc1.

	* src/xlat/fchmodat_flags.in: New file.
	* src/chmod.c: Include <linux/fcntl.h> and "xlat/fchmodat_flags.h".
	(decode_fchmodat): New function.
	(SYS_FUNC(fchmodat)): Use it.
	(SYS_FUNC(fchmodat2)): New function.
	* src/pathtrace.c (pathtrace_match_set): Handle SEN_fchmodat2.
	* src/linux/generic/syscallent-common.h [BASE_NR + 452]: Wire up
	fchmodat2.
	* tests/fchmodat2.c: New file.
	* tests/pure_executables.list: Add fchmodat2.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (fchmodat2, fchmodat2--secontext,
	fchmodat2--secontext_full, fchmodat2--secontext_full_mismatch,
	fchmodat2--secontext_mismatch): New tests.
	* NEWS: Mention this change.

2023-07-31  Sven Schnelle  <svens@linux.ibm.com>

	tests/times: use libc times instead of raw syscall on s390.
	The libc implementation of times(2) has additional handling
	for error codes compared to the raw syscall. Therefore
	use the libc implementation on s390 like it is already done
	for MIPS.

2023-07-31  Dmitry V. Levin  <ldv@strace.io>

	Implement decoding of cachestat syscall.
	This new syscall was introduced by Linux kernel commit
	v6.5-rc1~176^2~364.

	* src/cachestat.c: New file.
	* src/cachestat.h: Likewise.
	* src/Makefile.am (libstrace_a_SOURCES): Add cachestat.c and
	cachestat.h.
	* src/linux/generic/syscallent-common.h [BASE_NR + 451]: Wire up
	cachestat.
	* tests/cachestat.c: New file.
	* tests/cachestat-P.c: Likewise.
	* tests/cachestat-fd.c: Likewise.
	* tests/cachestat-success.c: Likewise.
	* tests/pure_executables.list: Add cachestat, cachestat-P, cachestat-fd,
	and cachestat-success.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (cachestat, cachestat-P, cachestat-fd,
	cachestat-success): New tests.
	* NEWS: Mention this change.

2023-07-30  Dmitry V. Levin  <ldv@strace.io>

	xlat: update V4L2_* constants.
	* src/xlat/v4l2_control_ids.in (V4L2_CID_MPEG_VIDEO_AV1_PROFILE,
	V4L2_CID_MPEG_VIDEO_AV1_LEVEL): New constants introduced by Linux kernel
	commit v6.5-rc1~48^2~27.
	* src/xlat/v4l2_control_types.in (V4L2_CTRL_TYPE_AV1_SEQUENCE,
	V4L2_CTRL_TYPE_AV1_TILE_GROUP_ENTRY, V4L2_CTRL_TYPE_AV1_FRAME,
	V4L2_CTRL_TYPE_AV1_FILM_GRAIN): Likewise.
	* src/xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_AV1_FRAME): Likewise.
	(V4L2_PIX_FMT_NV15_4L4): New constant introduced by Linux kernel commit
	v6.5-rc1~48^2~23.
	* NEWS: Mention this change.

2023-07-29  Dmitry V. Levin  <ldv@strace.io>

