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/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/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/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.
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.
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.
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.
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.
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
that sizeof(struct crypto_report_hash) has the expected value.
[HAVE_STRUCT_CRYPTO_REPORT_CIPHER]: New static_assert to check
that sizeof(struct crypto_report_cipher) has the expected value.
[HAVE_STRUCT_CRYPTO_REPORT_BLKCIPHER]: New static_assert to check
that sizeof(struct crypto_report_blkcipher) has the expected value.
[HAVE_STRUCT_CRYPTO_REPORT_AEAD]: New static_assert to check
that sizeof(struct crypto_report_aead) has the expected value.
[HAVE_STRUCT_CRYPTO_REPORT_RNG]: New static_assert to check
that sizeof(struct crypto_report_rng) has the expected value.
(decode_crypto_report_hash) [!HAVE_STRUCT_CRYPTO_REPORT_HASH]: Remove.
(decode_crypto_report_hash): Change type of rhash to
struct_crypto_report_hash.
(decode_crypto_report_blkcipher) [!HAVE_STRUCT_CRYPTO_REPORT_BLKCIPHER]:
Remove.
(decode_crypto_report_blkcipher): Change type of rblkcipher to
struct_crypto_report_blkcipher.
(decode_crypto_report_aead) [!HAVE_STRUCT_CRYPTO_REPORT_AEAD]: Remove.
(decode_crypto_report_aead): Change type of raead to
struct_crypto_report_aead.
(decode_crypto_report_rng) [!HAVE_STRUCT_CRYPTO_REPORT_RNG]: Remove.
(decode_crypto_report_rng): Change type of rrng to
struct_crypto_report_rng.
(decode_crypto_report_cipher) [!HAVE_STRUCT_CRYPTO_REPORT_CIPHER]:
Remove.
(decode_crypto_report_cipher): Change type of rcipher to
struct_crypto_report_cipher.
(decode_crypto_user_alg): Change type of alg to struct_crypto_user_alg.
evdev: remove additional indentation level for switch case labels
And while we are here, factor out evdev_write_ioctl_mpers call
out of the switch statement.
* evdev.c (bit_ioctl, evdev_read_ioctl, evdev_ioctl): Remove
one indentation level inside the switch statements.
(evedev_write_ioctl): Remove one indentation level inside the switch
statement; move default branch out of the switch statement.
It is useful in cases where a structure grows over time and we support
decoding of only part of it.
* tests/test_nlattr.h (TEST_NLATTR_OBJECT_EX_, TEST_NLATTR_OBJECT_EX):
Add minsz_ parameter, use it instead of sizeof(obj_).
(TEST_NLATTR_OBJECT): Pass sizeof(obj_) as minsz_.
(TEST_NLATTR_OBJECT_MINSZ): New macro.
* tests/nlattr_crypto_user_alg.c (main): Add proper minsz_ argument to
TEST_NLATTR_OBJECT_EX instances.
defs.h: compact struct tcb a bit by moving currpers field
As reported by pahole, struct tcb has size of 328 bytes and 8 bytes
of holes on x86_64; by moving currpers after qual_flg, both holes are
leminated and the structure fits into 8 cache lines now. This should
also benefit other 64-bit architectures.
* defs.h [SUPPORTED_PERSONALITIES > 1] (struct tcb): Move currpers field
after qual_flg field.
tests: try to avoid false positives in times sanity check
Checking clock_gettime(CLOCK_PROCESS_CPUTIME_ID) starting from the
second iteration may produce false positives sometimes, try to spend
more iterations before starting checking it.
* tests/times.c (NUM_USER_ITERS_SQRT): New enum entity.
(NUM_USER_ITERS): Define via NUM_USER_ITERS_SQRT.
(main): Check i against NUM_USER_ITERS_SQRT first before checking
the returned CPU time for sanity.
Dmitry V. Levin [Wed, 9 Oct 2019 09:24:06 +0000 (09:24 +0000)]
filter_seccomp: fix build on antique systems
Fixed build on systems that do not provide necessary definitions
of AUDIT_ARCH_* constants.
* filter_seccomp.c [PERSONALITY0_AUDIT_ARCH]: Include
"xlat/elf_em.h" and "xlat/audit_arch.h" under XLAT_MACROS_ONLY.
* tests/filter_seccomp-flag.c: Likewise.
* NEWS: Mention this fix.
Fanda Uchytil [Sat, 5 Oct 2019 22:55:13 +0000 (00:55 +0200)]
strace: expand -D option
As of now, despite of being stated that -D option runs strace as a "detached"
grandchild (and the option name being named after "daemon"), strace
still runs in the same process group and session, thus not being
"detached" in a common sense and being subjected to process group kill
and session termination kill. Quoting[1]:
I stumble upon unexpected behavior: if strace is used with option '-D'
(tracer as a detached grandchild) and process (leader) kills whole
process group, it will kill strace too.
It can be easily reproduced by `timeout` from "coreutils":
Here is "strace log" of `strace` inside `timeout`:
strace: Process 30603 attached
wait4(-1, <unfinished ...>) = ?
+++ killed by SIGKILL +++
I think that detached `strace` should not be killed like that -- it
should not be part of former grandparents' "job pipeline".
While this behaviour is not exactly intuitive, it is implemented this
way for quite some time, so it might be relied upon by some of strace
users. In order to address this issue, two new levels of
"daemonisation" are added, that put strace in a separate process group
and session, respectively.
Dmitry V. Levin [Fri, 4 Oct 2019 13:16:33 +0000 (13:16 +0000)]
filter_seccomp: fix build for no-MMU targets
Avoid unsupported fork() call on no-MMU Linux systems to fix
the following link error:
ld: strace-filter_seccomp.o: in function `check_seccomp_filter':
filter_seccomp.c:(.text+0x39a): undefined reference to `fork'
collect2: error: ld returned 1 exit status
* filter_seccomp.c (__gcov_flush, check_seccomp_order_do_child,
check_seccomp_order_tracer): Move under HAVE_FORK guard.
(check_seccomp_order): Move fork code under HAVE_FORK guard.
(check_seccomp_filter_properties): Do not check for NOMMU_SYSTEM.
* NEWS: Mention this fix.
Dmitry V. Levin [Wed, 2 Oct 2019 09:32:26 +0000 (09:32 +0000)]
tests/sigaction: workaround odd libcs on alpha and mips
Apparently, some libcs define SA_RESTORER on alpha and mips
despite of the absence of sa_restorer field. Workaround this
to match the logic implemented in decode_old_sigaction().
* tests/sigaction.c (main) [ALPHA || MIPS]: Do not check decoding
of sa_restorer field.
Dmitry V. Levin [Tue, 1 Oct 2019 09:10:46 +0000 (09:10 +0000)]
tests: fix -a argument in stat and lstat tests
* tests/trace_lstat.in (lstat): Change -a argument from 32 to 31.
* tests/trace_stat.in (stat): Change -a argument from 32 to 30.
* tests/gen_tests.in (lstat): Change -a argument from 32 to 31.
(stat): Change -a argument from 32 to 30.
Commits v5.3~74 and v5.3~73 have introduced an extended syntax
for time interval sizes specification, but the relevant descriotion
was lacking. Fix it by adding the relevant section to the man page
and reference to it in the descriptions of the respective options.
* strace.1.in (.SH OPTIONS): Rewrite descriptions of -O,
-e inject=delay_enter, and -e inject=delay_exit values, refer to section
"Time specification format description".
(.SS "Time specification format description"): New section.
Complements: v5.3~74 "delay: use parse_ts for parsing delay value"
Complements: v5.3~73 "count: use parse_ts for parsing overhead value"
Chen Jingpiao [Mon, 6 Aug 2018 13:58:43 +0000 (21:58 +0800)]
tests: check seccomp-assisted syscall filtering
Test filter_seccomp-perf checks whether seccomp-filter is actually
enabled by comparing the number of syscalls performed in a time interval
when seccomp-filter is enabled vs. disabled. The number of syscalls
should be at least one order of magnitude higher when seccomp-filter
is enabled.
Test filter_seccomp-flag ensures the audit_arch_vec[].flag constants do
not conflict with syscall numbers. If this test fails, then the number
of syscalls grew high enough that the code for seccomp-filter needs to
be updated.
* tests/init.sh (test_prog_set): New function.
* tests/status-none-f.c: New file.
* tests/filter_seccomp.in: Likewise.
* tests/filter_seccomp.sh: Likewise.
* tests/filter_seccomp-perf.c: Likewise.
* tests/filter_seccomp-flag.c: Likewise.
* tests/filter_seccomp-perf.test: New test.
* tests/Makefile.am (EXTRA_DIST): Add filter_seccomp.in and
filter_seccomp.sh.
(MISC_TESTS): Add filter_seccomp-perf.test.
(check_PROGRAMS): Add filter_seccomp-perf and filter_seccomp-flag.
* tests/pure_executables.list: Add status-none-f.
* tests/.gitignore: Add status-none-f, filter_seccomp-perf, and
filter_seccomp-flag.
* tests/gen_tests.in (filter_seccomp, filter_seccomp-flag): New entries.
Co-authored-by: Paul Chaignon <paul.chaignon@gmail.com> Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
Paul Chaignon [Mon, 1 Jul 2019 19:14:15 +0000 (21:14 +0200)]
filter_seccomp: skip seccomp setup when there's nothing to filter
If the trace_set set is complete (no syscalls are filtered), seccomp
filtering is disabled. This patch adds a new is_complete_set_array
function to check whether all sets of a set array are complete.
* number_set.c (is_complete_set_array): New function.
* number_set.h (is_complete_set_array): New prototype.
* filter_seccomp.c (check_seccomp_filter): Skip seccomp setup if there is
nothing to filter.
Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
Chen Jingpiao [Thu, 3 May 2018 13:00:38 +0000 (21:00 +0800)]
Introduce seccomp-assisted syscall filtering
With this patch, strace can rely on seccomp to only be stopped at syscalls
of interest, instead of stopping at all syscalls. The seccomp filtering
of syscalls is opt-in only; it must be enabled with the --seccomp-bpf
option. Kernel support is first checked with check_seccomp_filter(),
which also ensures the BPF program derived from the syscalls to filter
is not larger than the kernel's limit.
The --seccomp-bpf option implies -f, but a warning is emitted if -f is not
explicitly specified. Since a task's children inherit its seccomp
filters, we want to ensure all children are also traced to avoid their
syscalls failing with ENOSYS (cf. SECCOMP_RET_TRACE in seccomp man page).
Fork/vfork/clone children of traced processes are marked as not having a
seccomp filter until we receive a first seccomp-stop. They are therefore
stopped at every syscall entries and exits until that first seccomp-stop.
The current BPF program implements a simple linear match of the syscall
numbers. Contiguous sequences of syscall numbers are however matched as
an interval, with two instructions only. The algorithm can be improved
or replaced in the future without impacting user-observed behavior.
The behavior of SECCOMP_RET_TRACE changed between Linux 4.7 and 4.8
(cf. PTRACE_EVENT_SECCOMP in ptrace man page). This patch supports both
behaviors by checking the kernel's actual behavior before installing the
seccomp filter.
* filter_seccomp.c: New file.
* filter_seccomp.h: New file.
* Makefile.am (strace_SOURCES): Add filter_seccomp.c and
filter_seccomp.h.
* linux/aarch64/arch_defs_.h (PERSONALITY0_AUDIT_ARCH,
PERSONALITY1_AUDIT_ARCH): Define for aarch64.
* linux/powerpc64/arch_defs_.h (PERSONALITY0_AUDIT_ARCH,
PERSONALITY1_AUDIT_ARCH): Likewise for powerpc64.
* linux/s390x/arch_defs_.h (PERSONALITY0_AUDIT_ARCH,
* linux/sparc64/arch_defs_.h (PERSONALITY0_AUDIT_ARCH,
PERSONALITY1_AUDIT_ARCH): Likewise for sparc64.
PERSONALITY1_AUDIT_ARCH): Likewise for s390x.
* linux/tile/arch_defs_.h (PERSONALITY0_AUDIT_ARCH,
PERSONALITY1_AUDIT_ARCH): Likewise for tile.
* linux/x32/arch_defs_.h (PERSONALITY0_AUDIT_ARCH,
PERSONALITY1_AUDIT_ARCH): Likewise for x32.
* linux/x86_64/arch_defs_.h (PERSONALITY0_AUDIT_ARCH,
PERSONALITY1_AUDIT_ARCH, PERSONALITY2_AUDIT_ARCH): Likewise for x86_64.
* linux/ia64/arch_defs_.h (PERSONALITY0_AUDIT_ARCH): Likewise for IA64.
* strace.c (usage): Document --seccomp-bpf option.
(startup_child): Mark process has having seccomp filter.
(exec_or_die): Initialize seccomp filtering if requested.
(init): Handle --seccomp-bpf option and check that seccomp can be
enabled.
(print_debug_info): Handle PTRACE_EVENT_SECCOMP.
(next_event): Capture PTRACE_EVENT_SECCOMP event.
(dispatch_event): Handle PTRACE_EVENT_SECCOMP event.
* trace_event.h (trace_event): New enumeration entity.
* strace.1.in: Document new --seccomp-bpf option.
* NEWS: Mention this change.
Co-authored-by: Paul Chaignon <paul.chaignon@gmail.com> Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
Recognize --help and --version options as aliases to -h and -V options,
respectively.
* strace.c: Include <getopt.h>.
(init): Move short options to optstring, add longopts array, use
getopt_long instead of getopt.
(usage): Document --help and --version options.
* strace.1.in: Likewise.
* tests/strace-V.test: Check that "strace --version" output is the same
as "strace -V" output.
Figure out whether the ioctl code is decoded inside a comment and adjust
printflags/printxval calls accordingly.
* ioctl.c (ioctl_print_code, evdev_decode_number): Add abbrev variable,
set it to true if xlat style is not XLAT_STYLE_VERBOSE, do not provide
dflt and set xlat style to XLAT_STYLE_ABBREV in printflags/printxval
calls (that are now changed to printflags_ex/printxval_ex to accomodate
the change).
PAF_ARRAY_TRUNCATED allows enforcing the fact that an array
is truncated, which is useful for arrays in local memory that are known
as being truncated.
Add support for printing local arrays to print_array
* defs.h (print_array_ex): Describe parameters.
(print_local_array): A wrapper for printing arrays in local memory
via print_array_ex.
* util.c (print_array_ex): Handle case of NULL tfetch_mem_func by
printing elements of array in local memory pointed by start_addr
parameter.
tests: implement ioctl_evdev-success-v.test via ioctl_evdev-success.test
* tests/ioctl_evdev-success-v.test: Remove.
* tests/Makefile.am (DECODER_TESTS): Remove ioctl_evdev-success-v.test.
* tests/gen_tests.in: Add ioctl_evdev-success-v as a wrapper for
ioctl_evdev-success.test.
* tests/ioctl_evdev-success.test: Save "$args" to $prog, increase -a
parameter value to 26 columns, inject "$@" into run_strace arguments,
call $prog instead of axplicit program name.
Paul Chaignon [Sat, 21 Sep 2019 13:00:51 +0000 (15:00 +0200)]
tests: fix format warnings on x32
The type of __X32_SYSCALL_BIT changed from int to unsigned long by Linux
kernel commit v5.3-rc1-1-g45e29d119e9923ff14dfb840e3482bef1667bbfb.
Consequently, __NR_* macros are now defined to values of an unsigned long
integer type on x32.
tests/prctl-seccomp-filter-v.c (PRINT_ALLOW_SYSCALL, PRINT_DENY_SYSCALL):
Fix format warning.
tests/seccomp-filter-v.c (PRINT_ALLOW_SYSCALL, PRINT_DENY_SYSCALL):
Likewise.
Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
When the data to be fetched by vm_read_mem resides in a single memory
page, fetch the whole page and cache it. This implementation caches
up to two memory pages.
* defs.h (invalidate_umove_cache): New prototype.
* strace.c (next_event): Call invalidate_umove_cache.
* ucopy.c (cached_idx, cached_raddr): New static variables.
(process_read_mem): New function.
(vm_read_mem): Use them. Implement fetched page caching.
* tests/umovestr_cached.test: New test.
* tests/Makefile.am (MISC_TESTS): Add umovestr_cached.test.
* tests/umovestr_cached.c: New file.
* tests/pure_executables.list: Add umovestr_cached.
* tests/.gitignore: Likewise.
Rewrite printnum_{slong,ulong,ptr,kptr} using dispatch_{word,klong}size
* defs.h (printnum_long_int, printnum_addr_long_int, printnum_addr_klong_int):
Remove declaration.
(printnum_slong, printnum_ulong): Implement unconditionally using
dispatch_wordsize and opt_wordsize for the last argument.
(printnum_ptr): Implement unconditionally using dispatch_wordsize.
(printnum_kptr): Implement unconditionally using dispatch_klongsize.
* util.c (printnum_long_int, printnum_addr_long_int, printnum_addr_klong_int):
Remove.
* defs.h (set_personality, current_personality, current_wordsize,
current_klongsize, max_addr, max_kaddr): Move upwards.
(opt_wordsize): New macro, calls the first or the second argument
depending on the word size.
(dispatch_wordsize): New macro, calls the first or the second function
with the rest of macro parameters as arguments depending on the word
size.
(opt_klongsize): New macro, calls the first or the second argument
depending on the kernel long size.
(dispatch_klongsize): New macro, calls the first or the second function
with the rest of macro parameters as arguments depending on the kernel
long size.
In the conversion of PRINT_UNKNOWN_TAIL into PRINT_UNKNOWN_TAIL_EX
the usage of sizeof(*(hdr_)) hasn't been replaced to (hdr_size_)
in all places. Offset calculation also had to be changed.
* s390.c (PRINT_UNKNOWN_TAIL_EX): Fix addr and len arguments
in is_filled and print_quoted_string calls.
When strace is built for (32-bit) x86, it has HAVE_STRUCT_USER_DESC
and SUPPORTED_PERSONALITIES == 1, which led to execution of the both
branches. Simplify the logic by including the SUPPORTED_PERSONALITIES
into the condition.
* clone.c (print_tls_arg): Include SUPPORTED_PERSONALITIES into the "if"
condition.
* s390.c (struct sthyi_machine): Add fields reserved_1__, infmplnm;
update comment for the infmval1 field; update the related static_assert.
(struct sthyi_partition): Update infpflg1 comment; update infpval1
comment; add infpplnm field; update the related static_assert.
(struct sthyi_hypervisor): Update infyflg1 field comment; add
infyinsf and infyautf fields; update the related static_assert.
(CHECK_SIZE_EX): Rename from CHECK_SIZE; add min_size_ argument, check size_
against it.
(CHECK_SIZE): New macro, a wrapper for CHECK_SIZE_EX.
(PRINT_UNKNOWN_TAIL_EX): Rename from PRINT_UNKNOWN_TAIL, add hdr_size_
argument.
(PRINT_UNKNOWN_TAIL): New macro, a wrapper for PRINT_UNKNOWN_TAIL_EX.
(print_sthyi_machine): New local variable last_decoded; use
CHECK_SIZE_EX instead of CHECK_SIZE to check against the initial value
of last_decoded; decode reserved_1__ and infmplnm fields if the returned
size indicates that they are present; use PRINT_UNKNOWN_TAIL_EX for
printing structure's tail.
(print_sthyi_partition): New local variable last_decoded; use
CHECK_SIZE_EX instead of CHECK_SIZE to check against the initial value
of last_decoded; decode infpplnm field if the returned size indicates
that it is present; use PRINT_UNKNOWN_TAIL_EX for printing structure's
tail.
(print_funcs): New function.
(print_sthyi_hypervisor): New local variable last_decoded; use
CHECK_SIZE_EX instead of CHECK_SIZE to check against the initial value
of last_decoded; update infyflg1 field decoding; decode infyinsf
and infyautf fields if the returned size indicates that they
are present; use PRINT_UNKNOWN_TAIL_EX for printing structure's tail.
(s390_sthyi): Update specification URL.
* tests/s390_sthyi.c: Update expected output.