7238 Commits

Author SHA1 Message Date
Eugene Syromyatnikov
420b631687 printsiginfo: decode IA-64-specific siginfo_t fields
* xlat/ia64_siginfo_si_flags.in: New file.
* printsiginfo.c [IA64]: Include xlat/ia64_siginfo_si_flags.h.
[IA64] (print_si_info): Decode si_imm, si_flags, and si_isr fields
for fault signals.
2018-11-25 14:11:54 +01:00
Eugene Syromyatnikov
a6ace08dbc printsiginfo: decode si_trapno
* xlat/alpha_gentrap.in: New file.
* configure.ac (AC_CHECK_MEMBERS): Add check for siginfo_t.si_trapno.
* printsiginfo.c [ALPHA]: Include <asm/gentrap.h>, "xlat/alpha_gentrap.h".
(print_si_info): Add SIGTRAP to the SIGILL/SIGFPE/SIGSEGV/SIGBUS/SIGEMT
case.
[HAVE_SIGINFO_T_SI_TRAPNO] (print_si_info) <case SIGTRAP>: Decode
si_trapno field.
2018-11-25 13:38:31 +01:00
Eugene Syromyatnikov
e44ae68ae4 printsiginfo: decode SIGEMT the same way as SIG{ILL,FPE,SEGV,BUS}
* printsiginfo.c (print_si_info) [SIGEMT] <case SIGEMT>: Add
to the SIGILL/SIGFPE/SIGSEGV/SIGBUS case.
2018-11-25 13:25:47 +01:00
Eugene Syromyatnikov
5338aecfa9 printsiginfo: use print_err for error number printing
* printsiginfo.c (print_si_info): use print_err instead of open-coding
error constant printing.
2018-11-25 12:51:23 +01:00
Eugene Syromyatnikov
05de794953 fixup! printsiginfo: decode FASYNC (O_ASYNC) signals 2018-11-25 11:05:56 +01:00
Eugene Syromyatnikov
9c26fb26e3 fixup! strace: use sprintsignal for converting signal number to string 2018-11-25 11:04:47 +01:00
Eugene Syromyatnikov
ce76cd330d printsiginfo: decode FASYNC (O_ASYNC) signals
* printsiginfo.c (print_fasync_info): New function.
(print_si_info): Add tcp argument.
(print_si_info) <case SI_SIGIO, case SIGPOLL>: Call print_fasync_info.
(printsiginfo): Add tcp argument, pass it to the print_si_info call.
(printsiginfo_at, print_siginfo_t): Pass tcp argument to printsiginfo
calls.
* printsiginfo.h (printsiginfo): Update declaration.
2018-11-25 11:02:13 +01:00
Eugene Syromyatnikov
b53717e034 printsiginfo: factor out syscall constant name printing
* printsiginfo.c (print_scconst); New function.
(print_si_info) <case SIGSYS>: Call print_scconst for si_syscall
printing.
2018-11-25 10:48:33 +01:00
Eugene Syromyatnikov
7bfd2375ff printsiginfo: dispatch signal code names using an array
* printsiginfo.c (print_si_code): Consolidate xlat pointers into an
array, dispatch over it using si_code.
2018-11-25 10:40:47 +01:00
Eugene Syromyatnikov
57098d88c2 xlat: add audit_arch_flags
For now, it's just a source for audit_flags fallback values.

* xlat/audit_arch_flags.in: New file.
* printsiginfo.c: Include xlat/audit_arch_flags.h.
2018-11-22 18:05:54 +01:00
Eugene Syromyatnikov
ce9d5044c8 xlat: add elf_em.in
For now, it's a source of fallback values for AUDIT_ARCH_* constants.

* xlat/elf_em.in: New file.
* printsiginfo.c: Include "xlat/elf_em.h"
2018-11-22 10:45:02 +01:00
Eugene Syromyatnikov
7657246b59 xlat/sock_ipv6_options: add IPV6_MULTICAST_ALL
* xlat/sock_ipv6_options.in (IPV6_MULTICAST_ALL): New constant,
introduced by Linux commit v4.19-rc3-454-g15033f0457dc.
2018-11-21 14:38:14 +01:00
Eugene Syromyatnikov
76eea4699e xlat/v4l2_control_types: add V4L2_CTRL_TYPE_MPEG2_*
* xlat/v4l2_control_types.in (V4L2_CTRL_TYPE_MPEG2_SLICE_PARAMS,
V4L2_CTRL_TYPE_MPEG2_QUANTIZATION): New constants, introduced by Linux
commit v4.19-rc1-74-gc27bb30e7b6d.
2018-11-21 14:38:14 +01:00
Eugene Syromyatnikov
a1d541c26a xlat/v4l2_control_types: add fallback values, #sorted
* xlat/v4l2_control_types.in: Add fallback values and "#sorted".
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
4ef7513055 xlat/v4l2_pix_fmts: add V4L2_PIX_FMT_SUNXI_TILED_NV12
* xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_SUNXI_TILED_NV12): New constant,
introduced by Linux commit v4.19-rc1-75-g36cf35b78640.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
91ab71f387 xlat/evdev_abs: add ABS_RESERVED
* xlat/evdev_abs.in (ABS_RESERVED): New constant, introduced by Linux
commit v4.18-10855-gd9ca1c990a7f.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
9e9071d615 xlat/evdev_relative_axes: add REL_RESERVED and REL_WHEEL_HI_RES
* xlat/evdev_relative_axes.in (REL_RESERVED): New constant, introduced
by Linux commit v4.18-10855-gd9ca1c990a7f.
(REL_WHEEL_HI_RES): New constant, introduced by Linux commit
v4.18-10849-gaaf9978c3c02 and updated by Linux commit
v4.18-10855-gd9ca1c990a7f.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
d6d103b4fa xlat/fan_init_flags: add FAN_REPORT_TID
* xlat/fan_init_flags.in (FAN_REPORT_TID): New constant, introduced
by Linux commit v4.19-rc2-16-gd0a6a87e40da.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
776043f4cc xlat/fan_init_flags: whitespace
* xlat/fan_init_flags.in: Replace spaces with tabs.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
e7b9424cac xlat: update kvm_cap
* xlat/kvm_cap.in (KVM_CAP_PPC_NESTED_HV): New constant, introduced
by Linux commit v4.19-rc4-286-gaa069a996951.
(KVM_CAP_HYPERV_SEND_IPI): New constant, introduced by Linux commit
v4.19-rc4-328-g214ff83d4473.
KVM_CAP_COALESCED_PIO): New constant, introduced by Linux commit
v4.19-rc4-369-g0804c849f1df.
(KVM_CAP_HYPERV_ENLIGHTENED_VMCS): New constant, introduced by Linux
commit v4.19-rc4-375-g57b119da3594.
(KVM_CAP_EXCEPTION_PAYLOAD): New constant, introduced by Linux commit
v4.19-rc4-392-gc4f55198c7c2.
(KVM_CAP_ARM_VM_IPA_SIZE): New constant, introduced by Linux commit
v4.19-rc5-18-g233a7cb23531 and updated by Linux commit
v4.19-rc5-215-ge42b4a507efa.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
d20c0c7804 xlat/sock_packet_options: add PACKET_IGNORE_OUTGOING
* xlat/sock_packet_options.in (PACKET_IGNORE_OUTGOING): New constant,
introduced by Linux commit v4.19-rc2-323-gfa788d986a3a.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
b84f967d27 xlat/rtnl_addr_attrs: add IFA_TARGET_NETNSID
* xlat/rtnl_addr_attrs.in (IFA_TARGET_NETNSID): New constant, introduced
by Linux commit v4.19-rc2-337-g9f3c057c146f.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
ad40a98f06 xlat: update neighbor_cache_entry_flags
* xlat/neighbor_cache_entry_flags.in (NTF_OFFLOADED): New constant,
introduced by Linux commit v4.13-rc1~157^2~252^2~13.
(NTF_STICKY): New constant, introduced by Linux commit
v4.19-rc2-432-g435f2e7cc0b7.
(NTF_USE, NTF_SELF, NTF_MASTER, NTF_PROXY, NTF_EXT_LEARNED, NTF_ROUTER):
Add fallback value.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
8a268ad962 xlat: add flow dissector bpf program type constants
Introduced by Linux commit v4.19-rc2-341-gd58e468b1112.

* xlat/bpf_attach_type.in (BPF_FLOW_DISSECTOR): New constant.
* xlat/bpf_prog_types.in (BPF_PROG_TYPE_FLOW_DISSECTOR): Likewise.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
161121a3d2 rtnl_tc: add TCA_STATS_BASIC_HW
* xlat/rtnl_tca_stats_attrs.in (TCA_STATS_BASIC_HW): New constant,
introduced by v4.19-rc4-670-g5e111210a443.
* rtnl_tc.c (tca_stats_nla_decoders): Add TCA_STATS_BASIC_HW.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
6141608483 xlat/sock_netlink_options: add NETLINK_DUMP_STRICT_CHK
* xlat/sock_netlink_options.in (NETLINK_DUMP_STRICT_CHK): New constant,
introduced by Linux commit v4.19-rc6-1866-g89d35528d17d.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
74d0cad5dd xlat/rtnl_ifla_info_data_bridge_attrs: add IFLA_BR_VLAN_STATS_PER_PORT
* xlat/rtnl_ifla_info_data_bridge_attrs.in
(IFLA_BR_VLAN_STATS_PER_PORT): New constant, introduced by Linux commit
v4.19-rc6-2094-g9163a0fc1f0c.
* rtnl_link.c (ifla_info_data_bridge_nla_decoders): Add
IFLA_BR_VLAN_STATS_PER_PORT.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
504b43651c xlat/fsmagic: rename XFS_SB_MAGIC to XFS_SUPER_MAGIC
Per Linux commit v4.19-rc1-28-gdddde68b8f06.

* xlat/fsmagic.in (XFS_SUPER_MAGIC): Rename from XFS_SB_MAGIC.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
b45562e897 xlat: convert fsmagic to a regular form
As xlat/gen.sh supports fallback definitions and sorted xlats now,
there's no need for raw definitions in fsmagic xlat.

* xlat/fsmagic.in: convert to a regular form.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
e6e005f70c Decode UID/GID in -y mode
* defs.h (RVAL_UID, RVAL_GID): New macro constants.
(printgid): New function declaration.
* ipc_msgctl.c (print_msqid_ds, print_msqid_ds): Use printgid for
printing GID.
* ipc_shmctl.c (print_shmid_ds, print_shmid_ds): Likewise.
* keyctl.c (keyctl_chown_key): Likewise.
* nlattr.c (decode_nla_gid): Likewise.
* linux/dummy.h (sys_getgid, sys_getgid16, sys_getresgid,
sys_getresgid16, sys_setfsgid, sys_setfsgid16, sys_setgid, sys_setgid16,
sys_setregid, sys_setregid16, sys_setresgid, sys_setresgid16): Remove
macros.
(sys_getegid): Define to sys_getgid instead of sys_getuid.
(sys_getegid16): Define to sys_getgid16 instead of sys_geteuid16.
* linux/syscall.h (getresgid16, getgid16, setfsgid16, setresgid16,
setregid16, setgid16): New external SYS_FUNC declarations.
* msghdr.c (print_scm_creds); Use PRINT_FIELD_GID for printing GID.
* net.c (print_get_ucred): Likewise.
* netlink_inet_diag.c (decode_inet_diag_msg): Likewise.
* netlink_smc_diag.c (decode_smc_diag_msg): Likewise.
* print_fields.h (PRINT_FIELD_UID); Use printuid for printing UID.
(PRINT_FIELD_GID): New macro.
* print_struct_stat.c (print_struct_stat): Use printuid for printing
UID, printgid for printing GID.
* printsiginfo.c (printsigsource): Use printuid for printing UID.
* resource.c (print_priority_who): New function.
(SYS_FUNC(getpriority), SYS_FUNC(setpriority)): Use print_priority_who
for printing the second argument.
* statx.c (SYS_FUNC(statx)): Use PRINT_FIELD_UID for printing UID,
PRINT_FIELD_GID for printing GID.
* syscall.c (syscall_exiting_trace): Handle RVAL_UID and RVAL_GID.
* tests/overflowuid.c: Include stdio.h.
(printuid): New function.
* tests/setfsugid.c (printugid): Rename from printuid, update call
sites.
* tests/setgroups.c: Likewise.
* tests/setugid.c: Likewise.
* tests/tests.h (printuid): New declaration.
* uid.c (printgid, sys_getresgid, sys_getgid, sys_setfsgid,
sys_setresgid, sys_setregid, sys_setgid): Add SIZEIFY wrappers.
(gid_t, gid_t_, gid_t__): Define similarly to uid_t, uid_t_, uid_t__.
Include grp.h, pwd.h, sys/types.h.
(enum id_type): New enumeration.
(SYS_FUNC(getuid), SYS_FUNC(setfsuid), ): Return RVAL_UID flag.
(SYS_FUNC(getgid), SYS_FUNC(setfsgid), SYS_FUNC(setgid),
SYS_FUNC(getresgid), SYS_FUNC(setregid), SYS_FUNC(setresgid)): New
functions.
(get_print_id): Rename from get_print_uid, add idt argument, call
printuid or printgid depending on it. Update call sites.
(SYS_FUNC(chown), SYS_FUNC(fchown), print_gid): Use printgid
for printing GID.
(ID_CACHE_SIZE): New macro constant.
(print_id): New function.
(printuid): Implement using print_id.
(printgid): New function.
* xlat/priorities.in: Provide fallback values.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
ce366255c5 loop: use XLAT_MACROS_ONLY instead of #stop
As the former allows controlling presence of xlat definitions
during the inclusion and not header generation.

* xlat/loop_cmds.in: remove #stop.
* loop.c: Wrap "xlat/loop_cmds.h" inclusion in XLAT_MACROS_ONLY.
* tests/ioctl_loop.c: Likewise.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
826306c987 linux/mips/get_syscall_args.c: print an error message on fetch error
Instead of failing silently.

* linux/mips/get_syscall_args.c (get_syscall_args): Print an error message
when umoven fails.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
2f46f33384 linux/hppa/syscallent.h: add a comment about old name of syscall 102
Also, remove empty definition.

* linux/hppa/syscallent.h ([102]): Remove (empty) definition, add
a comment that it was socketcall.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
1d46db4207 linux/mips/syscallent-o32.h: entry 4221 is actually called "reserved221" 2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
12f618552a fixup! ptp: update decoder 2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
606a8f39e8 fcntl: decode F_GETOWNER_UIDS
* fcntl.c (print_owner_uids): New function.
(print_fcntl) <case F_GETOWNER_UIDS>: Decode command using
print_owner_uids.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
7908a872ba netlink_inet_diag: implement INET_DIAG_MD5SIG attribute decoding
* linux/inet_diag.h (INET_DIAG_MD5SIG): New enum entity.
(TCP_MD5SIG_MAXKEYLEN): New macro.
(struct tcp_diag_md5sig): New type definition.
* netlink_inet_diag.c (decode_tcp_md5sig): New function.
(inet_diag_msg_nla_decoders) <[INET_DIAG_MD5SIG]>: New attribute,
decoded by decode_tcp_md5sig.
* xlat/inet_diag_attrs.in (INET_DIAG_MD5SIG): New constant.
* xlat/inet_diag_extended_flags.in (1<<(INET_DIAG_MD5SIG-1)): New flag.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
d1f4b528cb fcntl: decode read/write hints commands
Introduced by Linux commit v4.13-rc1~212^2~51.

* xlat/fcntl_rw_hints.in: New file.
* fcntl.c: Include "xlat/fcntl_rw_hints.h".
(print_rwhint): New function.
(print_fcntl) <case F_SET_RW_HINT, case F_SET_FILE_RW_HINT, case
F_GET_RW_HINT, case F_GET_FILE_RW_HINT>: New fcntl command handlers.
* xlat/fcntlcmds.in (F_GET_RW_HINT, F_SET_RW_HINT, F_GET_FILE_RW_HINT,
F_SET_FILE_RW_HINT): New constants.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
48a84accf6 fixup! Check PTP API fields 2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
4a602e8962 ptp: update decoder
* xlat/ptp_ioctl_cmds.in: New file.
* xlat/ptp_pin_funcs.in: Likewise.
* xlat/ptp_flags_options.in: Add fallback values.
* ptp.c [HAVE_STRUCT_PTP_SYS_OFFSET]: Remove #ifdef.
Include "ptp_clock.h" instead of <linux/ptp_clock.h>.
Include "xlat/ptp_ioctl_cmds.h" undef XLAT_MACROS_ONLY.
Include "xlat/ptp_pin_funcs.h".
(print_ptp_clock_time): New function.
(PRINT_FIELD_PTP_CLOCK_TIME, PRINT_FIELD_RSV): New macros.
(ptp_ioctl) <case PTP_EXTTS_REQUEST>: Use struct
strace_ptp_extts_request instead of struct ptp_extts_request; print
index field as unsined, print rsv field using PRINT_FIELD_RSV.
(ptp_ioctl) <case PTP_PEROUT_REQUEST>: Use struct
strace_ptp_perout_request instead of struct ptp_perout_request; print
start and period fields using PRINT_FIELD_PTP_CLOCK_TIME; print rsv
field using PRINT_FIELD_RSV.
(ptp_ioctl) <case PTP_ENABLE_PPS>: Print arg as unsigned.
(ptp_ioctl) <case PTP_SYS_OFFSET>: Use struct strace_ptp_sys_offset
instead of struct ptp_sys_offset; print rsv field using PRINT_FIELD_RSV;
print time stamps using print_ptp_clock_time.
(ptp_ioctl) <case PTP_CLOCK_GETCAPS>: Use struct strace_ptp_clock_caps
instead of struct ptp_clock_caps; print n_pins, cross_timestamping, and
rsv fields.
(ptp_ioctl) <case PTP_SYS_OFFSET_PRECISE, case PTP_PIN_GETFUNC, case
PTP_PIN_SETFUNC>: Handle new commands.
2018-11-21 14:38:13 +01:00
Eugene Syromyatnikov
8ff46440ff configure.ac: do not hard-code list of arches that have m32/mx32
As of now, it can be derived from SUPPORTED_PERSONALITIES, and this
information is provided in arch_defs.

* configure.ac: Use AC_COMPILE_IFELSE in order to call st_MPERS based
on SUPPORTED_PERSONALITIES value set for a n architecture.
2018-11-21 14:38:12 +01:00
Eugene Syromyatnikov
d998972eb5 Check PTP API fields
Similarly to bpf_attr fields checks.

* ptp_clock.h: New file.
* Makefile.am (strace_SOURCES): Add it.
(strace_SOURCES_check, BUILT_SOURCES, CLEANFILES): Add ptp_clock_check.c.
(EXTRA_DIST): Add gen_ptp_clock_check.sh.
(ptp_clock_check.c): New rule.
* configure.ac (AC_CHECK_HEADERS([linux/ptp_clock.h])): Call
st_PTP_CLOCK.
* gen_ptp_clock_check.sh: New file.
* m4/gen_ptp_clock_m4.awk: Likewise.
* m4/gen_ptp_clock_m4.sh: Likewise.
2018-11-21 14:38:12 +01:00
Eugene Syromyatnikov
2d2edb4654 xlat: add fallback values for notifyflags
* xlat/notifyflags.in: Add fallback values.
2018-11-21 14:38:12 +01:00
Eugene Syromyatnikov
3cfdc5da72 xlat: provide fallback values to getsock_ip*_options
* xlat/getsock_ip_options.in: Provide fallback values.
* xlat/getsock_ipv6_options.in: Likewise.

Closes: https://github.com/strace/strace/issues/87
2018-11-21 14:38:03 +01:00
Eugene Syromyatnikov
8cfc98ca99 sync_file_range2: remove unneeded argn assignment
clang complains about it:

         argn = printllval(tcp, "%lld", argn);
         ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    sync_file_range2.c:43:2: note: Value stored to 'argn' is never read

* sync_file_range2.c (SYS_FUNC(sync_file_range2)): Do not assign
printllval result to argn second time.
2018-10-20 06:42:20 +02:00
Eugene Syromyatnikov
e963559c13 linux/smc_diag.h: update struct smc_diag_req definition
In accordance with Linux commit v4.19-rc8~22^2~17^2.

* linux/smc_diag.h (struct smc_diag_req): Use a union for
diag_fallback/diag_mode.
2018-10-20 06:35:44 +02:00
Eugene Syromyatnikov
cae7ddf0a3 fixup! futex: print uaddr value 2018-10-20 06:31:41 +02:00
Eugene Syromyatnikov
3c068f860e net: decode SOL_CAN_RAW socket options
* xlat/sock_can_raw_options.in: New file.
* net.c: Include "xlat/sock_can_raw_options.h".
(print_sockopt_fd_level_name) <case SOL_CAN_RAW>: Print socket option
name using sock_can_raw_options xlat.
2018-10-20 06:25:22 +02:00
Eugene Syromyatnikov
53bc64c795 xlat/clockflags: provide fallback values
* xlat/clockflags.in: Provide fallback values.
2018-10-20 06:20:07 +02:00
Eugene Syromyatnikov
079776b9bd xlat/fdflags: provide fallback values
* xlat/fdflags.in: Provide fallback values.
2018-10-20 06:19:42 +02:00