summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* xlat: update and provide fallback values to sysctl_* xlatsesyr/linux-5.15Eugene Syromyatnikov2021-10-1311-324/+698
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/xlat/sysctl_kern.in: Remove #(un)conditional, add #value_indexed, add fallback values. (KERN_NRINODE, KERN_MAXINODE, KERN_NRFILE, KERN_MAXFILE, KERN_MAXID, KERN_CAP_BSET, KERN_NFSRNAME, KERN_NFSRADDRS, KERN_JAVA_INTERPRETER, KERN_JAVA_APPLETVIEWER): New constants. * src/xlat/sysctl_net.in: Remove #(un)conditional, add #sorted, add fallback values. * src/xlat/sysctl_net_core.in: Remove #(un)conditional, add #value_indexed, add fallback values. * src/xlat/sysctl_net_ipv4.in: Remove #(un)conditional, replace #sorted with #value_indexed, add fallback values. (NET_TCP_WESTWOOD, NET_TCP_VEGAS, NET_TCP_VEGAS_ALPHA, NET_TCP_VEGAS_BETA, NET_TCP_VEGAS_GAMMA, NET_TCP_BIC, NET_TCP_BIC_FAST_CONVERGENCE, NET_TCP_BIC_LOW_WINDOW): New constants. * src/xlat/sysctl_net_ipv4_conf.in: Remove #(un)conditional, add #value_indexed, add fallback values. (NET_IPV4_CONF_ACCEPT_LOCAL, NET_IPV4_CONF_SRC_VMARK, NET_IPV4_CONF_PROXY_ARP_PVLAN): New constants. * src/xlat/sysctl_net_ipv4_route.in: Remove #(un)conditional, add #value_indexed, add fallback values. * src/xlat/sysctl_net_ipv6.in: Remove #(un)conditional, add #sorted, add fallback values. * src/xlat/sysctl_net_ipv6_route.in: Remove #(un)conditional, add #value_indexed, add fallback values. * src/xlat/sysctl_net_unix.in: Remove #unconditional, add #enum and #include, add fallback values. * src/xlat/sysctl_root.in: Remove #(un)conditional, reorder, add #sorted, add fallback values. (CTL_INOTIFY. CTL_APPLDATA): New constants. * src/xlat/sysctl_vm.in: Remove #(un)conditional, add #sorted, add fallback values. (VM_UNUSED1, VM_UNUSED2, VM_UNUSED3, VM_UNUSED4, VM_UNUSED5, VM_UNUSED6, VM_UNUSED7, VM_UNUSED8, VM_UNUSED9, VM_DROP_PAGECACHE, VM_PERCPU_PAGELIST_FRACTION, VM_ZONE_RECLAIM_MODE, VM_MIN_UNMAPPED, VM_PANIC_ON_OOM, VM_VDSO_ENABLED, VM_MIN_SLAB, VM_CMM_PAGES, VM_CMM_TIMED_PAGES, VM_CMM_TIMEOUT): New constants.
* xlat/gen.sh: generate conditional constant sort order check under presence guardEugene Syromyatnikov2021-10-131-1/+6
| | | | | | | | | | If a constant is conditional and doesn't have a fallback definition, then its value may be undefined, so the sort order check has to be generated under constant-presence-checking #if. * src/xlat/gen.sh (cond_def): Put #if around the check_sort_order call. Fixes: v5.14-75-g5034a5eb4 "xlat/gen.sh: add a compile-time check for sorted xlat order"
* Update ioctl entries from linux v5.15Gleb Fotengauer-Malinovskiy2021-10-136-62/+138
| | | | | | | | | | * src/linux/32/ioctls_inc_align16.h: Update from linux v5.15-rc5 using ioctls_gen.sh. * src/linux/32/ioctls_inc_align32.h: Likewise. * src/linux/32/ioctls_inc_align64.h: Likewise. * src/linux/64/ioctls_inc.h: Likewise. * src/linux/x32/ioctls_inc0.h: Likewise. * NEWS: Mention this.
* tests/pc: avoid program from creating a coredumpRenaud Métrich2021-10-121-0/+4
| | | | | * tests/pc.c: Include <sys/prctl.h>. (main): Clear the dumpable attribute right before raising SIGSEGV.
* xlat: mark some big xlats as #sortedEugene Syromyatnikov2021-10-124-4/+7
| | | | | | | | | * src/xlat/nt_descriptor_types.in: Add #sorted. (NT_FILE, NT_PRXFPREG, NT_SIGINFO): Sort. (NT_TASKSTRUCT): Remove, as it is overshadowed by NT_PRXREG. * src/xlat/sock_sctp_options.in: Add #sorted. * src/xlat/sysctl_net_ipv4.in: Likewise. * src/xlat/v4l2_control_ids.in: Likewise.
* xlat/sock_packet_options: add PACKET_IGNORE_OUTGOINGEugene Syromyatnikov2021-10-122-1/+2
| | | | | | * xlat/sock_packet_options.in (PACKET_IGNORE_OUTGOING): New constant, introduced by Linux commit v4.19-rc2-323-gfa788d986a3a. * NEWS: Mention it.
* xlat: add fallback values to sock_packet_optionsEugene Syromyatnikov2021-10-121-21/+22
| | | | | * xlat/sock_packet_options.in: Add fallback values, mark the xlat as value indexed.
* xlat: add fallback values to sock_ipv6_optionsEugene Syromyatnikov2021-10-121-65/+65
| | | | | | * xlat/sock_ipv6_options.in: Add fallback values, remove IPV6_RECVORIGDSTADDR as it is a synonym to IPV6_ORIGDSTADDR, add "#value_indexed".
* xlat: add fallback values to sock_ip_optionsEugene Syromyatnikov2021-10-121-51/+46
| | | | | | | * src/xlat/sock_ip_options.in: Add fallback values, remove IP_RECVOPTIONS, IP_RECVRETOPTS, IP_RECVDSTADDR, IP_RECVIFINDEX, IP_BROADCAST_IF that are not present in Linux, remove IP_RECVORIGDSTADDR as it is synonymous to IP_ORIGDSTADDR, add "#value_indexed".
* prctl: handle PR_SPEC_L1D_FLUSH PR_[GS]ET_SPECULATION_CTRL prctl sub-commandEugene Syromyatnikov2021-10-124-5/+9
| | | | | | | | | | * src/xlat/pr_spec_cmds.in (PR_SPEC_L1D_FLUSH): New constant, introduced by Linux commit v5.15-rc1~193^2~1. * src/prctl.c (SYS_FUNC(prctl)) <case PR_GET_SPECULATION_CTRL, case PR_SET_SPECULATION_CTRL>: Handle PR_SPEC_L1D_FLUSH in arg2. * tests/prctl-spec-inject.c (prctl-spec-inject): Adjust expected "-a" option value. * tests/prctl-spec-inject.c: Update expected output.
* xlat: add DM_IMA_MEASUREMENT_FLAG to dm_flagsEugene Syromyatnikov2021-10-123-2/+4
| | | | | | | * src/xlat/dm_flags.in (DM_IMA_MEASUREMENT_FLAG): New constant, introduced by Linux commit v5.15-rc1~161^2~14. * tests/ioctl_dm.c: Update expected output. * NEWS: Mention it.
* xlat: update btrfs_features_compat_ro and btrfs_key_typesEugene Syromyatnikov2021-10-123-1/+4
| | | | | | | | * src/xlat/btrfs_features_compat_ro.in (BTRFS_FEATURE_COMPAT_RO_VERITY): New constant, introduced by Linux commit v5.15-rc1~35^2~48. * src/xlat/btrfs_key_types.in (BTRFS_VERITY_DESC_ITEM_KEY, BTRFS_VERITY_MERKLE_ITEM_KEY): Likewise. * NEWS: Mention it.
* src/xlat: add #sorted directive to btrfs_key_typesEugene Syromyatnikov2021-10-121-2/+1
| | | | | | | * src/xlat/btrfs_key_types.in: Add #sorted. (BTRFS_BALANCE_ITEM_KEY, BTRFS_DEV_STATS_KEY): Remove obsolete constants that duplicate BTRFS_TEMPORARY_ITEM_KEY and BTRFS_PERSISTENT_ITEM_KEY, respectively.
* xlat/gen.sh: add a compile-time check for sorted xlat orderEugene Syromyatnikov2021-10-121-2/+37
| | | | | | | | | | | | * src/xlat/gen.sh (check_sort_order): New function. (cond_def): Accept xlat_type parameter, call check_sort_order if xlat_type is XT_SORTED. (gen_header): Call check_sort_order for lines that start with "[A-Z_]*" (only of $unconditional is set to non-empty string: otherwise, call is done inside cond_def), "'1<<'[A-Z_]*", and "[0-9]*" if xlat_type is XT_SORTED. Suggested-by: Dmitry V. Levin <ldv@strace.io>
* xlat: fix constant order in elf_emEugene Syromyatnikov2021-10-121-1/+1
| | | | | | * src/xlat/elf_em.in (EM_CYGNUS_M32R): Move before EM_CYGNUS_V850. Fixes: v5.3~87 "xlat: add elf_em.in"
* tests: try to avoid excessive filter_seccomp-perf false positivesEugene Syromyatnikov2021-10-122-2/+2
| | | | | | | | Increase test time threefold and relax minimum expected ratio a bit. * tests/filter_seccomp-perf.c (main): Set alarm to 3 seconds instead of 1. * tests/filter_seccomp-perf.test (min_ratio): Change from 6 to 5.
* tests: try to make pidns-cache test a bit more robustEugene Syromyatnikov2021-10-121-2/+8
| | | | | | | | | | | Increase SYSCALL_COUNT tenfold in an attempt to get more stable time measurements. While at it, print some additional information about the time spent. * tests/pidns-cache.c (SYSCALL_COUNT): Change from 1000 to 10000. (main): Store original run time in orig_us variable, print it along with the run time under the PID NS test harness in a message to stderr.
* tests/pidns.c: allow skipping tests inside the pidns harnessEugene Syromyatnikov2021-10-121-2/+9
| | | | * tests/pidns.c (pidns_fork): Handle exit code 77 from the child.
* block: decode BLKGETDISKSEQ ioctlEugene Syromyatnikov2021-10-127-0/+7
| | | | | | | | | | | | | Introduced by Linux commit v5.15-rc1~161^2~41. * src/block.c (block_ioctl) <case BLKGETDISKSEQ>: Decode using printnum_in64. * src/linux/32/ioctls_inc_align16.h: Add BLKGETDISKSEQ entry. * 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: Likewse. * tests/ioctl_block.c: Add a check for NULL pointer for BLKGETDISKSEQ.
* xlat: add FAN_REPORT_PIDFD to fan_init_flagsEugene Syromyatnikov2021-10-123-4/+5
| | | | | | | * src/xlat/fan_init_flags.in (FAN_REPORT_PIDFD): New constant, introduced by Linux commit v5.15-rc1~219^2~4. * tests/fanotify_init.c: Update expected output. * NEWS: Mention this.
* io_uring: implement IORING_REGISTER_IOWQ_MAX_WORKERS op decodingEugene Syromyatnikov2021-10-124-2/+76
| | | | | | | | | | | | | | Introduced by Linux commit v5.15-rc1~83^2~22. * src/xlat/uring_iowq_acct.in: New file. * src/io_uring.c: Include "xlat/uring_iowq_acct.h". (print_io_uring_iowq_acct): New function. (SYS_FUNC(io_uring_register)) <case IORING_REGISTER_IOWQ_MAX_WORKERS>: Decode, call print_io_uring_iowq_acct. * src/xlat/uring_register_opcodes.in (IORING_REGISTER_IOWQ_MAX_WORKERS): New constant. * tests/io_uring_register.c: Update expected output, add IORING_REGISTER_IOWQ_MAX_WORKERS checks.
* tests: add io_uring_register-success* testsEugene Syromyatnikov2021-10-128-31/+112
| | | | | | | | | | | | | | | * tests/.gitignore: Add io_uring_register-success, io_uring_register-success-Xabbrev, io_uring_register-success-Xraw, and io_uring_register-success-Xverbose. * tests/Makefile.am (check_PROGRAMS): Likewise. * tests/gen_tests.in (io_uring_register-success, io_uring_register-success-Xabbrev, io_uring_register-success-Xraw, io_uring_register-success-Xverbose): New tests. * tests/io_uring_register-success-Xabbrev.c: New file. * tests/io_uring_register-success-Xraw.c: Likewise. * tests/io_uring_register-success-Xverbose.c: Likewise. * tests/io_uring_register-success.c: Likewise. * tests/io_uring_register.c: Update expected output.
* io_uring: print struct io_cqring_offsets.flags as integer and not flagsEugene Syromyatnikov2021-10-123-10/+5
| | | | | | | | | | | | | Since this is the offset of the cq_flags field in struct io_rings and not the flags themselves. * src/xlat/uring_cqring_flags.in: Remove. * src/io_uring.c: Remove "xlat/uring_cqring_flags.h" include. (print_io_cqring_offsets): Print flags using PRINT_FIELD_U. * tests/io_uring_setup.c: Remove "xlat/uring_cqring_flags.h"; update expected output. Fixes: v5.8~57 "io_uring: Add io_cqring_offset flags"
* io_uring: cap io_uring_probe element count to nargs on exitingEugene Syromyatnikov2021-10-121-3/+5
| | | | | | | | | | | | While a sane kernel would set ops_len to a sane value, its tampering may lead to strace reading out of probe value bounds. While at it, set PAF_ARRAY_TRUNCATED in cases when nargs is less than probe->ops_len. * src/io_uring.c (print_io_uring_probe): Print minimum of nargs and probe->ops_len probe->ops array elements on exiting, set PAF_ARRAY_TRUNCATED flag if nargs is less than probe->ops_len. Fixes: v5.6~94 "io_uring: support IORING_REGISTER_PROBE io_uring_register command"
* util: print ellipsis inside an empty array if PAF_ARRAY_TRUNCATED is setEugene Syromyatnikov2021-10-121-0/+2
| | | | | * src/util.c (print_array_ex) <!nmemb>: Call tprint_more_data_follows() if PAF_ARRAY_TRUNCATED is set in flags.
* io_uring: decode IORING_REGISTER_IOWQ_AFF io_uring_register opEugene Syromyatnikov2021-10-122-0/+69
| | | | | | | * src/io_uring.c (SYS_FUNC(io_uring_register)) <case IORING_REGISTER_IOWQ_AFF>: Decode, call print_affinitylist. * tests/io_uring_register.c: Add checks for IORING_REGISTER_IOWQ_AFF op deocding.
* xlat: update printxvals_ex doxygenEugene Syromyatnikov2021-10-121-6/+7
| | | | * src/xlat.c (printxvals_ex): Update the doxygen comment.
* tests/sched_xetaffinity: add a check for a non-properly-sized CPU setEugene Syromyatnikov2021-10-121-0/+15
| | | | | * tests/sched_xetaffinity.c: Add a check for sched_setaffinity with size of 7 bytes.
* affinity: make print_affinitylist externally availableEugene Syromyatnikov2021-10-122-1/+13
| | | | | | | As it is to be used in other files. * src/affinity.c (print_affinitylist): Remove "static" qualifier. * src/defs.h (print_affinitylist): New declaration.
* affinity: print cpuset of len 0 as "[]"Eugene Syromyatnikov2021-10-122-1/+25
| | | | | | | | To be consistent with print_array_ex behaviour. * src/affinity.c (print_affinitylist): Handle "!len" and "!cpu" cases separately; print "[]" in the former. * tests/sched_xetaffinity.c: Add a check for a cpuset of size 0.
* affinity: use MIN and ROUNDUP macros in print_affinitylistEugene Syromyatnikov2021-10-121-3/+2
| | | | | * src/affinity.c (print_affinitylist): Use MIN macro to calculate umove_size; use ROUNDUP macro to calculate size.
* xlat: no longer interpret NULL xlat as continuationEugene Syromyatnikov2021-10-122-17/+4
| | | | | | | | | | | | | | | | | | | | | | | | This feature, originally introduced by commit v4.23~52 "xlat.c: handle NULL xlat in lookup routines as incremental search", was poorly documented, was of limited use (the only use case was in print_array_ex, introduced in commit v4.23~91 "print_array: add support for printing array indices" (which means that between the two aforementioned commits printing xlats in indices was broken)), of limited value (it was actually useful only for sorted xlats, which are lg2(N) anyway, and even there an iteration from the saved cursor position is preferable for search continuation rather than bsearch), and ultimately was rendered non-operational by commit v5.3~105 "Add xlat description structure". * src/util.c (print_array_ex): Do not pass NULL as xlat in printxval_ex call. * src/xlat.c (xlookup): Remove x local static variable; remove static qualifier from idx and init it to 0; remove x, idx initialisation when xlat in non-NULL; remove xlat argument to x. (printxvals_ex): Remove the last local static variable and related logic. Reverts: v4.23~52 "xlat.c: handle NULL xlat in lookup routines as incremental search"
* io_uring: decode struct io_uring_rsrc_register and io_uring_rsrc_update2Eugene Syromyatnikov2021-10-122-2/+430
| | | | | | | | | | | | | * src/io_uring.c (print_io_uring_rsrc_data, print_io_uring_rsrc_tags, print_io_uring_register_rsrc, print_io_uring_update_rsrc): New functions. (SYS_FUNC(io_uring_register)) <case IORING_REGISTER_FILES2, case IORING_REGISTER_BUFFERS2>: Call print_io_uring_register_rsrc. (SYS_FUNC(io_uring_register)) <case IORING_REGISTER_FILES_UPDATE2, case IORING_REGISTER_BUFFERS_UPDATE>: Call print_io_uring_update_rsrc. * tests/io_uring_register.c (BIG_ADDR_MASK): New macro. (path_null, path_full): New constants, moved out of main. (print_rsrc_data, print_rsrc_tags): New functions. (main): Add checks for new decoders.
* io_uring: decode IORING_REGISTER_FILES_SKIP in IORING_REGISTER_FILES_UPDATEEugene Syromyatnikov2021-10-123-4/+24
| | | | | | | | | | Introduced by Linux commit v5.12~270^2~95. * src/xlat/uring_files_update_fds.in: New file. * src/io_uring.c (print_files_update_array_member): New function. (print_io_uring_files_update): Use print_files_update_array_member instead of print_fd_array_member. * tests/io_uring_register.c: Add checks for printing of fds -1, -2, -3.
* io_uring: deсode IORING_REGISTER_RESTRICTIONS io_uring_register opEugene Syromyatnikov2021-10-125-1/+264
| | | | | | | | | | | | | | Implemented in Linux commit v5.10-rc1~167^2~51. * src/io_uring.c (print_io_uring_restriction, print_io_uring_restrictions): New functions. (SYS_FUNC(io_uring_register)) <case IORING_REGISTER_RESTRICTIONS>: New decoder, calls print_io_uring_restrictions. * src/xlat/uring_restriction_opcodes.in: New file. * src/xlat/uring_sqe_flags.in: Likewise. * tests/io_uring_register.c: Add checks for IORING_REGISTER_RESTRICTIONS. * NES: Mention this.
* src: use is_bigendianEugene Syromyatnikov2021-10-122-12/+3
| | | | | | | | * src/disable_ptrace_request.c (ARG_OFFSET): Remove. (main): Use is_bigendian-conditioned ternary operator instead of ARG_OFFSET. * src/sockaddr.c (btohs): Conditionalise return value on is_bigendian value.
* tests: add io_uring_register-X* testsEugene Syromyatnikov2021-10-127-52/+100
| | | | | | | | | | | | | * tests/.gitignore: Add io_uring_register-Xabbrev, io_uring_register-Xraw, and io_uring_register-Xverbose. * tests/pure_executables.list: Likewise. * tests/gen_tests.in (io_uring_register-Xabbrev, io_uring_register-Xraw, io_uring_register-Xverbose): Add tests. * tests/io_uring_register-Xabbrev.c: New file. * tests/io_uring_register-Xraw.c: Likewise. * tests/io_uring_register-Xverbose.c: Likewise. * tests/io_uring_register.c: Update to produce output in accordance with XLAT_* definitions presence.
* xlat: update uring_opsEugene Syromyatnikov2021-10-123-7/+10
| | | | | | | | | | | * src/xlat/uring_ops.in (IORING_OP_MKDIRAT): New constant, introduced by Linux commit v5.15-rc1~184^2~2. (IORING_OP_SYMLINKAT): New constant, introduced by Linux commit v5.15-rc1~184^2~1. (IORING_OP_LINKAT): New constant, introduced by Linux commit v5.15-rc1~184^2. * tests/io_uring_register.c: Update expected output. * NEWS: Mention it.
* io_uring: explicitly list io_uring_register ops without argEugene Syromyatnikov2021-10-112-0/+9
| | | | | | | | | | * src/io_uring.c (SYS_FUNC(io_uring_register)): Add IORING_UNREGISTER_BUFFERS, IORING_UNREGISTER_FILES, IORING_UNREGISTER_EVENTFD, IORING_REGISTER_PERSONALITY, IORING_UNREGISTER_PERSONALITY, IORING_REGISTER_ENABLE_RINGS, and IORING_UNREGISTER_IOWQ_AFF to the opcode switch statement. * tests/io_uring_register.c: Add checks for IORING_REGISTER_ENABLE_RINGS and IORING_UNREGISTER_IOWQ_AFF.
* io_uring: sort xlat includes lexicographicallyEugene Syromyatnikov2021-10-111-2/+2
| | | | | | * src/io_uring.c: Move "xlat/uring_enter_flags.h" and "xlat/uring_cqring_flags.h" forward to establish a lexicographical order of includes.
* defs: update print_array_ex doxygenEugene Syromyatnikov2021-10-111-13/+16
| | | | | | | | | | | | | | This change updates the description of index_xlat (as xlat is no longer a naked array, but rather a description structure), removes index_xlat_size description, and adds description for the return value semantics. Interestingly, the change that introduced index_xlat_size description (v5.3~15 "Add support for printing local arrays to print_array") was applied after the change that removed the argument (v5.3~105 "Add xlat description structure"). Complements: v5.3~15 "Add support for printing local arrays to print_array" * src/defs.h (print_array_ex): Update description.
* util: unify differently-sized variants of print_{,u,x}int_array_memberEugene Syromyatnikov2021-10-1135-169/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Different functions are more or less unnecessary, since the argument size is passed in elem_size parameter anyway, and without any check of it the only thing differently-sized function variants do is concealing the discrepancies between the printed and fetched element size (as it was with bpf_prog_info.map_ids). All the callers are updated automatically using sed -i 's/print_\([xu]\)\?int\(8\|16\|32\|64\)_array_member/print_\1int_array_member/g' \ `git grep -l 'print_.*int.*_array_member'` with additional manual cleanup in src/linux/*/arch_*.c. * src/defs.h (print_int8_array_member, print_uint8_array_member, print_xint8_array_member, print_int32_array_member, print_uint32_array_member, print_xint32_array_member, print_uint64_array_member, print_xint64_array_member, print_xlong_array_member, print_kulong_array_member): Remove. (print_int_array_member, print_uint_array_member, print_xint_array_member): New declarations. * src/util.c (print_int8_array_member, print_uint8_array_member, print_xint8_array_member, print_int32_array_member, print_uint32_array_member, print_xint32_array_member, print_uint64_array_member, print_xint64_array_member): Remove. (print_int_array_member, print_uint_array_member, print_xint_array_member): New functions. * src/bpf.c (print_bpf_prog_info, BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)): Use print_uint_array_member instead of print_uint32_array_member. * src/btrfs.c (btrfs_print_qgroup_inherit): Use print_uint_array_member instead of print_uint64_array_member. * src/clone.c (SYS_FUNC(clone3)): Use print_int_array_member instead of print_int32_array_member. * src/evdev.c (decode_bitset): Use print_xint_array_member instead of print_xlong_array_member. (mtslots_ioctl): Use print_int_array_member instead of print_int32_array_member. * src/gpio_ioctl.c (print_gpiohandle_request): Use print_uint_array_member instead of print_uint32_array_member and print_uint8_array_member. (print_gpiohandle_data, print_gpiohandle_set_config): Use print_uint_array_member instead of print_uint8_array_member. (print_gpio_v2_line_request): Use print_uint_array_member instead of print_uint32_array_member. * src/io_uring.c (SYS_FUNC(io_uring_setup), print_io_uring_probe): Use print_xint_array_member instead of print_xint32_array_member. * src/keyctl.c (keyctl_dh_compute, print_pkey_query, fetch_print_pkey_params): Likewise. * src/msghdr.c (print_cmsg_uint): Use print_uint_array_member instead of print_uint32_array_member. (print_cmsg_xint8_t): Use print_xint_array_member instead of print_xint8_array_member. * src/mtd.c (print_xint32x2_array_member, decode_nand_oobinfo, decode_nand_ecclayout_user): Use print_xint_array_member instead of print_xint32_array_member. * src/net.c (print_getsockopt): Use print_uint_array_member instead of print_uint32_array_member. * src/nlattr.c (decode_nla_meminfo): Likewise. * src/numa.c (SYS_FUNC(move_pages)): Use print_int_array_member instead of print_int32_array_member. * src/perf_ioctl.c (perf_ioctl_query_bpf): Use print_uint_array_member instead of print_uint32_array_member. * src/print_statfs.c (print_f_fsid): Use print_xint_array_member instead of print_xint64_array_member. * src/ptrace_syscall_info.c (print_psi_entry, print_psi_seccomp): Likewise. * src/rtnl_link.c (decode_ifla_bridge_id): Use print_uint_array_member instead of print_uint8_array_member. (decode_ifla_inet_conf, decode_ifla_inet6_conf): Use print_int_array_member instead of print_int32_array_member. (decode_ifla_inet6_stats, decode_ifla_inet6_icmp6_stats): Use print_uint_array_member instead of print_uint64_array_member. * src/seccomp_ioctl.c (print_struct_seccomp_data): Use print_xint_array_member instead of print_xint64_array_member. * src/sysinfo.c (SYS_FUNC(sysinfo)): Use print_uint_array_member instead of print_kulong_array_member. * src/v4l2.c (print_v4l2_queryctrl): Use print_xint_array_member instead of print_xint32_array_member. (print_v4l2_query_ext_ctrl): Use print_uint_array_member instead of print_uint32_array_member; use print_xint_array_member instead of print_xint32_array_member. * src/linux/aarch64/arch_prstatus_regset.c (arch_decode_prstatus_regset): Use print_xint_array_member instead of print_xint64_array_member. * src/linux/arm/arch_prstatus_regset.c (arch_decode_prstatus_regset): Use print_xint_array_member instead of print_xint32_array_member. * src/linux/i386/arch_fpregset.c (arch_decode_fpregset): Likewise. * src/linux/mips/arch_prstatus_regset.c (arch_decode_prstatus_regset): Use print_xint_array_member instead of print_xint32_array_member and print_xint64_array_member. * src/linux/mips/arch_pt_regs.c (arch_decode_pt_regs): Use print_xint_array_member instead of print_xint64_array_member. * src/linux/powerpc/arch_fpregset.c (arch_decode_fpregset): Likewise. * src/linux/powerpc/arch_prstatus_regset.c (arch_decode_prstatus_regset): Use print_xint_array_member instead of print_xint32_array_member and print_xint64_array_member. * src/linux/powerpc/arch_pt_regs64.c (decode_pt_regs64): Use print_xint_array_member instead of print_xint64_array_member * src/linux/s390/arch_prstatus_regset.c (arch_decode_prstatus_regset): Use print_xint_array_member instead of print_xint32_array_member and print_xint64_array_member. (arch_decode_prstatus_regset): Use print_xint_array_member instead of print_xint32_array_member. * src/linux/sparc/arch_prstatus_regset.c (arch_decode_prstatus_regset): Use print_xint_array_member instead of print_xint32_array_member. * src/linux/sparc/arch_pt_regs.c (arch_decode_pt_regs): Likewise. * src/linux/sparc64/arch_prstatus_regset.c (arch_decode_prstatus_regset): Use print_xint_array_member instead of print_xint64_array_member. * src/linux/sparc64/arch_pt_regs64.c (decode_pt_regs64): Likewise. * src/linux/x86_64/arch_fpregset.c (arch_decode_fpregset): Use print_xint_array_member instead of print_xint32_array_member.
* bpf: fix bpf_prog_info.map_ids array printingEugene Syromyatnikov2021-10-113-87/+150
| | | | | | | | | | | | | | map_id_buf had an incorrect storage size (8 bytes instead of 4), which led to incorrect fetching of map_ids array elements, so only odd/even-indexed elements (on big/little-endian architectures, respectively) were printed. * src/bpf.c (print_bpf_prog_info): Change map_id_buf type from uint64_t to uint32_t. * tests/bpf-obj_get_info_by_fd.c: Create second bpf map, use it in the bpf program, and add additional checks regarding map_ids printing. * NEWS: Mention this. Fixes: v4.23~99 "bpf: decode bpf_attr.info field used by BPF_OBJ_GET_INFO_BY_FD command"
* Decode process_mrelease syscallEugene Syromyatnikov2021-10-118-0/+84
| | | | | | | | | | | | | | Introduced by Linux commits v5.14-159-g884a7e5964e0 and v5.14-160-gdce491039628. * src/linux/generic/syscallent-common.h ([BASE_NR + 448]): Add process_mrelease syscall entry. * src/mem.c (SYS_FUNC(process_mrelease)): New syscall decoder. * tests/.gitignore: Add process_mrelease and process_mrelease-y. * tests/gen_tests.in (process_mrelease, process_mrelease-y): New tests. * tests/process_mrelease.c: New file. * tests/process_mrelease-y.c: Likewise. * NEWS: Mention it.
* xlat: add MPOL_PREFERRED_MANY to mpol_modesEugene Syromyatnikov2021-10-114-11/+19
| | | | | | | | * src/xlat/mpol_modes.in (MPOL_PREFERRED_MANY): New constant, introduced by Linux commit v5.14-152-gb27abaccf8e8. * tests/mbind.c: Add MPOL_PREFERRED_MANY check, update expected output. * tests/set_mempolicy.c: Likewise. * NEWS: Mention the change.
* bundled: update linux UAPI headers to v5.15-rc4Dmitry V. Levin2021-10-1015-12/+148
| | | | | | | | | | | | | | | | | | | | * bundled/linux/include/uapi/linux/btrfs.h: Update to headers_install'ed Linux kernel v5.15-rc4. * bundled/linux/include/uapi/linux/btrfs_tree.h: Likewise. * bundled/linux/include/uapi/linux/dm-ioctl.h: Likewise. * 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/in6.h: Likewise. * bundled/linux/include/uapi/linux/io_uring.h: Likewise. * bundled/linux/include/uapi/linux/mount.h: Likewise. * bundled/linux/include/uapi/linux/netfilter/nfnetlink_conntrack.h: Likewise. * bundled/linux/include/uapi/linux/pkt_sched.h: Likewise. * bundled/linux/include/uapi/linux/prctl.h: Likewise. * bundled/linux/include/uapi/linux/socket.h: Likewise. * bundled/linux/include/uapi/linux/v4l2-controls.h: Likewise. * bundled/linux/include/uapi/linux/version.h: Likewise.
* tests: use BE_LE macro in more placesEugene Syromyatnikov2021-10-095-64/+19
| | | | | | | | | | | It makes reading the code where only little pieces are switched on WORDS_BIGENDIAN a little bit easier. * tests/io_uring_register.c (BE_LE): Move it... * tests/tests.h (BE_LE): ...here. * tests/bpf.c (bpf_attr_check): Use BE_LE instead of #ifdef WORDS_BIGENDIAN. * tests/clone3.c: Likewise. * tests/nlattr_ifla_linkinfo.c: Likewise.
* tests/test_nlattr.h: helper macros for integer attr testingEugene Syromyatnikov2021-10-091-0/+49
| | | | | | | | | | It is one of the most common attribute type decoder flavours, so it should be as trivial to test as possible. * tests/test_nlattr.h (DEF_NLATTR_INTEGER_CHECK_, TEST_NLATTR_VAL): New macros. (check_u32_nlattr, check_x32_nlattr): New functions, defined using DEF_NLATTR_INTEGER_CHECK_.
* tests/test_nlattr.h: provide TEST_NLATTR_OBJECT_ and TEST_NLATTR_ARRAY_Eugene Syromyatnikov2021-10-091-7/+25
| | | | | | | | | | So they can be used along with custom nla_type string format. * tests/test_nlattr.h (TEST_NLATTR_OBJECT_): New macro, a wrapper for TEST_NLATTR_OBJECT_EX_. (TEST_NLATTR_ARRAY_): Rename from TEST_NLATTR_ARRAY, add nla_type_str_ argument. (TEST_NLATTR_ARRAY): New macro, a wrapper for TEST_NLATTR_ARRAY_.
* tests/tests.h: add struct strval16 typeEugene Syromyatnikov2021-10-091-0/+5
| | | | | | Analogous to strval32 and strval64. * tests/tests.h (struct strval16): New type.