Commit Graph

121 Commits

Author SHA1 Message Date
38437688ec Update fs *_MAGIC constants
* xlat/fsmagic.in: Add CGROUP2_SUPER_MAGIC and OVERLAYFS_SUPER_MAGIC.
2016-02-14 00:36:38 +00:00
b9c8e66f46 Update IPV6_* constants
* xlat/sockipv6options.in: Add IPV6_HDRINCL.
2016-02-14 00:36:38 +00:00
c257fbe24d Update SO_* constants
* xlat/sockoptions.in: Add SO_ATTACH_REUSEPORT_CBPF
and SO_ATTACH_REUSEPORT_EBPF.
2016-02-14 00:36:38 +00:00
12d5e7c8c3 Update MADV_* constants
* xlat/madvise_cmds.in: Add MAD_FREE.
2016-02-14 00:36:38 +00:00
60d4892866 quotactl: add decoding of if_dqinfo.dqi_flags constants
* xlat/if_dqinfo_flags.in: New file.
* quota.c: Include "xlat/if_dqinfo_flags.h".
(decode_cmd_data): Print struct if_dqinfo.dqi_flags using printflags.
2016-01-19 02:10:23 +00:00
2d544968fe Update quotactl constants
* xlat/quota_formats.in: Add QFMT_OCFS2 and QFMT_VFS_V1.
* xlat/quotacmds.in: Add Q_XGETQSTATV.
* xlat/quotatypes.in: Add PRJQUOTA.
* xlat/xfs_quota_flags.in: Add FS_QUOTA_PDQ_ACCT and FS_QUOTA_PDQ_ENFD.
2016-01-17 22:30:54 +00:00
2105a9737c Move definitions of quotactl constants to xlat files
* quota.c (Q_*): Move to xlat/quotacmds.in.
(USRQUOTA, GRPQUOTA): Move to xlat/quotatypes.in.
(QFMT_VFS_OLD, QFMT_VFS_V0): Move to xlat/quota_formats.in.
(XFS_QUOTA_*): Move to xlat/xfs_quota_flags.in.
(XFS_*_QUOTA): Move to xlat/xfs_dqblk_flags.in.
(QIF_*): Move to xlat/if_dqblk_valid.in.
(IIF_*): Move to xlat/if_dqinfo_valid.in.
2016-01-19 00:06:09 +00:00
65f8d39278 Update PTRACE_* constants
* ptrace.h (PTRACE_SECCOMP_GET_FILTER): Define.
* xlat/ptrace_cmds.in: Add PTRACE_SECCOMP_GET_FILTER.
2016-01-12 03:07:39 +00:00
727508b077 Enhance personality syscall decoding
* xlat/personality_options.in: Split into ...
* xlat/personality_types.in: ... personality types and ...
* xlat/personality_flags.in: ... personality flags.
* personality.c: Include "xlat/personality_types.h"
and "xlat/personality_flags.h" instead of "xlat/personality_options.h".
(SYS_FUNC(personality)): Print PER_MASK part of personality as
a symbolic value, and the rest of personality as a set of flags.
* tests/personality.c (main): Add more test cases.
* tests/personality.test: Update.
2015-12-26 02:10:46 +00:00
3eba72b9ab Add personality emulation flags
* xlat/personality_options.in: Add UNAME26, ADDR_NO_RANDOMIZE,
FDPIC_FUNCPTRS, MMAP_PAGE_ZERO, ADDR_COMPAT_LAYOUT, READ_IMPLIES_EXEC,
ADDR_LIMIT_32BIT, SHORT_INODE, WHOLE_SECONDS, STICKY_TIMEOUTS,
and ADDR_LIMIT_3GB.
2015-12-24 17:37:35 +00:00
38a34c9349 Add copyright headers to some files which lack them
Before this change, all files that exist since 20th century had
copyright headers, while most files that appeared later didn't.  This
change fixes the inconsistency by adding missing copyright headers.

It doesn't mean that copyright headers became maintained.  In my view,
git history provides much better information on this subject and is much
more accurate than copyright headers.
2015-12-17 17:56:48 +00:00
97af1be4c6 Update umount2 flags
* umount.c (MNT_FORCE, MNT_DETACH, MNT_EXPIRE): Move definitions ...
* xlat/umount_flags.in: ... here.  Add UMOUNT_NOFOLLOW.
2015-12-07 00:38:38 +00:00
eb76c4be15 prctl: add PR_CAP_AMBIENT parser
* xlat/pr_cap_ambient.in: New file.
* prctl.c: Include "xlat/pr_cap_ambient.h".
(SYS_FUNC(prctl)): Handle PR_CAP_AMBIENT.
2015-12-06 15:33:53 +00:00
b165910f98 Fix build on systems that lack EM_FRV definition
* xlat/audit_arch.in: Guard AUDIT_ARCH_FRV with EM_FRV check.
2015-12-06 15:13:01 +00:00
2154702865 fcntl: skip F_GETLK64, F_SETLK64, and F_SETLKW64 in fcntl syscall parser
As the kernel recognizes F_GETLK64, F_SETLK64, and F_SETLKW64 commands
in fcntl64 syscall only, do not parse their structures in fcntl parser.

* xlat/fcntlcmds.in: Move F_GETLK64, F_SETLK64, and F_SETLKW64 ...
* xlat/fcntl64cmds.in: ... here.
* fcntl.c: Include "xlat/fcntl64cmds.h".
(print_fcntl): Move printing of first two syscall arguments
and handling of F_GETLK64, F_SETLK64, and F_SETLKW64 commands ...
(SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): ... here.
* tests/fcntl.c: New file, based on struct_flock.c.
* tests/fcntl64.c: Likewise.
* tests/struct_flock.c (test_flock_einval, create_sample): New functions.
(test_flock): Use test_flock_einval.
(test_flock64, main): Remove.
* tests/fcntl.test: New test.
* tests/fcntl64.test: Likewise.
* tests/struct_flock.test: Remove.
* tests/Makefile.am (check_PROGRAMS): Add fcntl and fcntl64,
remove struct_flock.
(TESTS): Add fcntl.test and fcntl64.test, remove struct_flock.test.
(EXTRA_DIST) Add struct_flock.c.
* tests/.gitignore: Add fcntl and fcntl64, remove struct_flock.
2015-12-05 19:35:51 +00:00
c7c5270966 fcntl.c: implement decoding for all known operations
* xlat/f_owner_types.in: New file.
* xlat/f_seals.in: Likewise.
* fcntl.c: Include "xlat/f_owner_types.h" and "xlat/f_seals.h".
(print_f_owner_ex): New function.
(SYS_FUNC(fcntl)): Use it.
Handle F_SETPIPE_SZ, F_GETPIPE_SZ, F_OFD_SETLKW,
F_OFD_SETLK, F_SETOWN_EX, F_ADD_SEALS, F_SETSIG,
F_OFD_GETLK, F_GETOWN_EX, F_GET_SEALS, F_GETSIG.
2015-11-26 01:37:34 +00:00
bcc73975fd Update F_* constants
* xlat/fcntlcmds.in: Add F_SETOWN_EX, F_GETOWN_EX, F_GETOWNER_UIDS,
F_OFD_GETLK, F_OFD_SETLK, F_OFD_SETLKW, and F_CANCELLK.
Remove F_ALLOCSP, F_BLKSIZE, F_BLOCKS, F_CHKFL, F_CNVT, F_DUP2FD,
F_ISSTREAM, F_NPRIV, F_PRIV, F_QUOTACL, F_REVOKE, F_RGETLK, F_RSETLK,
F_RSETLKW, F_SHARE, and F_UNSHARE.
Add default values.
2015-11-26 01:37:34 +00:00
db62a712f9 Update LOCK_* constants
* xlat/flockcmds.in: Add LOCK_MAND, LOCK_READ, LOCK_WRITE, and LOCK_RW.
Add default values.
2015-11-26 01:37:34 +00:00
a56a81c1ec Remove parsers of getpmsg and putpmsg syscalls
These system calls are not implemented in the Linux kernel.

* linux/dummy.h(getpmsg, putpmsg): Move to the list of deprecated
syscalls.
* Makefile.am (strace_SOURCES): Remove stream.c.
* stream.c: Remove.
* xlat/pmsgflags.in: Remove.
2015-11-24 02:42:38 +00:00
aae525f94e Remove parser of query_module syscall
Since query_module syscall is present only in kernels before Linux 2.6
and strace does not support those kernels, there is no use to keep this
parser any longer.

* bjm.c: Do not include <sys/*>, "xlat/qm_which.h",
and "xlat/modflags.h".
(MOD_*, QM_*, module_symbol, module_info, SYS_FUNC(query_module)):
Remove.
* linux/dummy.h (sys_query_module): Add stub alias.
* xlat/modflags.in: Remove.
* xlat/qm_which.in: Remove.
2015-11-24 02:30:45 +00:00
ea1970500e Implement kexec_file_load syscall decoding
* xlat/kexec_file_load_flags.in: New file.
* kexec.c: Include "xlat/kexec_file_load_flags.h".
(SYS_FUNC(kexec_file_load)): New function.
* linux/dummy.h (sys_kexec_file_load): Remove stub alias.
* pathtrace.c (pathtrace_match): Add SEN_kexec_file_load.
2015-11-22 23:10:12 +00:00
7aa9c0d299 Implement kcmp syscall decoding
* kcmp.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* linux/dummy.h (sys_kcmp): Remove stub alias.
* xlat/kcmp_types.in: New file.
2015-11-22 23:10:12 +00:00
1f111cff5a Implement IPPROTO_IP control messages decoding
* net.c: Include "xlat/ip_cmsg_types.h".
(print_cmsg_ip_pktinfo, print_cmsg_ip_ttl, print_cmsg_ip_tos,
print_cmsg_ip_opts, print_cmsg_ip_recverr, print_cmsg_ip_checksum,
print_cmsg_ip_origdstaddr): New functions.
(print_cmsg_type_data): Add generic SOL_IP level decoding.
Use these functions for decoding of IP_PKTINFO, IP_TTL, IP_TOS,
IP_RECVOPTS, IP_RETOPTS, IP_RECVERR, IP_ORIGDSTADDR, IP_CHECKSUM,
and SCM_SECURITY type messages.
* xlat/ip_cmsg_types.in: New file.
* xlat/sockipoptions.in: Move IP_RETOPTS before IP_RECVRETOPTS.
* tests/inet-cmsg.c: New file.
* tests/inet-cmsg.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add inet-cmsg.
(TESTS): Add inet-cmsg.test.
* tests/.gitignore: Add inet-cmsg.

Suggested-by: Orion Poplawski <orion@cora.nwra.com>
2015-11-22 02:56:45 +00:00
5cb45b25a3 mpers: skip xlat struct definitions in mpers mode
Avoid duplicate definitions of xlat structures in files
compiled in mpers mode.

Each xlat file defines the corresponding xlat struct with
either global or local visibility using the following rules:

- if xlat struct declaration is available in defs.h,
  a global definition is provided in regular mode,
  and nothing is provided in mpers mode;
- otherwise, if xlat file is included by a mpers source file,
  a global definition is provided in regular mode
  (unless no mpers mode is supported on this architecture,
  in that case, a local definition is provided instead),
  and a declaration is provided in mpers mode;
- otherwise, a local definition is provided in regular mode,
  and an error message is printed in mpers mode.

Fallback definitions of constants provided by xlat files
remain available in all modes.

* bootstrap: Invoke generate_mpers_am.sh before xlat/gen.sh.
* defs.h (adjtimex_modes, adjtimex_status, sigev_value): Remove.
* generate_mpers_am.sh: Generate mpers_xlat.h.
* Makefile.am (EXTRA_DIST): Add mpers_xlat.h.
* print_sigevent.c: Include "xlat/sigev_value.h" unconditionally.
* print_timex.c: Include "xlat/adjtimex_modes.h" and
"xlat/adjtimex_status.h" unconditionally.
* xlat/gen.sh (cond_xlat): Move printing of fallback definitions ...
(cond_def): ... here.
(gen_header): Check also mpers_xlat.h for global declarations
of xlat structures.
Process input file twice, first time print directives
only, second time print everything.
Wrap struct xlat into #ifdef IN_MPERS ... #else ... #endif.
* xlat/getrandom_flags.in: Cleanup.
2015-11-20 05:44:49 +00:00
a367db8e5b Mpersify parsers of readdir and getdents syscalls
* defs.h (dirent_types): New xlat prototype.
* dirent.c: Stop including "xlat/direnttypes.h".
(kernel_dirent): New typedef.  Mpersify it.
(print_old_dirent): Use it instead of old_dirent_t.
(SYS_FUNC(getdents)): Use it instead of struct kernel_dirent.
Rename direnttypes to dirent_types.
(SYS_FUNC(getdents64)): Move ...
* dirent64.c: ... here.  Rename direnttypes to dirent_types.
Include "xlat/dirent_types.h".
* Makefile.am (strace_SOURCES): Add dirent64.c.
* xlat/direnttypes.in: Rename to xlat/dirent_types.in.
2015-11-19 22:49:58 +00:00
3a1e95d14e net.c: move fallback definition of SCM_SECURITY to xlat/
* net.c: Move fallback definition of SCM_SECURITY ...
* xlat/scmvals.in: ... here.
2015-11-18 23:11:34 +00:00
0d0a50aa25 Implement mlock2 syscall decoding
* mem.c: Include "xlat/mlock_flags.h".
(SYS_FUNC(mlock2)): New function.
* xlat/mlock_flags.in: New file.
* xlat/mlockall_flags.in: Add MCL_ONFAULT, add default values.
* linux/dummy.h (mlock2): Remove.
* tests/mlock2.c: New file.
* tests/mlock2.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add mlock2.
(TESTS): Add mlock2.test.
* tests/.gitignore Add mlock2.
2015-11-17 00:40:22 +00:00
2aec1e67df Implement membarrier syscall decoding
* membarrier.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* xlat/membarrier_cmds.in: New file.
* linux/dummy.h (membarrier): Remove.
* tests/membarrier.c: New file.
* tests/membarrier.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add membarrier.
(TESTS): Add membarrier.test.
* tests/.gitignore: Add membarrier.
2015-11-17 00:40:22 +00:00
a6ebdb149e Implement userfaultfd syscall decoding
* userfaultfd.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* xlat/uffd_flags.in: New file.
* linux/dummy.h (userfaultfd): Remove.
* tests/userfaultfd.c: New file.
* tests/userfaultfd.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add userfaultfd.
(TESTS): Add userfaultfd.test.
* tests/.gitignore: Add userfaultfd.
2015-11-17 00:40:22 +00:00
644a8093a2 time.c: move fallback definitions of SIGEV_* values to xlat/
* time.c: Move fallback definitions of SIGEV_* values ...
* xlat/sigev_value.in: ... here.
2015-09-16 12:09:52 +00:00
Anton Blanchard
6375f151a7 Add PowerPC specific ptrace constants
* xlat/ptrace_cmds.in: Add PowerPC specific ptrace constants.
2015-09-14 17:31:36 +00:00
cb7699c2d0 Update SCTP_* constants
* xlat/socksctpoptions.in: Add SCTP_GET_ASSOC_ID_LIST, SCTP_AUTO_ASCONF,
SCTP_PEER_ADDR_THLDS, SCTP_RECVRCVINFO, SCTP_RECVNXTINFO,
SCTP_DEFAULT_SNDINFO, SCTP_SOCKOPT_CONNECTX, SCTP_SOCKOPT_CONNECTX3,
and SCTP_GET_ASSOC_STATS.
2015-09-14 17:27:07 +00:00
456f41ab30 Update F_* constants
* xlat/fcntlcmds.in: Add F_SETPIPE_SZ, F_GETPIPE_SZ, F_ADD_SEALS,
and F_GET_SEALS.
2015-09-14 17:21:10 +00:00
e96869bd96 Update RENAME_* constants
* xlat/rename_flags.in: Add RENAME_WHITEOUT.
2015-09-14 17:16:32 +00:00
a9cda6940a Update SO_* constants
* xlat/sockoptions.in: Add SO_ATTACH_BPF, SO_BPF_EXTENSIONS,
SO_BUSY_POLL, SO_DETACH_BPF, SO_GET_FILTER, SO_INCOMING_CPU,
SO_LOCK_FILTER, SO_MAX_PACING_RATE, SO_PEEK_OFF, SO_RXQ_OVFL,
SO_SELECT_ERR_QUEUE, and SO_WIFI_STATUS.
2015-09-14 17:04:22 +00:00
718dc4361c Update INPUT_PROP_* constants
* xlat/evdev_prop.in: Add INPUT_PROP_ACCELEROMETER.
2015-09-14 16:20:25 +00:00
d6414fbdcc Update KEY_* constants
* xlat/evdev_keycode.in: Add KEY_ROTATE_DISPLAY, KEY_NUMERIC_A,
KEY_NUMERIC_B, KEY_NUMERIC_C, and KEY_NUMERIC_D.
2015-09-14 16:19:25 +00:00
137bf1b910 Update FALLOC_FL_* constants
* xlat/falloc_flags.in: Add FALLOC_FL_INSERT_RANGE.
2015-09-14 16:04:17 +00:00
d44ffe041b Update AF_* and PF_* constants
* xlat/addrfams.in: Add AF_IB and AF_MPLS.
* xlat/domains.in: Add PF_IB and PF_MPLS.
2015-09-14 16:00:39 +00:00
209f695f93 Update TCP_* constants
* xlat/socktcpoptions.in: Add TCP_NOTSENT_LOWAT, TCP_CC_INFO,
TCP_SAVE_SYN, and TCP_SAVED_SYN.
2015-09-14 15:50:44 +00:00
7f0063ca6c Update PACKET_* constants
* xlat/sockpacketoptions.in: Add PACKET_VNET_HDR, PACKET_TX_TIMESTAMP,
PACKET_TIMESTAMP, PACKET_FANOUT, PACKET_TX_HAS_OFF, PACKET_QDISC_BYPASS,
PACKET_ROLLOVER_STATS, and PACKET_FANOUT_DATA.
2015-09-14 15:46:47 +00:00
57c29189aa Update BPF_MAP_TYPE_* constants
* xlat/bpf_map_types.in: Add BPF_MAP_TYPE_PERF_EVENT_ARRAY.
2015-09-14 15:40:17 +00:00
6fda3314fc Update IPPROTO_* constants
* xlat/inet_protocols.in: Add IPPROTO_MPLS.
2015-09-14 15:29:41 +00:00
3fe9d3669e Update IP_* constants
* xlat/sockipoptions.in: Add IP_CHECKSUM and IP_BIND_ADDRESS_NO_PORT.
2015-09-14 15:01:02 +00:00
8e0442d43c Update PTRACE_O_* constants
* ptrace.h: Define PTRACE_O_SUSPEND_SECCOMP.
* xlat/ptrace_setoptions_flags.in: Add it.
2015-09-14 14:42:28 +00:00
b02bcfadcb Update PR_* constants
* xlat/prctl_options.in: Add PR_SET_FP_MODE, PR_GET_FP_MODE,
and PR_CAP_AMBIENT.
2015-09-14 13:25:24 +00:00
b0d1955e17 Update SECBIT_* constants
* xlat/secbits.in: Add SECBIT_NO_CAP_AMBIENT_RAISE
and SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED.
2015-09-14 13:21:01 +00:00
Mike Frysinger
54646b8e05 decode extend getsockopt/setsockopt options
Currently the code assumes the set of valid options between getsockopt
and setsockopt are exactly the same and thus maintains one list.  The
kernel unfortunately does not do this -- it allows for different opts
between the get and set functions.  See the {g,s}et_opt{min,max} fields
in the various netfilter subcores.

To support this, extend the printxval function to take multiple sets of
xlats as varargs.  Then we add the new get/set lists, and pass them down
in the net code when decoding things.

A simple example is iptables; before:
	getsockopt(4, SOL_IP, 0x40 /* IP_??? */, ...) = 0
	getsockopt(4, SOL_IP, 0x41 /* IP_??? */, ...) = 0
after:
	getsockopt(4, SOL_IP, IPT_SO_GET_INFO, ...) = 0
	getsockopt(4, SOL_IP, IPT_SO_GET_ENTRIES, ...) = 0

If these were setsockopt calls, then 0x40 & 0x41 would be
IPT_SO_SET_REPLACE & IPT_SO_SET_ADD_COUNTERS.

* configure.ac: Check for netfilter headers.
* defs.h (printxvals): New prototype.
(printxval): Change to a define.
* net.c: Include netfilter headers and new sockopts headers.
(print_sockopt_fd_level_name): Add a is_getsockopt argument.  Change SOL_IP
and SOL_IPV6 decoding to use printxvals, and use is_getsockopt to pass more
xlats down.
(getsockopt): Call print_sockopt_fd_level_name with is_getsockopt as true.
(setsockopt): Call print_sockopt_fd_level_name with is_getsockopt as false.
* util.c (printxval): Rename to ...
(printxvals): ... this.  Rewrite to be varargs based.
* xlat/getsockipoptions.in: New xlat list.
* xlat/getsockipv6options.in, xlat/setsockipoptions.in,
xlat/setsockipv6options.in: Likewise.
2015-08-26 12:09:25 +00:00
69c1570d55 Fix build on systems that lack EM_ARM/EM_OPENRISC definitions
* xlat/audit_arch.in: Guard AUDIT_ARCH_ARM and AUDIT_ARCH_ARMEB
with EM_ARM check.  Guard AUDIT_ARCH_OPENRISC with EM_OPENRISC check.
2015-08-26 11:52:43 +00:00
12cca59aed Fix build on systems that lack O_CLOEXEC definition
* xlat/efd_flags.in: Check that O_CLOEXEC is defined.
* xlat/epollflags.in: Likewise.
* xlat/sfd_flags.in: Likewise.
* xlat/timerfdflags.in: Fix O_CLOEXEC check.
2015-08-25 10:05:08 +00:00