2019-11-28  Dmitry V. Levin  <ldv@altlinux.org>

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

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

2019-11-28  Dmitry V. Levin  <ldv@altlinux.org>

	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:]]' |grep -v '\.sh$') |while read f; do
		cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
	done

2019-11-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: tweak restart_syscall test to break in a more obvious way in case of faulty libc
	If libc implements nanosleep on top of clock_nanosleep, there is
	a chance of struct timespec translation bugs in libc breaking this test.
	Tweak the test to make this breakage more obvious.

	* tests/restart_syscall.c (main): Initialize rem variable with invalid
	timespec data.

2019-11-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix restart_syscall test on systems with emulated nanosleep.
	When libc emulates nanosleep on top of clock_nanosleep, the address
	of the structure passed to the kernel is not the same as the address
	of the structure passed to nanosleep.

	* tests/restart_syscall.c (main): Update expected output.

2019-11-27  Eugene Syromyatnikov  <evgsyr@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	Update NEWS.

2019-11-27  Dmitry V. Levin  <ldv@altlinux.org>

	ci: use kernel headers from Linux v5.4.
	There is too much noise when using unreleased kernel uapi.

	* .gitlab-ci.yml (variables): Add KBRANCH.
	* .travis.yml (env:global): Likewise.

2019-11-27  Dmitry V. Levin  <ldv@altlinux.org>

	Use an LFS version of fcntl function when available.
	glibc-2.28 introduced fcntl64 as an LFS version of fcntl function,
	use this new function when available.

	* configure.ac (AC_CHECK_FUNCS): Add fcntl64.
	* largefile_wrappers.h (fcntl_fd): New macro.
	* strace.c (set_cloexec_flag): Use it instead of fcntl.

2019-11-27  Paul Chaignon  <paul.chaignon@gmail.com>

	bpf: update BPF constants.
	* xlat/bpf_prog_types.in (BPF_PROG_TYPE_CGROUP_SOCK_ADDR): New constant
	introduced by Linux commit v4.17-rc1~148^2~19^2^2~6.
	(BPF_PROG_TYPE_LWT_SEG6LOCAL, BPF_PROG_TYPE_LIRC_MODE2,
	BPF_PROG_TYPE_LIRC_MODE2, BPF_PROG_TYPE_FLOW_DISSECTOR,
	BPF_PROG_TYPE_CGROUP_SYSCTL, BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE,
	BPF_PROG_TYPE_CGROUP_SOCKOPT): Update constant values following missing
	entry in enum.
	* tests/bpf.c (BPF_PROG_LOAD_checks): Update expected outputs and add test.
	* tests/kernel_version.c (print_bpf_attr, main): Likewise.

	Fixes: v4.24~49 "xlat: update bpf(2)-related constants"
	Fixes: v4.25~58 "xlat: add BPF_PROG_TYPE_SK_REUSEPORT to bpf_prog_types.in"
	Fixes: v4.26~12 "xlat: add flow dissector bpf program type constants"
	Fixes: v5.2~38 "xlat: update BPF_* constants"
	Fixes: v5.3~60 "xlat: update BPF_* constants"

2019-11-27  Paul Chaignon  <paul.chaignon@gmail.com>

	bpf: support new field in BPF_MAP_LOOKUP_ELEM.
	* bpf_attr.h (BPF_MAP_LOOKUP_ELEM_struct): New field introduced by Linux
	commit v5.1-rc1~178^2~375^2~4^2~3.
	* xlat/bpf_map_lookup_elem_flags.in: New file.
	* bpf.c: Include "xlat/bpf_map_lookup_elem_flags.h".
	(BEGIN_BPF_CMD_DECODER(BPF_MAP_LOOKUP_ELEM)): Decode the new field.
	* tests/bpf.c (BPF_MAP_LOOKUP_ELEM_checks): Update expected outputs.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: provide fallback definitions for IPC_* and SHM_* constants.
	* xlat/shm_flags.in: Provide fallback definitions for constants.
	* xlat/shm_resource_flags.in: Likewise.

	xlat: update MSG_* constants.
	* xlat/ipc_msg_flags.in: Provide fallback definitions for constants.
	(MSG_COPY): New constant introduced by Linux kernel commit
	v3.8-rc3~16^2~30.
	* NEWS: Mention this.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: change status-unfinished-threads test to use __NR_nanosleep.
	Starting with glibc commit glibc-2.30.9000-234-g3537ecb49c,
	nanosleep function in glibc is implemented on top of clock_nanosleep,
	which makes it unsuitable for this test that is based on nanosleep
	syscall.

	* tests/status-unfinished-threads.c: Skip the test if __NR_nanosleep
	is not defined, include "kernel_old_timespec.h".
	(thread, main): Change the type of ts variable to kernel_old_timespec_t,
	invoke nanosleep syscall using __NR_nanosleep.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: change threads-execve test to use __NR_nanosleep.
	Starting with glibc commit glibc-2.30.9000-234-g3537ecb49c,
	nanosleep function in glibc is implemented on top of clock_nanosleep,
	which makes it unsuitable for this test that uses both nanosleep
	and clock_nanosleep syscalls for different purposes.

	* tests/threads-execve.c: Skip the test if __NR_nanosleep is not defined.
	Include "kernel_old_timespec.h".
	(thread, main): Invoke nanosleep syscall using __NR_nanosleep.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify umoven-illptr test against undefined __NR_nanosleep.
	* tests/umoven-illptr.c: Skip the test if __NR_nanosleep is not defined.
	Include "kernel_old_timespec.h" instead of <time.h>, use
	kernel_old_timespec_t instead of struct timespec.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: change sleep helper to use __NR_nanosleep.
	Starting with glibc commit glibc-2.30.9000-234-g3537ecb49c,
	nanosleep function in glibc is implemented on top of clock_nanosleep,
	which makes it unsuitable for the sleep helper that is expected to
	invoke nanosleep syscall.

	* tests/sleep.c: Skip the test if __NR_nanosleep is not defined.
	Include "kernel_old_timespec.h" instead of <time.h>.
	(main): Change the type of ts variable to kernel_old_timespec_t,
	invoke nanosleep syscall using __NR_nanosleep.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: consistently check before use that sleep executable works.
	Add the required check to those few tests that miss it.

	* tests/status-detached.test: Invoke "run_prog ../sleep 0".
	* tests/strace-DD.test: Likewise.
	* tests/strace-ff.test: Likewise.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: change restart_syscall test not to assume nanosleep syscall.
	Starting with glibc commit glibc-2.30.9000-234-g3537ecb49c,
	nanosleep function in glibc is implemented on top of clock_nanosleep,
	which makes any code relying on the old behaviour fragile.

	Resolve this issue by allowing other syscalls from the nanosleep family.

	* tests/restart_syscall.c (NANOSLEEP_NAME_RE, NANOSLEEP_CALL_RE): New
	macros.
	(main): Use them to extend regular expressions to allow clock_nanosleep
	and clock_nanosleep_time64 syscalls.
	* tests/restart_syscall.test: Replace nanosleep with /nanosleep in the
	list of matched syscalls.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: change nanosleep test to use __NR_nanosleep.
	Starting with glibc commit glibc-2.30.9000-234-g3537ecb49c,
	nanosleep function in glibc is implemented on top of clock_nanosleep,
	which makes it unsuitable for the test of nanosleep decoder.

	* tests/nanosleep.c: Skip the test if __NR_nanosleep is not defined.
	Include "kernel_old_timespec.h" instead of <time.h>.
	(k_nanosleep): New function.
	(main): Change the type of ts variable to kernel_old_timespec_t,
	use k_nanosleep to invoke nanosleep syscall using __NR_nanosleep.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: introduce kernel_old_timespec.h.
	This header file defines kernel_old_timespec_t type that is going to be
	used to define objects passed to such system calls as nanosleep.

	* tests/kernel_old_timespec.h: New file.
	* tests/Makefile.am (EXTRA_DIST): Add kernel_old_timespec.h.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: change adjtimex test to use __NR_adjtimex.
	Starting with glibc commit glibc-2.30.9000-215-gc81aa64e81,
	adjtimex function in glibc is implemented on top of clock_adjtime,
	which makes it unsuitable for the test of adjtimex decoder.

	* configure.ac (AC_CHECK_MEMBERS): Remove struct timex.tai.
	* tests/adjtimex.c: Skip the test if __NR_adjtimex is not defined.
	Include "kernel_old_timex.h".
	(k_adjtimex): New function.
	(main): Change the type of tx pointer to kernel_old_timex_t,
	use k_adjtimex to invoke adjtimex syscall.

2019-11-19  Dmitry V. Levin  <ldv@altlinux.org>

	tests: introduce kernel_old_timex.h.
	This header file defines kernel_old_timex_t type that is going to be
	used to define objects passed to such system calls as adjtimex.

	* tests/kernel_old_timex.h: New file.
	* tests/Makefile.am (EXTRA_DIST): Add kernel_old_timex.h.

2019-11-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests: rewrite semop test.
	Starting with glibc commit glibc-2.30.9000-169-g765cdd0bff,
	semop function in glibc is implemented on top of semtimedop,
	which makes it unsuitable for the test of semop decoder.

	Resolve this issue by creating two tests: one that checks decoding
	of __NR_semop, and another that checks decoding of __NR_ipc SEMOP.

	* tests/semop-common.c: New file.
	* tests/Makefile.am (EXTRA_DIST): Add semop-common.c.
	* tests/semop-indirect.c: New file.
	* tests/semop.c: Rewrite using __NR_semop.
	* tests/pure_executables.list: Add semop-indirect.
	* tests/.gitignore: Likewise.
	* tests/gen_tests.in (semop): Update.
	(semop-indirect): New entry.

2019-11-18  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add a separate semtimedop test.
	The semop test is going to be changed soon, so create a separate
	semtimedop test based on the test we have.

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

2019-11-17  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update PTP_* constants.
	* xlat/ptp_extts_flags.in (PTP_STRICT_FLAGS): New constant introduced
	by Linux kernel commit v5.4-rc8~8^2~9^2~5.

2019-11-15  Dmitry V. Levin  <ldv@altlinux.org>

	travis: switch from gcc-8 to gcc-9.
	* .travis.yml (matrix): Switch all gcc-8 builds except arm64 ones
	to gcc-9.  gcc-8 arm64 builds have to remain until gcc-9 arm64 builds
	are fixed, currently they error out because of missing
	gcc-9-multilib-arm-linux-gnueabihf package.

2019-11-15  Dmitry V. Levin  <ldv@altlinux.org>

	travis: switch some stack trace enabled builds from libunwind to libdw.
	Switch to Bionic allows to use libdw instead of libunwind.

	* .travis.yml (matrix): Change STACKTRACE from libunwind to libdw
	in most of Bionic-based builds.

2019-11-15  Dmitry V. Levin  <ldv@altlinux.org>

	travis: switch from Trusty to Bionic.
	Ideally, all builds have to be switched, but coverage build,
	unfortunately, errors out by Travis CI with a build timeout,
	musl-gcc x86 build fails with
	"undefined reference to `__stack_chk_fail_local'" error, and gcc-8 arm64
	builds error out because of missing gcc-8-multilib-arm-linux-gnueabihf
	package.

	* .travis.yml (dist): Change to bionic.
	(matrix): Add "dist: trusty" to coverage, musl-gcc x86, and gcc-8 arm64
	builds.

2019-11-15  Dmitry V. Levin  <ldv@altlinux.org>

	ci: enable mpers in aarch64 builds.
	* ci/install-dependencies.sh (aarch64): Install libc6-dev-armhf-cross
	and linux-libc-dev-armhf-cross packages.
	* ci/run-build-and-tests.sh (aarch64): Enable strict mpers check
	by removing --enable-mpers=check configure option.

2019-11-15  Paul Chaignon  <paul.chaignon@gmail.com>

	ci: support Travis CI's aarch64 builds.
	Travis CI now supports aarch64 builds, launched with the new "arch: arm64"
	tag.  These builds are running inside LXD only for the moment.

	The aarch64 builds tend to be a lot slower than their x86_64 counterparts,
	so several timeout values need to be increased.

	Some tests occasionally take more than 10 minutes, hitting Travis CI's
	timeout on output inactivity.  Using "travis_wait 40" disables that
	timeout; it delays the start time for the output inactivity timeout by 40
	minutes, bringing it to the maximum build timeout of 50 minutes.

	* .travis.yml (matrix): Add aarch64 builds and mark previous builds as
	amd64.
	* ci/install-dependencies.sh: Install packages for aarch64 builds.
	* ci/run-build-and-tests.sh: Check mpers for aarch64.

2019-11-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	debian/control: add build dependencies for aarch64 mpers.
	* debian/control (Build-Depends): Add gcc-arm-linux-gnueabi,
	libc6-dev-armel-cross, linux-libc-dev-armel-cross as additional
	dependencies on arm64 in order to build proper mpers support.

2019-11-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	configure.ac: use a separate compiler for ARM EABI on AArch64.
	As gcc on AArch64 doesn't support compat ABI target, we have to find
	and use a separate compiler in order to get proper compat personality
	support on AArch64.

	* configure.ac (arch == aarch64): Try to find a compiler for ARM EABI
	based on known names for it in various distributions.

2019-11-15  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Add support for per-mpers compiler settings.
	As some very special architectures require a separate compiler
	in order to compile binaries for additional supported personalities,
	we have to introduce such support.

	* Makefile.am (mpers_CPPFLAGS): Move $(strace_CPPFLAGS) ...
	(mpers_sh_opts): ... here.
	(mpers-m%.stamp:): Use $(mpers_CC) instead of $(CC) for compiler,
	pass $(mpers_CC_FLAGS) in quotes as it might be empty or contain spaces.
	($(mpers_m32_targets)): Add @CFLAGS_FOR_M32@ to mpers_CC_FLAGS, set
	mpers_CPPFLAGS and mpers_CC.
	($(mpers_mx32_targets)): Add @CFLAGS_FOR_MX32@ to mpers_CC_FLAGS, set
	mpers_CPPFLAGS and mpers_CC.
	* bootstrap (m_upper): Derive uppercase personality name.
	Set CC for mpers Makefile.am, add @CFLAGS_FOR_{M32,MX32}@ to
	MPERS_CC_FLAGS definition.
	* configure.ac: Derive default values for
	{CC,CPP,CFLAGS,CPPFLAGS}_FOR_{M32,MX32} from the respective CC, CPP,
	CFLAGS, and CPPFLAGS values.
	* m4/mpers.m4 (AC_DEFUN([st_MPERS])): Use
	{CC,CPP,CFLAGS,CPPFLAGS}_FOR_<$1> as CC, CPP, CFLAGS, and CPPFLAGS,
	respectively.  Enclose MPERS_CFLAGS in quotes in mpers.sh call.  Provide
	information about compiler in the AC_CACHE_CHECK message.
	* tests/Makefile.am (CC): New variable.

	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>

2019-11-15  Dmitry V. Levin  <ldv@altlinux.org>

	ci: enable symbols demangling in stack trace enabled builds.
	* ci/install-dependencies.sh: Install libiberty-dev when STACKTRACE
	is specified.

	tests: lower expected performance gain in filter_seccomp-perf.test.
	* tests/filter_seccomp-perf.test (min_ratio): Change from 8 to 6,
	the former expectation was too optimistic for such slow architectures
	as parisc.

	tests: fix invalid copyright years range in a few tests.
	* maint/update_copyright_years.sh (process_file): When updating
	copyright years, if there is existing notice and its starting year is
	earlier than the year of the first commit, the former takes precedence.
	* tests/filter_seccomp-flag.c: Fix copyright years range.
	* tests/filter_seccomp-perf.c: Likewise.
	* tests/filter_seccomp-perf.test: Likewise.
	* tests/filter_seccomp.sh: Likewise.
	* tests/status-none-f.c: Likewise.

	ptp: add support of new PTP_*2 ioctls.
	* ptp.c [!PTP_CLOCK_GETCAPS2] (PTP_CLOCK_GETCAPS2): Define.
	[!PTP_EXTTS_REQUEST2] (PTP_EXTTS_REQUEST2): Likewise.
	[!PTP_PEROUT_REQUEST2] (PTP_PEROUT_REQUEST2): Likewise.
	[!PTP_ENABLE_PPS2] (PTP_ENABLE_PPS2): Likewise.
	[!PTP_SYS_OFFSET2] (PTP_SYS_OFFSET2): Likewise.
	(ptp_ioctl): Handle PTP_CLOCK_GETCAPS2, PTP_EXTTS_REQUEST2,
	PTP_PEROUT_REQUEST2, PTP_ENABLE_PPS2, and PTP_SYS_OFFSET2.
	* tests/ioctl_ptp.c: Check decoding of PTP_*2 ioctls.

	tests: rewrite ioctl_ptp test using sprintrc.
	* tests/ioctl_ptp.c: Do not include <errno.h>.
	(main): Use sprintrc.

	ptp: prepare for support of new PTP_*2 ioctls.
	* xlat/ptp_flags_options.in: Rename to ...
	* xlat/ptp_extts_flags.in: ... new file, add fallback definitions
	for constants.
	* xlat/ptp_perout_flags.in: New file.
	* ptp.c: Include "xlat/ptp_extts_flags.h" and "xlat/ptp_perout_flags.h"
	instead of "xlat/ptp_flags_options.h".
	(ptp_ioctl): Use ptp_extts_flags and ptp_perout_flags instead of
	ptp_flags_options.
	* tests/ioctl_ptp.c: Include "xlat/ptp_extts_flags.h" and
	"xlat/ptp_perout_flags.h" instead of "xlat/ptp_flags_options.h".
	(test_no_device): Use ptp_extts_flags and ptp_perout_flags instead of
	ptp_flags_options.

	prctl: implement decoding of PR_[GS]ET_TAGGED_ADDR_CTRL.
	* xlat/prctl_options.in (PR_SET_TAGGED_ADDR_CTRL,
	PR_GET_TAGGED_ADDR_CTRL): New constants introduced by Linux kernel commit
	v5.4-rc1~100^2~6^9~8.
	* prctl.c (SYS_FUNC(prctl)): Handle them.
	* NEWS: Mention this.
	* tests/prctl-no-args.c: Check PR_GET_TAGGED_ADDR_CTRL decoding.

	xlat: update KVM_CAP_* constants.
	* xlat/kvm_cap.in (KVM_CAP_ARM_IRQ_LINE_LAYOUT_2): New constant
	introduced by Linux kernel commit v5.4-rc1~138^2~20^2.
	(KVM_CAP_HYPERV_DIRECT_TLBFLUSH): New constant introduced by Linux
	kernel commit v5.4-rc1~26^2~53.
	* NEWS: Mention this.

	xlat: update KEXEC_* constants.
	* xlat/kexec_arch_values.in (KEXEC_ARCH_PARISC): New constant introduced
	by Linux kernel commit v5.4-rc1~188^2~4.
	* NEWS: Mention this.

	xlat: update CAN_* constants.
	* xlat/can_protocols.in (CAN_J1939): New constant introduced by Linux
	kernel commit v5.4-rc1~131^2~78^2~2.
	* NEWS: Mention this.

2019-11-14  Dmitry V. Levin  <ldv@altlinux.org>

	bpf: implement decoding of BPF_BTF_GET_NEXT_ID command.
	* xlat/bpf_commands.in (BPF_BTF_GET_NEXT_ID): New constant introduced
	by Linux kernel commit v5.4-rc1~131^2~62^2~28^2~4.
	* bpf_attr.h (BPF_BTF_GET_NEXT_ID_struct,
	BPF_BTF_GET_NEXT_ID_struct_size): New macros.
	* bpf.c (decode_BPF_BTF_GET_NEXT_ID): Likewise.
	(bpf_cmd_decoders): Add BPF_CMD_ENTRY(BPF_BTF_GET_NEXT_ID).
	* NEWS: Mention this change.
	* tests/bpf.c (BPF_BTF_GET_NEXT_ID_checks): New macro.
	(checks): Add CHK(BPF_BTF_GET_NEXT_ID).

2019-11-13  Dmitry V. Levin  <ldv@altlinux.org>

	xlat: update MADV_* constants.
	* xlat/madvise_cmds.in (MADV_COLD): New constant introduced by Linux
	kernel commit v5.4-rc1~46^2~13.
	(MADV_PAGEOUT): New constant introduced by Linux kernel commit
	v5.4-rc1~46^2~11.
	* NEWS: Mention this.

2019-11-13  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v5.4.
	* linux/32/ioctls_inc_align16.h: Update from linux v5.4-rc7
	using ioctls_gen.sh.
	* linux/32/ioctls_inc_align32.h: Likewise.
	* linux/32/ioctls_inc_align64.h: Likewise.
	* linux/64/ioctls_inc.h: Likewise.
	* linux/x32/ioctls_inc0.h: Likewise.
	* linux/riscv64/ioctls_arch0.h: Likewise.
	* linux/s390/ioctls_arch0.h: Likewise.
	* linux/s390x/ioctls_arch0.h: Likewise.
	* NEWS: Mention this.

2019-11-09  Paul Chaignon  <paul.chaignon@gmail.com>

	filter_seccomp: fix jump offset overflow in binary match generator.
	binary_match_filter_generator() is missing a check for jump offset
	overflows which might result in incorrect behavior if the binary match
	strategy is selected and overflows.

	I have only been able to reproduce the bug on mips after forcing strace to
	use the binary match generator.  Due to the large number of syscalls on
	mips, the binary match algorithm is suboptimal and the linear one is
	selected.  This bug could however be triggered inadvertently if tracing a
	very large set of syscalls not grouped together; in that case, the linear
	strategy might have a jump offset overflow itself and strace would
	fallback to the binary match one.

	* filter_seccomp (binary_match_filter_generator): Check for jump offset
	overflows.

2019-11-08  Paul Chaignon  <paul.chaignon@gmail.com>

	tests: fix potentially missing SHM_NORESERVE for mips.
	* tests/ipc_shm.c [!SHM_NORESERVE] (SHM_NORESERVE): Define.

2019-11-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests: tolerate zero process group ID and session ID in strace-DDD.test.
	Paul Chaignon reported [1] that in some of Travis CI build environments
	process group ID and session ID may be equal to zero.

	Change the affected strace-DDD.test to tolerate these odd values as long
	as they don't interfere with the purpose of the test.

	[1] https://travis-ci.community/t/unexpected-zero-values-in-proc-pid-stat/5774

	* tests/strace-DDD.test: Tolerate zero process group ID and session ID.

	Reported-by: Paul Chaignon <paul.chaignon@gmail.com>

2019-11-07  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix -a argument in ipc_msgbuf-Xraw test.
	* tests/gen_tests.in (ipc_msgbuf-Xraw): Change -a argument from 20 to 19.

2019-11-07  Paul Chaignon  <paul.chaignon@gmail.com>
	    Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify umount2.test against filtered umount2 syscall.
	Do not assume that umount2 syscall invoked with invalid arguments always
	fail with EINVAL as in some environments it can be filtered out e.g.
	using seccomp-bpf.

	* tests/umount2.c (main): Use sprintrc() to prepare expected output.

2019-11-02  Dmitry V. Levin  <ldv@altlinux.org>

	tests: enhance termination signal forwarding check.
	Check that termination signal forwarding works properly when strace
	is invoked with the corresponding termination signal blocked.

	* tests/block_reset_run.c: New file.
	* tests/Makefile.am (check_PROGRAMS): Add block_reset_run.
	* tests/.gitignore: Likewise.
	* tests/termsig.test: Extend the check to cover the case when
	strace is invoked with the termination signal blocked.

2019-11-02  Dmitry V. Levin  <ldv@altlinux.org>

	Use __gcov_dump declaration from <gcov.h> if available.
	The function declaration provided by <gcov.h> is fine,
	use it when <gcov.h> is available.

	* configure.ac (AC_CHECK_HEADERS): Add gcov.h.
	* defs.h [ENABLE_COVERAGE_GCOV && HAVE_GCOV_H]: Include <gcov.h>.

2019-11-02  Dmitry V. Levin  <ldv@altlinux.org>

	Use __gcov_dump instead of __gcov_flush to dump profile information.
	__gcov_flush is essentially __gcov_dump followed by __gcov_reset.
	The way we use __gcov_flush so far does not need any __gcov_reset,
	so use __gcov_dump instead.

	* defs.h [ENABLE_COVERAGE_GCOV] (__gcov_flush): Replace with
	__gcov_dump.
	(GCOV_FLUSH): Replace with GCOV_DUMP.
	* filter_seccomp.c (check_seccomp_order_do_child): Replace GCOV_FLUSH
	with GCOV_DUMP.
	* strace.c (terminate): Likewise.

2019-11-02  Dmitry V. Levin  <ldv@altlinux.org>

	Reduce ENABLE_COVERAGE_GCOV ifdefery.
	Introduce a new macro GCOV_FLUSH and use it instead of __gcov_flush.

	* defs.h (GCOV_FLUSH): New macro.
	[ENABLE_COVERAGE_GCOV] (__gcov_flush): New prototype.
	* filter_seccomp.c (__gcov_flush): Remove.
	(check_seccomp_order_do_child): Call GCOV_FLUSH instead of __gcov_flush.
	* strace.c (__gcov_flush): Remove.
	(terminate): Call GCOV_FLUSH instead of __gcov_flush.

2019-10-31  Dmitry V. Levin  <ldv@altlinux.org>

	filter_seccomp: simplify check_seccomp_filter_properties.
	* filter_seccomp.c (check_seccomp_filter_properties): Simplify slightly
	by removing a redundant "if" expression.

2019-10-31  Paul Chaignon  <paul.chaignon@gmail.com>

	filter_seccomp: binary match generation strategy.
	This commit introduces a new BPF program generation strategy.  Traced
	syscalls are encoded in 32-bit bit arrays in the BPF program.  Syscalls
	are then matched against bit arrays at runtime with two ALU operations:
	a division to select the appropriate bit array to compare with,
	and a shift to select the appropriate bit in the bit array.

	Since there is no way to implement a jump table in BPF (jumps have fixed
	offsets), we have to iterate over all bit arrays to select the appropriate
	bit array.  The division and modulo are also converted into a shift and
	a bitwise AND, to improve performance and because seccomp-bpf disallows
	modulos in BPF.

	Compared to the linear generation strategy, this strategy generates
	programs of near constant size.  There is a single optimization that
	depends on traced syscalls: if a bit array is all-0 or all-1, we don't
	need to do a jset against it, we can simply jump to either RET_ALLOW
	or RET_TRACE.

	* filter_seccomp.c (JMP_PLACEHOLDER_ALLOW): New constant.
	(binary_match_filter_generator): New prototype.
	(filter_generators): Add binary_match_filter_generator.
	(replace_jmp_placeholders): Handle JMP_PLACEHOLDER_ALLOW case.
	(linear_filter_generator): New argument for replace_jmp_placeholders.
	(bpf_syscalls_match, binary_match_filter_generator): New functions.
	(dump_seccomp_bpf): Handle ldwimm, jset, rsh, lsh, and, tax, and txa
	instructions.

2019-10-31  Paul Chaignon  <paul.chaignon@gmail.com>

	filter_seccomp: list of seccomp filter generation strategies.
	Iterate over a list of BPF program generators, to select the shortest
	program.  This commit doesn't introduce new generation strategies.

	* filter_seccomp.c (filter_generator_t): New typedef.
	(linear_filter_generator): New prototype.
	(filter_generators, filters): New variables.
	(seccomp_filter): Remove.
	(init_sock_filter): Rename to linear_filter_generator, signal overflow
	via function argument instead of erroring out.
	(check_seccomp_filter): Find the shortest program generated by all
	generation strategies, error in case of overflow in all generated
	programs.

2019-10-28  Dmitry V. Levin  <ldv@altlinux.org>

	ci: install rsync for headers_install.
	Starting with Linux commit v5.3-rc1~111^2~40, "make headers_install"
	needs rsync.

	* ci/install-dependencies.sh: Install rsync before invoking
	"make headers_install".

2019-10-28  Dmitry V. Levin  <ldv@altlinux.org>

	tests: skip a few tests on systems with nproc == 1.
	Several tests require some concurrency between threads,
	skip these tests if nproc reports 1.

	* tests/init.sh (require_min_nproc): New function.
	* tests/status-none-threads.test: Use it.
	* tests/threads-execve.test: Likewise.

2019-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update v4l2_sliced_flags.
	* xlat/v4l2_sliced_flags.in (V4L2_SLICED_TELETEXT_B, V4L2_SLICED_VPS,
	V4L2_SLICED_CAPTION_525, V4L2_SLICED_WSS_625): Add fallback definitions.
	(V4L2_SLICED_VBI_525): Comment out as it has the same value as
	V4L2_SLICED_CAPTION_525.
	(V4L2_SLICED_VBI_625): Add fallback definition, move up.

2019-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update v4l2_vbi_flags.
	For some reason, it also used to include V4L2_VBI_ITU_[56]25_F[12]_START
	constants that are definitely unrelated to V4L2_VBI_* flags.

	* xlat/v4l2_vbi_flags.in (V4L2_VBI_UNSYNC, V4L2_VBI_INTERLACED): Add
	fallback definitions.
	(V4L2_VBI_ITU_525_F1_START, V4L2_VBI_ITU_525_F2_START,
	V4L2_VBI_ITU_625_F1_START, V4L2_VBI_ITU_625_F2_START): Remove.

2019-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: provide fallback definitions for V4L2_TUNER_* constants.
	Also, since V4L2_TUNER_*_SAP have the same values as V4L2_TUNER_*_LANG2,
	comment out the former.

	* xlat/v4l2_tuner_audmodes.in: Add fallback definitions for constants,
	add #value_indexed.
	(V4L2_TUNER_MODE_SAP): Comment out.
	* xlat/v4l2_tuner_capabilities.in: Add fallback definitions for
	constants.
	(V4L2_TUNER_CAP_SAP): Comment out.
	* xlat/v4l2_tuner_rxsubchanses.in: Add fallback definitions for
	constants.
	(V4L2_TUNER_SUB_SAP): Comment out.

2019-10-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: provide fallback definitions for some V4L2_* constants.
	* xlat/v4l2_capture_modes.in: Add fallback definitions for constants.
	* xlat/v4l2_control_flags.in: Likewise.
	* xlat/v4l2_streaming_capabilities.in: Likewise.
	* xlat/v4l2_frameinterval_types.in: Add fallback definitions for
	constants, add #value_indexed.
	* xlat/v4l2_framesize_types.in: Likewise.
	* xlat/v4l2_input_types.in: Likewise.
	* xlat/v4l2_memories.in: Likewise.
	* xlat/v4l2_tuner_types.in: Likewise.

2019-10-25  Dmitry V. Levin  <ldv@altlinux.org>

	ci: consistently parallelize make jobs.
	* ci/run-build-and-tests.sh: Use "nproc" instead of
	"getconf _NPROCESSORS_ONLN".
	* ci/install-dependencies.sh: Use "nproc" to parallelize make jobs.

2019-10-25  Dmitry V. Levin  <ldv@altlinux.org>

	tests: workaround clang oddness.
	When a structure is initialized using designated initializers,
	clang >= 7, apparently, does not initialize trailing padding
	of the structure.

	* tests/bpf-obj_get_info_by_fd.c [CHECK_OBJ_PROG]
	(bpf_prog_load_attr_sizes): Replace the size of struct
	BPF_PROG_LOAD_struct with BPF_PROG_LOAD_struct_size.

2019-10-25  Paul Chaignon  <paul.chaignon@gmail.com>

	filter_seccomp: use init_sock_filter to check the number of BPF instructions
	With this commit, the number of instructions in the seccomp BPF program
	is checked by directly constructing the program.  The BPF program is
	therefore created during the check for seccomp availability instead of
	when seccomp filtering is initialized.  The BPF program is saved
	as a global variable between the two operations.

	* filter_seccomp.c (seccomp_filter, bpf_prog): New variables.
	(init_sock_filter): Disable seccomp-filter in case of overflow, move dump
	of BPF program in debug mode...
	(init_seccomp_filter): ...here.
	(check_bpf_program_size): Remove.
	(dump_seccomp_bpf): Remove arguments as they are now global variables.

2019-10-23  Dmitry V. Levin  <ldv@altlinux.org>

	Remove XLAT_END.
	* xlat.h (XLAT_END): Remove.
	* process.c (struct_user_offsets_data): Replace XLAT_END with a zero
	xlat_data entry.

	Complements: v5.3~105 "Add xlat description structure"

2019-10-23  Dmitry V. Levin  <ldv@altlinux.org>

	bfin, csky, m68k, sh: fix build regression.
	* xlat/cacheflush_flags.in: New file.
	* cacheflush.c [M68K || BFIN || CSKY || SH] (cacheflush_flags): Remove,
	include "xlat/cacheflush_flags.h" instead.

	Fixes: v5.3~105 "Add xlat description structure"

2019-10-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

	strace.spec.in: add support for old distros that cannot handle .tar.xz.

	xlat: update V4L2_CTRL_TYPE_* constants.
	* xlat/v4l2_control_types.in: Add fallback definitions for constants,
	and #sorted.
	* configure.ac (AC_CHECK_MEMBERS): Check for struct
	v4l2_ext_control.string field.
	* v4l2.c (print_v4l2_ext_control): Change guard macro
	to HAVE_STRUCT_V4L2_EXT_CONTROL_STRING.

	xlat: update V4L2_COLORSPACE_* constants.
	* xlat/v4l2_colorspaces.in: Add #value_indexed.
	(V4L2_COLORSPACE_DEFAULT): New constant introduced by Linux commit
	v4.2-rc1~107^2~184.
	(V4L2_COLORSPACE_ADOBERGB): Rename to V4L2_COLORSPACE_OPRGB, per Linux
	commit v4.20-rc1~69^2~122.
	(V4L2_COLORSPACE_SMPTE170M, V4L2_COLORSPACE_SMPTE240M,
	V4L2_COLORSPACE_REC709, V4L2_COLORSPACE_BT878,
	V4L2_COLORSPACE_470_SYSTEM_M, V4L2_COLORSPACE_470_SYSTEM_BG,
	V4L2_COLORSPACE_JPEG, V4L2_COLORSPACE_SRGB, V4L2_COLORSPACE_OPRGB,
	V4L2_COLORSPACE_BT2020, V4L2_COLORSPACE_RAW, V4L2_COLORSPACE_DCI_P3):
	Add fallback definitions.

	xlat: Provide fallback definitions for V4L2_FIELD_* constants.
	* xlat/v4l2_fields.in: Add fallback definitions for constants.

	xlat: update V4L2_BUF_TYPE_* constants.
	* xlat/v4l2_buf_types.in: Add fallback definitions for constants,
	mention V4L2_BUF_TYPE_PRIVATE in comment, add #value_indexed.
	* configure.ac (AC_CHECK_MEMBERS): Add checks for
	struct v4l2_format.fmt.pix_mp, struct v4l2_format.fmt.sdr, and
	struct v4l2_format.fmt.sliced.
	* v4l2.c (print_v4l2_format_fmt): Use the relevant HAVE_STRUCT_* macros
	instead of HAVE_DECL_V4L2_BUF_TYPE_*.

	xlat: provide fallback definitions for V4L2_CAP_* constants.
	* xlat/v4l2_device_capabilities_flags.in: Sort, add fallback definitions
	for constants.
	* configure.ac (AC_CHECK_MEMBERS): Check for struct
	v4l2_capability.device_caps.
	* v4l2.c (print_v4l2_capability): Change V4L2_CAP_DEVICE_CAPS guard
	to HAVE_STRUCT_V4L2_CAPABILITY_DEVICE_CAPS.

2019-10-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

	evdev: decode struct input_absinfo regardless of in-kernel definitions.
	* evdev.c (struct_input_absinfo): New typedef.
	(abs_ioctl): Add code argument. Add orig_sz, res_sz, sz, read_sz local
	variables. Decode resolution field regardless of
	HAVE_STRUCT_INPUT_ABSINFO_RESOLUTION.
	(evdev_read_ioctl, evdev_write_ioctl): Pass code to abs_ioctl.
	* tests/ioctl_evdev-success.c (print_input_absinfo): Update expected
	output.
	(main): Add absinfo_sz, absinfo_24, absinfo_32 local variables; add
	additional checks for struct input_absinfo.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-22  Eugene Syromyatnikov  <evgsyr@gmail.com>

	evdev: do not rely on EVIOC* constants provided in <linux/input.h>
	* xlat/evdev_ioctl_cmds.in: New file.
	* configure.ac (AC_CHECK_HEADERS([linux/input.h])): Check for struct
	input_keymap_entry and struct input_mask.
	* evdev.c [!INPUT_PROP_MAX] (INPUT_PROP_MAX): New macro definition.
	(struct_input_keymap_entry, struct_input_mask): New typedefs.
	[HAVE_STRUCT_INPUT_KEYMAP_ENTRY]: Add a static_assert to check
	that sizeof(struct input_keymap_entry) has the expected value.
	[HAVE_STRUCT_INPUT_MASK]: Add a static_assert to check
	that sizeof(struct input_mask) has the expected value.
	[!EVIOCGPROP] (EVIOCGPROP): New macro definition.
	[!EVIOCGMTSLOTS] (EVIOCGMTSLOTS): Likewise.
	[!EVIOCGSW] (EVIOCGSW): Likewise.
	[!EVIOCGKEYCODE_V2] (keycode_V2_ioctl): Remove guard.
	(keycode_V2_ioctl): Change type of ike to struct_input_keymap_entry.
	[!EVIOCGMTSLOTS] (mtslots_ioctl): Remove guard.
	[!EVIOCGREP || EVIOCSREP] (repeat_ioctl): Likewise.
	(evdev_read_ioctl) [!EVIOCGREP] <case EVIOCGREP>: Likewise.
	(evdev_read_ioctl) [!EVIOCGKEYCODE_V2] <case EVIOCGKEYCODE_V2>:
	Likewise.
	(evdev_read_ioctl) [!EVIOCGMTSLOTS] <case EVIOCGMTSLOTS>: Likewise.
	(evdev_read_ioctl) [!EVIOCGPROP] <case EVIOCGPROP>: Likewise.
	(evdev_read_ioctl) [!EVIOCGSW] <case EVIOCGSW>: Likewise.
	(evdev_write_ioctl) [!EVIOCSREP] <case EVIOCSREP>: Likewise.
	(evdev_write_ioctl) [!EVIOCSKEYCODE_V2] <case EVIOCSKEYCODE_V2>: Likewise.
	(evdev_write_ioctl) [!EVIOCREVOKE] <case EVIOCREVOKE>: Likewise.
	(evdev_write_ioctl) [!EVIOCSCLOCKID] <case EVIOCSCLOCKID>: Likewise.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests/nsyscalls.c: remove redundant definition of SYSCALL_BIT.
	Starting with commit v5.3~111, tests/nsyscalls.c includes "scno.h"
	which already defines SYSCALL_BIT where appropriate.

	* tests/nsyscalls.c (SYSCALL_BIT): Remove.

2019-10-21  Dmitry V. Levin  <ldv@altlinux.org>

	tests: replace "sed -E" with "sed -r"
	because the latter is more portable.

	* tests/strace-D.test: Replace "sed -E" with "sed -r".

2019-10-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: add BPF_MAP_TYPE_DEVMAP_HASH to bpf_map_types.
	* xlat/bpf_map_types.in (BPF_MAP_TYPE_DEVMAP_HASH): New constant,
	introduced by Linux commit v5.4-rc1~131^2~248^2~16^2~3.
	* tests/bpf.c: Update expected output.

	xlat: add BPF_F_CLONE to bpf_map_flags.
	* xlat/bpf_map_flags.in (BPF_F_CLONE): New flag, introduced by Linux
	commit v5.4-rc1~131^2~62^2~34^2~2.
	* tests/bpf.c: Update expected output.

	xlat: add BPF_F_TEST_STATE_FREQ to bpf_prog_flags.
	* xlat/bpf_prog_flags.in (BPF_F_TEST_STATE_FREQ): New constant,
	introduced by Linux commit v5.4-rc1~131^2~62^2~17^2~3.
	* tests/bpf.c: Update expected output.

	xlat: update waitid_types.
	* xlat/waitid_types.in (P_PIDFD): New constant, introduced by Linux
	commit v5.4-rc1~203^2~4.
	(P_ALL, P_PID, P_PGID): Add fallback values.
	(P_PPID, P_SID, P_CID, P_UID, P_GID, P_LWPID): Remove.

	xlat: update v4l2_format_description_flags.
	* xlat/v4l2_format_description_flags.in (V4L2_FMT_FLAG_COMPRESSED,
	V4L2_FMT_FLAG_EMULATED): Add fallback definitions.
	(V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM): New constant, introduced by Linux
	commit v5.4-rc1~145^2~69.
	(V4L2_FMT_FLAG_DYN_RESOLUTION): New constant, introduced by Linux commit
	v5.4-rc1~145^2~68.

	xlat: update sock_sctp_options.
	* xlat/sock_sctp_options.in (SCTP_ASCONF_SUPPORTED): New constant,
	introduced by Linux commit v5.4-rc1~131^2~204^2~4.
	(SCTP_AUTH_SUPPORTED): New constant, introduced by Linux commit
	v5.4-rc1~131^2~204^2~1.
	(SCTP_ECN_SUPPORTED): New constant, introduced by Linux commit
	v5.4-rc1~131^2~140^2.

	xlat: add EROFS_SUPER_MAGIC_V1 to fsmagic.
	* xlat/fsmagic.in (EROFS_SUPER_MAGIC_V1): New constant, introduced
	by Linux commit v5.4-rc1~134^2~105.

2019-10-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_route: decode struct rta_mfc_stats and struct rtvia unconditionally
	* rtnl_route.c (struct_rta_mfc_stats, struct_rtvia): New typedefs.
	[HAVE_STRUCT_RTA_MFC_STATS]: Add a static_assert to check
	that sizeof(struct rta_mfc_stats) has the expected value.
	[HAVE_STRUCT_RTVIA]: Add a static_assert to check that sizeof(struct
	rtvia) has the expected value.
	(decode_rta_mfc_stats) [HAVE_STRUCT_RTA_MFC_STATS]: Remove guard.
	(decode_rta_mfc_stats): Change the type of mfcs variable to
	struct_rta_mfc_stats.
	(decode_rtvia): Change the type of via variable to struct_rtvia.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-20  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_neightbl: always decode struct ndt_config and struct ndt_stats.
	* rtnl_neightbl.c (struct_ndt_config, struct_ndt_stats): New typedefs.
	[HAVE_STRUCT_NDT_CONFIG]: New static_assert to check
	that sizeof(struct ndt_config) has the expected value.
	[HAVE_STRUCT_NDT_STATS]: New static_assert to check
	that sizeof(struct ndt_stats) has the expected value.
	(decode_ndt_config) [HAVE_STRUCT_NDT_CONFIG]: Remove guard.
	(decode_ndt_config): Change the type of ndtc variable
	to struct_ndt_config.
	(decode_ndt_stats) [HAVE_STRUCT_NDT_STATS]: Remove guard.
	(decode_ndt_stats): Change the type of ndtst variable
	to struct_ndt_stats.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_mdb: decode messages regardless of availability of kernel headers.
	* netlink_route.c [!HAVE_STRUCT_BR_PORT_MSG]: Do not skip decoding of
	RTM_DELMDB, RTM_GETMDB, and RTM_NEWMDB messages.
	* rtnl_mdb.c: Remove #ifdef HAVE_STRUCT_BR_PORT_MSG guard.
	(struct_br_port_msg, struct_br_mdb_entry): New typedefs.
	[HAVE_STRUCT_BR_PORT_MSG]: Static assert check for struct br_port_msg
	size.
	[HAVE_STRUCT_BR_NDB_ENTRY]: Static assert check for strucr br_mdb_entry
	size.
	(decode_mdba_mdb_entry_info) [!HAVE_STRUCT_BR_MDB_ENTRY]: Remove.
	(decode_mdba_mdb_entry_info): Change entry type to struct_br_mdb_entry.
	(decode_mdba_mdb_entry_info) [HAVE_STRUCT_BR_MDB_ENTRY_FLAGS,
	HAVE_STRUCT_BR_MDB_ENTRY_VID]: Remove guards.
	(decode_br_port_msg): Change bpm type to struct_br_port_msg.
	* tests/nlattr_ifinfomsg.c: Use TEST_NLATTR_OBJECT_MINSZ to test
	struct rtnl_link_stats printing.
	* tests/nlattr_mdba_mdb_entry.c: Update expected output.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_link: print pad field in the struct ifla_port_vsi decoder.
	And steamline the flow a bit.

	* rtnl_link.c (decode_ifla_port_vsi): Factor the printing code out of
	the conditional statement, add pad field printing.
	* tests/nlattr_ifla_port.c: Add check for the pad field printing.

2019-10-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	rtnl_link: use internal rtnl_link_stats* and ifla_port_vsi definitions.
	Define substitutes for struct rtnl_link_stats, struct
	rtnl_link_stats64, and struct ifla_port_vsi internally.
	Add a static_assert that informs about future growth of the structures
	provided by the kernel headers.

	* rtnl_link.c (struct_rtnl_link_stats, struct_rtnl_link_stats64,
	struct_ifla_port_vsi): New typedefs.
	[HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER]: Add a static_assert to check
	that sizeof(struct rtnl_link_stats) has the expected value.
	[HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER]: Add a static_assert
	to check that sizeof(struct rtnl_link_stats) has the expected value.
	[HAVE_STRUCT_IFLA_PORT_VSI]: Add a static_assert to check
	that sizeof(struct ifla_port_vsi) has the expected value.
	(decode_rtnl_link_stats) [HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER]:
	Remove guard.
	(decode_rtnl_link_stats): Change the type of st variable to
	struct_rtnl_link_stats; use struct_rtnl_link_stats in offsetofend
	statement for min_size definition.
	(decode_rtnl_link_stats64) [HAVE_STRUCT_RTNL_LINK_STATS64,
	HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER]: Remove guards.
	(decode_rtnl_link_stats64): Change the type of st variable
	to struct_rtnl_link_stats64.
	(decode_ifla_port_vsi) [HAVE_STRUCT_IFLA_PORT_VSI]: Remove guard.
	(decode_ifla_port_vsi): Change the type of vsi variable
	to struct_ifla_port_vsi.

	References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201

2019-10-19  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Enable building of netlink_crypto decoder without linux/cryptouser.h.
	* xlat/crypto_msgs.in: New file.
	* configure.ac (AC_CHECK_TYPES): Check for struct crypto_user_alg.
	* netlink.c: Include "xlat/crypto_msgs.h" with XLAT_MACROS_ONLY defined.
	(netlink_decoders[]): Remove HAVE_LINUX_CRYPTOUSER_H guard around
	[NETLINK_CRYPTO] item.
	* netlink_crypto.c: Remove HAVE_LINUX_CRYPTOUSER_H guard; include
	<linux/cryptouser.h> under HAVE_LINUX_CRYPTOUSER_H; include
	"xlat/crypto_msgs.h" with XLAT_MACROS_ONLY defined.
	[!CRYPTO_MAX_NAME] (CRYPTO_MAX_NAME): New macro.
	(struct_crypto_user_alg, struct_crypto_report_hash,
	struct_crypto_report_cipher, struct_crypto_report_blkcipher,
	struct_crypto_report_aead, struct_crypto_report_rng): New typedefs.
	[HAVE_STRUCT_CRYPTO_USER_ALG]: New static_assert to check
	that sizeof(struct crypto_user_alg) has the expected value.
	[HAVE_STRUCT_CRYPTO_REPORT_HASH]: New static_assert to check
