2024-03-20  Dmitry V. Levin  <ldv@strace.io>

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

2024-03-19  Dmitry V. Levin  <ldv@strace.io>

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

2024-03-19  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

2024-03-19  Dmitry V. Levin  <ldv@strace.io>

	tests: fix generated injection tests.
	All generated injection tests that need scno_tampering.sh should have
	their argument list start with --inject=.

	* tests/gen_tests.in (cachestat-success, listmount-success,
	lsm_get_self_attr-success, lsm_list_modules-success,
	statmount-success): Reorder arguments.

2024-03-19  Dmitry V. Levin  <ldv@strace.io>

	tests: skip dev-pty-yy test in old environments.
	As the feature being tested was introduced by Linux kernel commit
	v4.14-rc1~149^2~6, skip the test on older kernel versions.

	* tests/gen_tests.in (dev-pty-yy): Use
	require_min_kernel_version_or_skip.

	Complements: v6.7-39-gab11ac30415a "Show the slave device for the fd opening /dev/ptmx when -yy is given"

2024-03-19  Dmitry V. Levin  <ldv@strace.io>

	tests: check decoding of lsm_list_modules syscall.
	* tests/lsm_list_modules.c: New file.
	* tests/lsm_list_modules-success.c: Likewise.
	* tests/pure_executables.list: Add lsm_list_modules and
	lsm_list_modules-success.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (lsm_list_modules, lsm_list_modules-success):
	New tests.

	tests: check decoding of lsm_set_self_attr syscall.
	* tests/lsm_set_self_attr.c: New file.
	* tests/pure_executables.list: Add lsm_set_self_attr.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (lsm_set_self_attr): New test.

	tests: check decoding of lsm_get_self_attr syscall.
	* tests/lsm_get_self_attr.c: New file.
	* tests/lsm_get_self_attr-success.c: Likewise.
	* tests/pure_executables.list: Add lsm_get_self_attr and
	lsm_get_self_attr-success.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (lsm_get_self_attr, lsm_get_self_attr-success):
	New tests.

2024-03-19  Dmitry V. Levin  <ldv@strace.io>

	Implement decoding of lsm_list_modules syscall.
	This new syscall was introduced by Linux kernel commit v6.8-rc1~176.

	* src/linux/generic/syscallent-common.h [BASE_NR + 461]: Wire up
	lsm_list_modules.
	* src/lsm.c (SYS_FUNC(lsm_list_modules)): New function.
	* NEWS: Mention this change.

2024-03-19  Dmitry V. Levin  <ldv@strace.io>

	Implement decoding of lsm_set_self_attr syscall.
	This new syscall was introduced by Linux kernel commit v6.8-rc1~176.

	* src/linux/generic/syscallent-common.h [BASE_NR + 460]: Wire up
	lsm_set_self_attr.
	* src/lsm.c (SYS_FUNC(lsm_set_self_attr)): New function.
	* NEWS: Mention this change.

2024-03-19  Dmitry V. Levin  <ldv@strace.io>

	Implement decoding of lsm_get_self_attr syscall.
	This new syscall was introduced by Linux kernel commit v6.8-rc1~176.

	* src/linux/generic/syscallent-common.h [BASE_NR + 459]: Wire up
	lsm_get_self_attr.
	* src/Makefile.am (libstrace_a_SOURCES): Add lsm.c
	* src/defs.h (tfetch_obj_ignore_syserror): New macro.
	* src/lsm.c: New file.
	* src/xlat/lsm_attrs.in: Likewise.
	* src/xlat/lsm_flags.in: Likewise.
	* src/xlat/lsm_ids.in: Likewise.
	* NEWS: Mention this change.

2024-03-19  Dmitry V. Levin  <ldv@strace.io>

	bundled: add linux/lsm.h.
	* bundled/linux/include/uapi/linux/lsm.h: New file.
	* bundled/Makefile.am (EXTRA_DIST): Add
	linux/include/uapi/linux/lsm.h.

2024-03-17  Dmitry V. Levin  <ldv@strace.io>

	bundled: update linux UAPI headers to v6.8.
	Bundle linux/stddef.h and update dependent header files.

	* bundled/linux/include/uapi/linux/stddef.h: New file.
	* bundled/linux/include/uapi/linux/in.h: Update to
	headers_install'ed Linux kernel v6.8.
	* bundled/linux/include/uapi/linux/io_uring.h: Likewise.
	* bundled/Makefile.am (EXTRA_DIST): Add
	linux/include/uapi/linux/stddef.h.

2024-03-14  Dmitry V. Levin  <ldv@strace.io>

	printpidfd: add pidfs support.
	Linux kernel commit v6.8-rc1-17-gcb12fd8e0dab moves pidfd from the
	anonymous inode infrastructure to a new pidfs pseudo filesystem.

	* src/util.c (printpidfd): Handle new format of kernel provided
	information associated with pidfd descriptors.
	* tests/pidfd_getfd-y.c (PIDFD_PATH): Remove.
	(PRINT_PIDFD_PATH): Define.
	* tests/pidfd_getfd-yy.c (PRINT_PIDFD): Rename to PRINT_PIDFD_PID.
	* tests/pidfd_getfd.c: Include "xmalloc.h".
	(PIDFD_PATH): Remove.
	(PRINT_PIDFD): Rename to PRINT_PIDFD_PID.
	(PRINT_PIDFD_PATH): Provide fallback definition.
	(main) [PRINT_PIDFD_PATH]: Use get_fd_path() instead of hardcoding
	<anon_inode:[pidfd]>.
	* tests/pidfd_open.c (main): Use get_fd_path() instead of hardcoding
	<anon_inode:[pidfd]>.
	* tests/scm_pidfd.c (print_pidfd): Likewise.
	* tests/so_peerpidfd.c (print_pidfd): Likewise.

2024-03-13  Dmitry V. Levin  <ldv@strace.io>

	Rename --stack-traces to --stack-trace for consistency.
	Do not use plural in option names, but retain old option name
	for backwards compatibility.

	* NEWS: Mention this.
	* doc/strace.1.in: Rename --stack-traces to --stack-trace.
	* src/strace.c: Likewise. Retain old option for backwards compatibility.
	* src/strauss.c: Likewise.
	* tests/options-syntax.test: Likewise.
	* tests/strace-k.test: Likewise.
	* tests/strace-k-with-depth-limit.test: Likewise.
	* tests/strace-kk.test: Likewise.
	* tests/strace-kk-p.test: Likewise.

2024-03-13  Masatake YAMATO  <yamato@redhat.com>

	Show the slave device for the fd opening /dev/ptmx when -yy is given.
	An example output:

	     read(32</dev/ptmx<char 5:2 @/dev/pts/7>>, "\0\"\\0", 4) = 4

	* src/defs.h (struct finfo::tty_index): New member.
	(get_finfo_for_dev): Add two parameters.
	* src/ioctl.c (SYS_FUNC(ioctl)): Pass pid and fd to get_finfo_for_dev().
	* src/utils.c (is_ptmx, set_tty_index): New functions.
	(get_finfo_for_dev): Read the tty-index field in /proc/$pid/fdinfo/$fd
	and store the value to struct finfo::tty_index.
	(printenv): Pass pid and fd to get_finfo_for_dev(). Print the slave
	device for the fd opening /dev/ptmx as the counter endpoint.
	* tests/dev-pty-yy.c: New file.
	* tests/gen_tests.in (dev-pty-yy): New test.
	* tests/pure_executables.list: Add dev-pty-yy.
	* tests/.gitignore: Likewise.

2024-03-13  Dmitry V. Levin  <ldv@strace.io>

	util: rearrange some code.
	* src/util.c (scan_fdinfo_fn, scan_fdinfo): Move before
	get_finfo_for_dev() to facilitate the followup change.

2024-03-11  Dmitry V. Levin  <ldv@strace.io>

	tests: extend the test of TCP_AO_ADD_KEY decoding.
	* tests/tcp_ao.c: Check more corner cases of the TCP_AO_ADD_KEY decoder.

2024-03-10  наб  <nabijaczleweli@nabijaczleweli.xyz>

	Implement decoding of setsockopt(TCP_AO_ADD_KEY)
	Samples as run via tcp-ao-wrapper:
	  setsockopt(3, SOL_TCP, TCP_AO_ADD_KEY, {addr={sa_family=AF_INET6, sin6_port=htons(0), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::", &sin6_addr), sin6_scope_id=0}, prefix=0, alg_name="hmac(sha1)", ifindex=0, set_current=0, set_rnext=0, sndid=200, rcvid=100, maclen=12, keyflags=0, key="\x42\xe9\xd2\xd3\xd1\xec\x9f\x55\x56\x9c\xd7\x89\x1a\x90\x53\xba\x59\x6d\x5f\x0a", keylen=20}, 288) = 0
	  setsockopt(3, SOL_TCP, TCP_AO_ADD_KEY, {addr={sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("127.0.0.1")}, prefix=32, alg_name="cmac(aes)", ifindex=0, set_current=0, set_rnext=0, sndid=200, rcvid=100, maclen=12, keyflags=0, key="\x7a\x66\x25\xc9\x80\xdb\x68\x95\xf5\xaf\x84\x1b\xd6\x50\x29\xe1", keylen=16}, 288) = -1 ENOPROTOOPT (Protocol not available)

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

	tests: check decoding of listmount syscall.
	* tests/listmount.c: New file.
	* tests/listmount-success.c: Likewise.
	* tests/pure_executables.list: Add listmount and listmount-success.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (listmount, listmount-success): New tests.

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

	Implement decoding of listmount syscall.
	This new syscall was introduced by Linux kernel commit v6.8-rc1~213.

	* src/linux/generic/syscallent-common.h [BASE_NR + 458]: Wire up
	listmount.
	* src/Makefile.am (libstrace_a_SOURCES): Add listmount.c.
	* src/listmount.c: New file.
	* src/xlat/listmount_mnt_id.in: Likewise.
	* NEWS: Mention this change.

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

	tests: check decoding of statmount syscall.
	* tests/statmount.c: New file.
	* tests/statmount-success.c: Likewise.
	* tests/pure_executables.list: Add statmount and statmount-success.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (statmount, statmount-success): New tests.

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

	Implement decoding of statmount syscall.
	This new syscall was introduced by Linux kernel commit v6.8-rc1~213.

	* src/defs.h (fsmagic, mount_attr_attr): New declarations.
	* src/linux/generic/syscallent-common.h [BASE_NR + 457]: Wire up
	statmount.
	* src/Makefile.am (libstrace_a_SOURCES): Add statmount.c.
	* src/statmount.c: New file.
	* src/xlat/statmount_mask.in: Likewise.
	* src/xlat/statmount_mnt_propagation.in: Likewise.
	* src/xlat/statmount_sb_flags.in: Likewise.
	* NEWS: Mention this change.

2024-03-09  Masatake YAMATO  <yamato@redhat.com>

	Make -p options accept multiple delimiters between PIDs.
	The original code accepts only one delimiter between PIDs.
	This change relaxes the condition.

	* src/strace.c (process_opt_p_list): Skip the consecutive
	delimiters.
	* tests/syntax.sh (check_zero): New helper function.
	* tests/options-syntax.test: Add code testing this change.

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

	xlat: update MOUNT_ATTR_* constants.
	Apparently, FSMOUNT_VALID_FLAGS defined in Linux kernel's fs/namespace.c
	includes MOUNT_ATTR_NOSYMFOLLOW as well.

	* src/xlat/fsmount_attr_flags.in (MOUNT_ATTR_NOSYMFOLLOW): New constant
	introduced by Linux kernel commit v5.14-rc1~139^2~1.
	* tests/fsmount.c (main): Update expected output.

	Complements: v5.14~59 "xlat: update MOUNT_ATTR_* constants"

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

	Enhance decoding of mount attributes related to access-time settings.
	Apparently, both fsmount and mount_setattr syscalls treat a subset of mount
	attributes not just as regular flags but rather as an enumeration expressed
	in the bits defined by the mask MOUNT_ATTR__ATIME.

	* src/xlat/fsmount_attr_flags.in (MOUNT_ATTR__ATIME): New constant
	introduced by Linux kernel commit v5.2-rc1~141^2~2.
	* src/xlat/mount_attr_attr.in: Likewise.
	* tests/fsmount.c (main): Check this.
	* tests/mount_setattr.c (main): Likewise.
	* NEWS: Mention this change.

2024-03-02  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

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

	maint: update for linux v6.8-rc6.
	* maint/ioctls_sym.sh: Update a workaround for binder.h.

2024-02-23  Ivan Avdeev  <me@provod.works>

	v4l2: add TIME32 variants for VIDIOC_*BUF ioctls.
	On 32-bit kernels and on 64-bit kernels with `CONFIG_COMPAT_32BIT_TIME`
	enabled many syscalls have 2 functional variants: with new 64-bit time
	fields and with legacy 32-bit time fields.

	This commit adds support for the following 32-bit time ioctls:
	- VIDIOC_QUERYBUF_TIME32
	- VIDIOC_QBUF_TIME32
	- VIDIOC_DQBUF_TIME32

	These correspond to using `struct v4l2_buffer_time32`, which differs from
	the regular `struct v4l2_buffer` by having 32-bit `struct old_timeval32`
	`timestamp` field.

	Unit tests for these new ioctls are also added. They are essentially
	just functionally identical copies of the regular ioctl tests.

2024-02-22  Dmitry V. Levin  <ldv@strace.io>

	tests: tighten strace -k expected regexps.
	* tests/strace-k.expected: Do not accept arbitrary function calls
	on top of the call stack.
	* tests/strace-k-p.expected: Likewise.
	* tests/strace-k-demangle.expected: Likewise.

	Fixes: v4.25~21 "tests: check stack unwinding for signals"

2024-02-22  Dmitry V. Levin  <ldv@strace.io>

	tests: fix typo in strace -k expected regexps.
	* tests/strace-k.expected: Replace __kernel_vsyscaln with
	__kernel_vsyscall.
	* tests/strace-k-p.expected: Likewise.

	Fixes: v4.25~21 "tests: check stack unwinding for signals"

2024-02-22  Dmitry V. Levin  <ldv@strace.io>

	Enhance --stack-trace-frame-limit error diagnostics.
	* src/strace.c (init): Issue a warning when --stack-trace-frame-limit
	is being used without -k/--stack-traces.
	* tests/options-syntax.test: Check it.

	tests: check --stack-trace-frame-limit error diagnostics.
	* tests/options-syntax.test: Check error diagnostics when
	--stack-trace-frame-limit is specified with an invalid argument.

2024-02-22  Masatake YAMATO  <yamato@redhat.com>

	tests: check strace -k --stack-trace-frame-limit.
	* tests/strace-k.test (KOPT_EXTRA): New parameter for this case
	template. Pass its value to `run_strace` function.
	(awk_script_common): Append "too many stack frames" to the output
	of the test case.
	* tests/Makefile.am (STACKTRACE_TESTS): Add
	strace-k-with-depth-limit.test.
	(check_SCRIPTS): Add strace-k-with-depth-limit.test.
	(check_DATA): Add strace-k-with-depth-limit.expected.
	* tests/strace-k-with-depth-limit.expected: New file.
	* tests/strace-k-with-depth-limit.test: New test.

2024-02-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.1: touch up the --stack-trace-frame-limit description wording.
	* doc/strace.1.in (.SS Output format) <--stack-trace-frame-limit>:
	Use singular when referring to the -k option.

	strace.1: fix formatting.
	* doc/strace.1.in (SYNOPSIS): Fix the syntax for the --syscall-limit
	option ("--syscall-limit=limit" and not "--syscall-limit limit").
	(.SS Output format) <-k>: Fix formatting for "--stack-traces[=symbol]".
	(.SS Output format) <-kk>: Fix formatting for "--stack-traces=source".
	(.SS Output format) <--stack-trace-frame-limit>: Fix formatting
	for "--stack-trace-frame-limit=limit", fix formatting for the closing
	parenthesis after the -k option mention.

2024-02-22  Ivan Trofimov  <i.trofimow@yandex.ru>

	Introduce a cli option to control backtrace frames limit.
	* src/defs.h (DEFAULT_STACK_TRACE_FRAME_LIMIT): New constant.
	(unwind_init): Add an int argument.
	* src/strace.c (init): Add --stack-trace-frame-limit=N option.
	(usage): Document it.
	* src/unwind.h (struct unwind_unwinder_t::init): Add an int argument.
	* src/unwind.c (unwind_init): Pass the limit argument to the unwinder
	initializer.
	* src/unwind-libdw.c (stack_trace_limit): New variable.
	(init): Initialize it.
	(tcb_walk): Use it at frame_user_data initialization.
	* src/unwind-libunwind.c (stack_trace_limit): New variable.
	(init): Initialize it.
	(walk): Account for it when printing stack frames.
	* doc/strace.1.in: Document this.
	* NEWS: Mention this.

2024-02-16  Masatake YAMATO  <yamato@redhat.com>

	unwind-libdw: decrement the depth before comparing with its limit.
	When using libdwn as unwinder, --stacktrace-frames-limit=N didn't work
	quite as expected: strace used to print N+1 frames.

	* src/unwind-libunwind.c (frame_callback): Decrement stack_depth
	before comparing it with its limit.

	Fixes: v4.23~349 "unwind: add libdw as an unwinder"

2024-02-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	defs: fix sign_extend_unsigned_to_ll for char-sized types.
	The original implementation assumed char being signed, which
	is not guaranteed by the C language standard and is not the case
	on some architectures (powerpc, s390x, aarch64, and some others).
	This mistake has been exposed by the introduction of UBI_IOCATT decoder,
	that for the first time introduced a test which printed a char-sized
	signed field without relying on the PRINT_FIELD_D macro (with two
	previous cases being field d_version in struct fs_disk_quota
	and field interval in struct tc_estimator).

	* src/defs.h (sign_extend_unsigned_to_ll): Cast v to signed char
	instead of char.
	* tests/tests.h (sign_extend_unsigned_to_ll): Likewise.

	Fixes: v4.14~39 "Enhance zero_extend_signed_to_ull and sign_extend_unsigned_to_ll macros"
	Complements: v4.14~37 "tests: check decoding of quotactl syscall
	Complements: v4.20~86 "tests: check decoding of tcmsg netlink attributes"
	Complements: v6.7-15-g263e78472 "ubi: update decoding of UBI_IOCATT ioctl command"

2024-02-11  Dmitry V. Levin  <ldv@strace.io>

	ubi: update decoding of UBI_IOCATT ioctl command.
	* src/ubi.c (decode_UBI_IOCATT): Decode disable_fm and need_resv_pool
	members of struct ubi_attach_req introduced by Linux kernel commits
	v6.1-rc1~13^2 and v6.7-rc1~57^2~3, respectively.
	* tests/ioctl_ubi.c (main): Check it.
	* NEWS: Mention this change.

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

	landlock: update decoding of landlock_add_rule syscall.
	* src/landlock.c (print_landlock_net_port_attr): New function.
	(SYS_FUNC(landlock_add_rule)): Use it to decode LANDLOCK_RULE_NET_PORT
	introduced by Linux kernel commit v6.7-rc1~82^2~5.
	* tests/landlock_add_rule.c (main): Check it.
	* NEWS: Mention this change.

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

	landlock: update decoding of landlock_create_ruleset syscall.
	* src/xlat/landlock_ruleset_access_net.in: New file.
	* src/landlock.c: Include "xlat/landlock_ruleset_access_net.h".
	(print_landlock_ruleset_attr): Decode handled_access_net member
	of struct landlock_ruleset_attr introduced by Linux kernel commit
	v6.7-rc1~82^2~5.
	* tests/landlock_create_ruleset.c (main): Check it.
	* NEWS: Mention this change.

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

	netlink_smc_diag: update decoding of SMC_DIAG_DMBINFO netlink attribute.
	* src/netlink_smc_diag.c (decode_smc_diag_dmbinfo): Decode peer_gid_ext
	and my_gid_ext members of struct smcd_diag_dmbinfo introduced by Linux
	kernel commit v6.8-rc1~131^2~91^2~2.
	* tests/nlattr_smc_diag_msg.c (main): Check it.
	* NEWS: Mention this change.

2024-02-07  Dmitry V. Levin  <ldv@strace.io>

	xlat: update V4L2_* constants.
	* src/xlat/v4l2_control_id_bases.in (V4L2_CID_USER_NPCM_BASE): New
	constant introduced by Linux kernel commit v6.7-rc1~51^2~234.
	(V4L2_CID_USER_THP7312_BASE): New constant introduced by Linux kernel
	commit v6.8-rc1~99^2~167.
	* src/xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_HEXTILE): New constant
	introduced by Linux kernel commit v6.7-rc1~51^2~235.
	* NEWS: Mention this change.

2024-02-06  Dmitry V. Levin  <ldv@strace.io>

	xlat: update UFFD_* constants.
	* src/xlat/uffd_api_features.in (UFFD_FEATURE_WP_ASYNC): New constant
	introduced by Linux kernel commit v6.7-rc1~90^2~207.
	(UFFD_FEATURE_MOVE): New constant introduced by Linux kernel commit
	v6.8-rc1~180^2~163.
	* src/xlat/uffd_register_ioctl_flags.in (1<<_UFFDIO_MOVE): Likewise.
	* NEWS: Mention this change.

2024-02-05  Dmitry V. Levin  <ldv@strace.io>

	xlat: update STATX_* constants.
	* src/xlat/statx_masks.in (STATX_MNT_ID_UNIQUE): New constant
	introduced by Linux kernel commit v6.8-rc1~213^2~9.
	* tests/xstatx.c (main): Update expected output.
	* NEWS: Mention this change.

2024-02-04  Dmitry V. Levin  <ldv@strace.io>

	xlat: update SOL_* constants.
	* src/xlat/socketlayers.in (SOL_MPTCP): New constant introduced
	by Linux kernel commit v5.16-rc1~159^2~413^2~3.
	(SOL_MCTP): New constant introduced by Linux kernel commit
	v5.16-rc1~159^2~76.
	(SOL_SMC): New constant introduced by Linux kernel commit
	v5.18-rc1~136^2~378^2~1.
	(SOL_VSOCK): New constant introduced by Linux kernel commit
	v6.7-rc1~122^2~145^2~10.
	* NEWS: Mention this change.

2024-02-03  Dmitry V. Levin  <ldv@strace.io>

	xlat: update PERF_* constants.
	* src/xlat/perf_branch_sample_type.in (PERF_SAMPLE_BRANCH_COUNTERS):
	New constant introduced by Linux kernel commit v6.8-rc1~184^2~19.
	* tests/perf_event_open.c (BRANCH_TYPE_ALL, main): Update expected
	output.
	* NEWS: Mention this change.

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

	xlat: update KVM_* constants.
	* src/xlat/kvm_cap.in (KVM_CAP_USER_MEMORY2): New constant introduced
	by Linux kernel commit v6.8-rc1~78^2~24^2~26.
	(KVM_CAP_MEMORY_FAULT_INFO): New constant introduced by Linux kernel
	commit v6.8-rc1~78^2~24^2~25.
	(KVM_CAP_MEMORY_ATTRIBUTES): New constant introduced by Linux kernel
	commit v6.8-rc1~78^2~24^2~22.
	(KVM_CAP_GUEST_MEMFD): New constant introduced by Linux kernel commit
	v6.8-rc1~78^2~24^2~19.
	(KVM_CAP_VM_TYPES): New constant introduced by Linux kernel commit
	v6.8-rc1~78^2~24^2~13.
	* src/xlat/kvm_exit_reason.in (KVM_EXIT_MEMORY_FAULT): New constant
	introduced by Linux kernel commit v6.8-rc1~78^2~24^2~25.
	* src/xlat/kvm_mem_flags.in (KVM_MEM_GUEST_MEMFD): New constant
	introduced by Linux kernel commit v6.8-rc1~78^2~24^2~19.
	* NEWS: Mention this change.

2024-02-01  Dmitry V. Levin  <ldv@strace.io>

	xlat: update KEXEC_* constants.
	* src/xlat/kexec_load_flags.in (KEXEC_FILE_DEBUG):
	New constant introduced by Linux kernel commit v6.8-rc1~179^2~50.
	* tests/kexec_file_load.c (main): Update expected output.
	* NEWS: Mention this change.

2024-01-31  Dmitry V. Levin  <ldv@strace.io>

	xlat: update BPF_* constants.
	* src/xlat/bpf_prog_flags.in (BPF_F_XDP_HAS_FRAGS): New constant
	introduced by Linux kernel commit v5.18-rc1~136^2~544^2~3^2~14.
	(BPF_F_XDP_DEV_BOUND_ONLY): New constant introduced by Linux kernel
	commit v6.3-rc1~162^2~189^2~15^2~12.
	(BPF_F_TEST_REG_INVARIANTS): New constant introduced by Linux kernel
	commit v6.8-rc1~131^2~289^2~4.
	* tests/bpf.c (print_BPF_PROG_LOAD_attr3, print_BPF_PROG_LOAD_attr4,
	BPF_PROG_LOAD_checks): Update expected output.
	* NEWS: Mention this change.

2024-01-30  Dmitry V. Levin  <ldv@strace.io>

	bundled: update linux UAPI headers to v6.8-rc2.
	* bundled/linux/include/uapi/linux/btrfs.h: Update to
	headers_install'ed Linux kernel v6.8-rc2.
	* bundled/linux/include/uapi/linux/fs.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/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/mptcp.h: Likewise.
	* bundled/linux/include/uapi/linux/mptcp_pm.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/smc_diag.h: Likewise.
	* bundled/linux/include/uapi/linux/stat.h: Likewise.
	* bundled/linux/include/uapi/linux/userfaultfd.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.

	tests: remove redundant semicolons.
	* tests/ioctl_counter.c (main): Remove redundant semicolon.
	* tests/ioctl_kd.c (main): Likewise.

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

2024-01-29  Dmitry V. Levin  <ldv@strace.io>

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

	Update .mailmap.
	* .mailmap: Add both email addresses of Josh Triplett to avoid
	duplication in CREDITS file.

2024-01-29  Dmitry V. Levin  <ldv@strace.io>

	tests: update UFFDIO ioctl test.
	Starting with Linux kernel commit v6.6-rc1~53^2~422, UFFDIO_POISON
	feature can be enabled by the kernel.

	* tests/ioctl_uffdio.c (main): Recognize and print 1<<_UFFDIO_POISON
	when returned by UFFDIO_REGISTER_MODE_MISSING.

2024-01-29  Jan Macku  <jamacku@redhat.com>

	ci: update GitHub Actions to latest versions.
	actions/upload-artifact - @v2 -> @v3
	redhat-plumbers-in-action/differential-shellcheck - @v4 -> @v5

	ci: enable dependency manager for GitHub Actions.

2024-01-28  Dmitry V. Levin  <ldv@strace.io>

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

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

2024-01-28  Dmitry V. Levin  <ldv@strace.io>

	.github: switch from actions/checkout@v3 to actions/checkout@v4.
	This fixes the following diagnostic warning:

	  Node.js 16 actions are deprecated.
	  Please update the following actions to use Node.js 20: actions/checkout@v3
	  For more information see:
	  https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

	* .github/workflows/ci.yml: Replace actions/checkout@v3 with
	actions/checkout@v4.
	* .github/workflows/differential-shellcheck.yml: Likewise.

2024-01-28  Sahil Siddiq  <icegambit91@gmail.com>

	init: remove redundant clause in condition.
	output_separately is redundant in the third expression as it's
	already evaluated in the second expression.

	* src/strace.c (init): Remove redundancy in condition.

	Complements: v5.6~169 "strace: add a long option aliases for -f and -ff"

2024-01-28  Dmitry V. Levin  <ldv@strace.io>

	tests: check decoding of futex_requeue syscall.
	* tests/futex_requeue.c: New file.
	* tests/futex_requeue-Xabbrev.c: Likewise.
	* tests/futex_requeue-Xraw.c: Likewise.
	* tests/futex_requeue-Xverbose.c: Likewise.
	* tests/pure_executables.list: Add futex_requeue, futex_requeue-Xabbrev,
	futex_requeue-Xraw, and futex_requeue-Xverbose.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (futex_requeue, futex_requeue-Xabbrev,
	futex_requeue-Xraw, futex_requeue-Xverbose): New tests.

2024-01-27  Dmitry V. Levin  <ldv@strace.io>

	futex_waitv: print futex flags as FUTEX2_* flags.
	Starting with Linux kernel commit v6.7-rc1~193^2~28, futex_waitv syscall
	takes FUTEX2_* flags, which is a superset of FUTEX_* flags.

	* src/futex2.c: Stop including "xlat/futex_waiter_flags.h".
	(print_waiter): Print flags using print_futex2_flags.
	* src/xlat/futex_waiter_flags.in: Remove.
	* tests/futex_waitv.c (main): Update expected output.

2024-01-26  Dmitry V. Levin  <ldv@strace.io>

	Implement decoding of futex_requeue syscall.
	This new syscall was introduced by Linux kernel commit
	v6.7-rc1~193^2~19.

	* src/futex2.c (SYS_FUNC(futex_requeue)): New function.
	* src/linux/generic/syscallent-common.h [BASE_NR + 456]: Wire up
	futex_requeue.
	* NEWS: Mention this change.

2024-01-25  Dmitry V. Levin  <ldv@strace.io>

	tests: check decoding of futex_wait syscall.
	* tests/futex_wait.c: New file.
	* tests/futex_wait-Xabbrev.c: Likewise.
	* tests/futex_wait-Xraw.c: Likewise.
	* tests/futex_wait-Xverbose.c: Likewise.
	* tests/pure_executables.list: Add futex_wait, futex_wait-Xabbrev,
	futex_wait-Xraw, and futex_wait-Xverbose.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (futex_wait, futex_wait-Xabbrev, futex_wait-Xraw,
	futex_wait-Xverbose): New tests.

2024-01-24  Dmitry V. Levin  <ldv@strace.io>

	Implement decoding of futex_wait syscall.
	This new syscall was introduced by Linux kernel commit
	v6.7-rc1~193^2~22.

	* src/futex2.c (SYS_FUNC(futex_wait)): New function.
	* src/linux/generic/syscallent-common.h [BASE_NR + 455]: Wire up
	futex_wait.
	* NEWS: Mention this change.

2024-01-23  Dmitry V. Levin  <ldv@strace.io>

	tests: check decoding of futex_wake syscall.
	* tests/futex_wake.c: New file.
	* tests/futex_wake-Xabbrev.c: Likewise.
	* tests/futex_wake-Xraw.c: Likewise.
	* tests/futex_wake-Xverbose.c: Likewise.
	* tests/futex2_flags.h: New file.
	* tests/Makefile.am (libtests_a_SOURCES): Add futex2_flags.h.
	* tests/pure_executables.list: Add futex_wake, futex_wake-Xabbrev,
	futex_wake-Xraw, and futex_wake-Xverbose.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (futex_wake, futex_wake-Xabbrev, futex_wake-Xraw,
	futex_wake-Xverbose): New tests.

2024-01-22  Dmitry V. Levin  <ldv@strace.io>

	Implement decoding of futex_wake syscall.
	This new syscall was introduced by Linux kernel commit
	v6.7-rc1~193^2~24.

	* src/xlat/futex2_flags.in: New file.
	* src/xlat/futex2_sizes.in: Likewise.
	* src/futex2.c: Include "xlat/futex2_sizes.h" and "xlat/futex2_flags.h".
	(print_futex2_flags, SYS_FUNC(futex_wake)): New functions.
	* src/defs.h (futexbitset): New declaration.
	* src/linux/generic/syscallent-common.h [BASE_NR + 454]: Wire up
	futex_wake.
	* NEWS: Mention this change.

2024-01-21  Dmitry V. Levin  <ldv@strace.io>

	src: rename futex_waitv.c to futex2.c.
	As futex_waitv syscall became a futex2 family syscall, and
	print_waiter_array() is going to be needed to implement decoding of
	futex_requeue syscall from futex2 family, let's rename futex_waitv.c
	to futex2.c and later add decoders of futex2 family syscalls there.

	* src/futex_waitv.c: Rename to futex2.c.
	* src/Makefile.am (libstrace_a_SOURCES): Rename futex_waitv.c
	to futex2.c.

2024-01-21  Dmitry V. Levin  <ldv@strace.io>

	defs.h: keep the list of public xlat tables sorted.
	* src/defs.h: Sort "extern const struct xlat" declarations.

2024-01-20  Jean-Baptiste Skutnik  <jb.skutnik@gmail.com>

	xlat: add Lustre fs magic.
	* src/xlat/fsmagic.in (LL_SUPER_MAGIC): New constant introduced
	by Lustre commit 191061ee668400324f4505cf498f1ee2d57e4962 back in 2004.
	(LUSTRE_SUPER_MAGIC): New constant introduced by Lustre commit
	113303973ec9f8484eb2355a1a6ef3c4c7fd6a56 back in 2007.

	Resolves: https://github.com/strace/strace/pull/285
	Link: git://git.whamcloud.com/fs/lustre-release.git

2024-01-19  Dmitry V. Levin  <ldv@strace.io>

	tests: cleanup map_shadow_stack test.
	* tests/map_shadow_stack.c [!__NR_map_shadow_stack]: Remove.

	Complements: v6.6-2-ga1bb27b6b908 "Add map_shadow_stack syscall to all architectures"

2024-01-18  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

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

2024-01-18  Dmitry V. Levin  <ldv@strace.io>

	tests: update ioctl_ptp test.
	* tests/ioctl_ptp.c (test_no_device): Update unknown numbers to avoid
	collisions with the new ioctls introduced by Linux kernel commit
	v6.7-rc1~122^2~139^2~2.

2023-12-20  Sergei Trofimovich  <slyich@gmail.com>

	src/count.c: fix build against upcoming `gcc-14` (`-Werror=calloc-transposed-args`)
	`gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It
	detected minor infelicity in `calloc()` API usage in `strace`:

	    count.c:319:33: error: 'strace_calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
	      319 |         indices = xcalloc(sizeof(indices[0]), nsyscalls);
	          |                                 ^

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

	Enhance "Exit of unknown pid" diagnostics.
	A wait event from unknown pid is not necessarily an exit,
	it could be a termination or a stop as well.

	* src/strace.c (status2str): New function.
	(cleanup, maybe_allocate_tcb): Use it.
	* tests/detach-vfork.test: Test it.
	* tests/detach-vfork.c (main): Update expected output.

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

	tests: extend test coverage for detaching from vfork'ed processes.
	* tests/detach-vfork.test: Check exits of pipe commands and unknown
	processes.
	* tests/detach-vfork.c (main): Update expected output.

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

	tests: check detaching from vfork'ed processes.
	* tests/detach-vfork.c: New file.
	* tests/detach-vfork.test: New test.
	* tests/.gitignore: Add detach-vfork.
	* tests/Makefile.am (check_PROGRAMS): Likewise.
	(MISC_TESTS): Add detach-vfork.test.

2023-11-28  donghaobo  <donghaobo@kuaishou.com>
	    Dmitry V. Levin  <ldv@strace.io>

	strace: fix potential deadlock during cleanup.
	strace -f can potentially deadlock during cleanup if the tracee
	is using vfork or CLONE_VFORK to spawn threads.

	On linux, calling vfork will cause the calling thread to 'D' state
	until the child process calls execve or exit.  Therefore, strace
	should detach the child process first, otherwise it can wait
	indefinitely for the calling thread in 'D' state.

	Reproducer:

	  /*
	   * Start tracing with strace -f,
	   * then press Ctrl-C within 9 seconds to interrupt.
	   */
	  #include <stdlib.h>
	  #include <unistd.h>
	  #include <sys/wait.h>
	  int main(void)
	  {
	    pid_t pid = vfork();
	    if (pid < 0)
	      return 1;
	    if (pid) {
	      int status;
	      waitpid(pid, &status, 0);
	      return 0;
	    }
	    sleep(9);
	    _exit(0);
	  }

	* src/strace.c (cleanup): Do not call detach() for each tracee
	one by one as it can deadlock, instead call interrupt_or_stop()
	for each tracee and after that enter a wait loop calling
	detach_interrupted_or_stopped() for each tracee as soon as
	they become ready.
	* NEWS: Mention this fix.

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

	Factor out detach_interrupted_or_stopped() from detach()
	* src/strace.c (detach_interrupted_or_stopped): New function.
	(detach): Use it.

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

	Factor out interrupt_or_stop() from detach()
	* src/strace.c (interrupt_or_stop): New function.
	(detach): Use it.

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

	Factor out droptcb_verbose() from detach()
	* src/strace.c (droptcb_verbose): New function.
	(detach): Use it instead of droptcb.

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

	Move print_debug_info() definition before cleanup()
	* src/strace.c (print_debug_info): Move before cleanup().

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

	Fix the type of tcbtab iterators.
	* src/strace.c (alloctcb, startup_attach, init, pid2tcb, cleanup):
	Change the type of tcbtab iterators from unsigned int to size_t so that
	they match the type of tcbtabsize.

2023-11-22  Masatake YAMATO  <yamato@redhat.com>
	    Dmitry V. Levin  <ldv@strace.io>

	kvm: fix mmap_addr sign extension bug on x32.
	* src/kvm.c (struct vcpu_info): Change the type of mmap_addr from "long"
	to "unsigned long", to avoid unintended sign extension later on in
	kvm_ioctl_run_attach_auxstr.

2023-11-22  Josh Triplett  <josh@joshtriplett.org>

	Fix strace -r during the first second after booting.
	strace -r decides whether the previous timespec has been initialized by
	checking if tv_sec is 0.  However, in the first second after booting,
	CLOCK_MONOTONIC will legitimately have a tv_sec of 0.  This causes every
	displayed timestamp to display as 0.000000 during the first second after
	boot.

	* src/strace.c (printleader): Check tv_nsec as well before assuming
	the previous timespec is uninitialized.
	* NEWS: Mention this fix.

2023-11-21  Masatake YAMATO  <yamato@redhat.com>

	tests: check diagnostics about -kk/--stack-traces=source option.
	* tests/options-syntax.test: Check strace -kk/--stack-traces=source
	diagnostics.

	tests: check strace -kk -p.
	* tests/strace-kk-p.test: New test case.
	* tests/strace-kk-p.expected: New file.
	* tests/Makefile.am (check_SCRIPTS): Add strace-kk-p.test.
	(check_DATA): Add strace-kk-p.expected.

	tests/stack-fcall: use -gdwarf-aranges option if CC = clang.
	* m4/st_debug_cflags.m4: New file defining a new macro
	st_DEBUG_CFLAGS and a new condition ACCEPT_GDWARF_ARANGES.
	* configure.ac: Use st_DEBUG_CFLAGS.
	* tests/Makefile.am [USE_LIBDW && ACCEPT_GDWARF_ARANGES]
	(stack_fcall_CFLAGS, stack_fcall_attach_CFLAGS): Add -gdwarf-aranges.

2023-11-21  Masatake YAMATO  <yamato@redhat.com>

	unwind-libdw: add -kk/--stack-traces=source option.
	This change adds source code information to stack traces printed with
	-k option when strace is built with libdw.

	An example output:

	    exit_group(0)                           = ?
	    +++ exited with 0 +++
	     > /usr/lib64/libc.so.6(_exit+0x1d) [0xdb44d] ../sysdeps/unix/sysv/linux/_exit.c:30
	     > /usr/lib64/libc.so.6(__run_exit_handlers+0x125) [0x40165] /usr/src/debug/glibc-2.37-4.fc38.x86_64/stdlib/exit.c:134
	     > /usr/lib64/libc.so.6(exit+0x1d) [0x402ed] /usr/src/debug/glibc-2.37-4.fc38.x86_64/stdlib/exit.c:141
	     > /usr/lib64/libc.so.6(__libc_start_call_main+0x80) [0x27b50] ../sysdeps/nptl/libc_start_call_main.h:74
	     > /usr/lib64/libc.so.6(__libc_start_main@@GLIBC_2.34+0x8a) [0x27c0a] ../csu/libc-start.c:360
	     > /usr/bin/ls(_start+0x24) [0x6d54]

	This change also adds --stack-traces=symbol option as an alias for the
	original -k/--stack-traces options.

	NOTE: If the target program is compiled with clang, -gdwarf-aranges
	option must be specified in addition to -g to make -kk option work.
	See https://sourceware.org/bugzilla/show_bug.cgi?id=30948 about this
	limitation.

	* NEWS: Mention this.
	* doc/strace.1.in: Document this.
	* src/defs.h (stack_trace_modes): New enum.
	(stack_trace_modes::STACK_TRACE_OFF,STACK_TRACE_ON,
	STACK_TRACE_WITH_SRCINFO): New enumerators.
	(stack_trace_enabled): Rename this variable declaration to ...
	(stack_trace_mode): ... this. The type is also changed from bool to
	enum stack_trace_modes.
	(unwind_init): Add a bool parameter.
	* src/filter_seccomp.c (traced_by_seccomp): Use the new variable name
	stack_trace_mode.
	* src/strace.c (stack_trace_enabled): Rename this variable to ...
	(stack_trace_mode): ... this.
	[ENABLE_STACKTRACE && USE_LIBDW] (K_OPT): Add "kk" option.
	[ENABLE_STACKTRACE] (usage): Print --stack-traces=symbol options.
	[ENABLE_STACKTRACE && USE_LIBDW] (usage): Print -kk and
	--strack-traces=source options.
	[ENABLE_STACKTRACE] (after_successful_attach): Use the new variable
	name stack_trace_mode.
	(GETOPT_STACK): New enumerator.
	(init::longopts): Let --stack-traces take an option argument.  Use
	GETOPT_STACK as the val for --stack-traces.
	[ENABLE_STACKTRACE] (init): Handle -kk and --stack-traces=source
	options.
	(init): Pass true to unwind_init() if -kk or --stack-traces=source is
	specified.
	(print_stopped): Use the new variable name stack_trace_mode.
	* src/syscall.c (update_personality, syscall_entering_trace,
	syscall_exiting_trace): Use the new variable name stack_trace_mode.
	* src/unwind.h (unwind_call_action_fn): Add parameters
	source_filename and source_line as parameters.
