Compare commits
95 Commits
ppiao/gsoc
...
esyr/fixes
Author | SHA1 | Date | |
---|---|---|---|
574ca90737 | |||
6726f218f7 | |||
7a7f6c6a7c | |||
6d6d5bc480 | |||
4370024753 | |||
3960969554 | |||
be3ba52a4d | |||
5993d50813 | |||
f5b9ee4945 | |||
e78becf8b9 | |||
9eeab98448 | |||
96df4b36f6 | |||
f708bcfa45 | |||
305e47a9ae | |||
762d8e06bf | |||
af39dee46c | |||
d7cbc89824 | |||
5aba529854 | |||
92b04d4a22 | |||
4b0130a7d0 | |||
750cdcba9c | |||
302cf02757 | |||
a5918bf7e6 | |||
4499e109ec | |||
201e01dbac | |||
ac2f6695cd | |||
da048e91a1 | |||
cfb86ab4e9 | |||
92d020787f | |||
cbbf708b4d | |||
c3ac40611c | |||
8a56b8a1b7 | |||
38e0f55602 | |||
9a969eb670 | |||
ef859a2702 | |||
54fc755c56 | |||
7c08fe37a1 | |||
a302982576 | |||
f561173367 | |||
9f4b5992fe | |||
79878e783c | |||
298f29a15b | |||
6177e74134 | |||
b05d2667e9 | |||
fdfc68a984 | |||
3f10639284 | |||
618d4ed497 | |||
9b5d56054c | |||
f3b38739d5 | |||
288b872266 | |||
1d7b8edda9 | |||
45afd0c7a3 | |||
dac524ad98 | |||
587d1d5663 | |||
00bfa52a81 | |||
5d18b8cdef | |||
25a4cafa90 | |||
6e7da52286 | |||
930864b083 | |||
3926f4a07d | |||
24535be245 | |||
4fa680e63f | |||
fb7c51690e | |||
df7dd5aa66 | |||
e8d95392ad | |||
fe8861f6b4 | |||
f7d175b562 | |||
701fd04d8a | |||
cde23ff80c | |||
6b141f643a | |||
d029a5efd1 | |||
eded21f5c0 | |||
9624d9f09d | |||
db5235d0e9 | |||
cf174ac87a | |||
f9578731fc | |||
9aa1efde58 | |||
44e21ae30d | |||
ccee090b78 | |||
1df0986c75 | |||
9d2848e517 | |||
14ae61f37b | |||
2d88ec9e39 | |||
538cf68f12 | |||
9725de9c22 | |||
7b0d371b3f | |||
f0ec4e696c | |||
ed29ac33bb | |||
e286b9cbc0 | |||
5ee385e2eb | |||
99300f217b | |||
e38143b00e | |||
0f09267db0 | |||
b89a69dec2 | |||
a264eb3b65 |
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/* export-ignore
|
||||
/README-github_gitlab-autogenerated-archives.txt -export-ignore
|
@ -1,4 +1,4 @@
|
||||
image: "ubuntu:17.10"
|
||||
image: "ubuntu:18.04"
|
||||
|
||||
before_script:
|
||||
- ci/install-dependencies.sh
|
||||
@ -8,6 +8,15 @@ variables:
|
||||
SLEEP_A_BIT: "sleep 0.2"
|
||||
VERBOSE: "1"
|
||||
|
||||
gcc-x86_64-libdw-mainline:
|
||||
stage: test
|
||||
script: ci/run-build-and-tests.sh
|
||||
variables:
|
||||
CC: "gcc"
|
||||
TARGET: "x86_64"
|
||||
STACKTRACE: "libdw"
|
||||
KHEADERS: "torvalds/linux"
|
||||
|
||||
gcc-x86_64-libdw:
|
||||
stage: test
|
||||
script: ci/run-build-and-tests.sh
|
||||
|
@ -24,6 +24,11 @@ matrix:
|
||||
- STACKTRACE=libunwind
|
||||
- CHECK=coverage
|
||||
- KHEADERS=torvalds/linux
|
||||
- compiler: gcc-8
|
||||
env:
|
||||
- TARGET=x86_64
|
||||
- STACKTRACE=libunwind
|
||||
- KHEADERS=torvalds/linux
|
||||
- compiler: gcc
|
||||
env:
|
||||
- TARGET=x86_64
|
||||
|
@ -149,8 +149,6 @@ strace_SOURCES = \
|
||||
file_ioctl.c \
|
||||
filter_qualify.c \
|
||||
filter.h \
|
||||
filter_seccomp.c \
|
||||
filter_seccomp.h \
|
||||
flock.c \
|
||||
flock.h \
|
||||
fs_x_ioctl.c \
|
||||
@ -206,6 +204,7 @@ strace_SOURCES = \
|
||||
msghdr.h \
|
||||
mtd.c \
|
||||
native_defs.h \
|
||||
nbd_ioctl.c \
|
||||
negated_errno.h \
|
||||
net.c \
|
||||
netlink.c \
|
||||
|
23
NEWS
23
NEWS
@ -1,3 +1,26 @@
|
||||
Noteworthy changes in release ?.?? (????-??-??)
|
||||
===============================================
|
||||
|
||||
* Improvements
|
||||
* Implemented decoding of KVM_CHECK_EXTENSION and NBD_* ioctl commands.
|
||||
* Implemented decoding of SOL_XDP socket option names.
|
||||
* Implemented decoding of AF_PACKET protocols in socket syscall.
|
||||
* Implemented decoding of AF_AX25 and AF_X25 addresses, protocols,
|
||||
and options.
|
||||
* Implemented stack trace printing on receiving signals.
|
||||
* Enhanced xlat styles support configured by -X option.
|
||||
* Enhanced decoding of IFLA_*, NETCONFA_*, and SMC_DIAG_* netlink attributes.
|
||||
* Wired up io_pgetevents syscall on arm, sparc, and sparc64.
|
||||
* Updated lists of AF_*, AUDIT_*, BPF_*, IFLA_*, IN_*, IPSTATS_*,
|
||||
IPV4_DEVCONF_*, NT_*, SCTP_*, SO_*, SOCK_*, SOL_*, and V4L2_* constants.
|
||||
* Updated lists of ioctl commands from Linux 4.19.
|
||||
|
||||
* Bug fixes
|
||||
* Fixed decoding of bit sets in evdev ioctl commands.
|
||||
* Fixed decoding of EVIOCGBIT(0, ...) ioctl commands.
|
||||
* Fixed test suite for the case when mlockall and unimplemented syscalls
|
||||
are explicitly disabled by a seccomp filter.
|
||||
|
||||
Noteworthy changes in release 4.24 (2018-08-14)
|
||||
===============================================
|
||||
|
||||
|
11
README-github_gitlab-autogenerated-archives.txt
Normal file
11
README-github_gitlab-autogenerated-archives.txt
Normal file
@ -0,0 +1,11 @@
|
||||
github/gitlab autogenerated archives are not supported
|
||||
======================================================
|
||||
|
||||
This information applies to bundles automatically generated
|
||||
by github and gitlab.
|
||||
|
||||
strace's program version is maintained using git-version-gen script, therefore,
|
||||
building strace depends on "git describe" (a full git clone is needed for this)
|
||||
or, alternatively, a .tarball-version file. Neither github nor gitlab can
|
||||
provide the latter, they also do not allow to inject a .tarball-version file
|
||||
during export archiving.
|
57
block.c
57
block.c
@ -65,60 +65,15 @@ typedef struct blk_user_trace_setup {
|
||||
uint32_t pid;
|
||||
} struct_blk_user_trace_setup;
|
||||
|
||||
/* Provide fall-back definitions for BLK* ioctls */
|
||||
#define XLAT_MACROS_ONLY
|
||||
# include "xlat/block_ioctl_cmds.h"
|
||||
#undef XLAT_MACROS_ONLY
|
||||
|
||||
#include MPERS_DEFS
|
||||
|
||||
#include "print_fields.h"
|
||||
|
||||
#ifndef BLKPG
|
||||
# define BLKPG _IO(0x12, 105)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ioctl numbers <= 114 are present in Linux 2.4. The following ones have been
|
||||
* added since then and headers containing them may not be available on every
|
||||
* system.
|
||||
*/
|
||||
|
||||
#ifndef BLKTRACESETUP
|
||||
# define BLKTRACESETUP _IOWR(0x12, 115, struct_blk_user_trace_setup)
|
||||
#endif
|
||||
#ifndef BLKTRACESTART
|
||||
# define BLKTRACESTART _IO(0x12, 116)
|
||||
#endif
|
||||
#ifndef BLKTRACESTOP
|
||||
# define BLKTRACESTOP _IO(0x12, 117)
|
||||
#endif
|
||||
#ifndef BLKTRACETEARDOWN
|
||||
# define BLKTRACETEARDOWN _IO(0x12, 118)
|
||||
#endif
|
||||
#ifndef BLKDISCARD
|
||||
# define BLKDISCARD _IO(0x12, 119)
|
||||
#endif
|
||||
#ifndef BLKIOMIN
|
||||
# define BLKIOMIN _IO(0x12, 120)
|
||||
#endif
|
||||
#ifndef BLKIOOPT
|
||||
# define BLKIOOPT _IO(0x12, 121)
|
||||
#endif
|
||||
#ifndef BLKALIGNOFF
|
||||
# define BLKALIGNOFF _IO(0x12, 122)
|
||||
#endif
|
||||
#ifndef BLKPBSZGET
|
||||
# define BLKPBSZGET _IO(0x12, 123)
|
||||
#endif
|
||||
#ifndef BLKDISCARDZEROES
|
||||
# define BLKDISCARDZEROES _IO(0x12, 124)
|
||||
#endif
|
||||
#ifndef BLKSECDISCARD
|
||||
# define BLKSECDISCARD _IO(0x12, 125)
|
||||
#endif
|
||||
#ifndef BLKROTATIONAL
|
||||
# define BLKROTATIONAL _IO(0x12, 126)
|
||||
#endif
|
||||
#ifndef BLKZEROOUT
|
||||
# define BLKZEROOUT _IO(0x12, 127)
|
||||
#endif
|
||||
|
||||
#include "xlat/blkpg_ops.h"
|
||||
|
||||
static void
|
||||
@ -204,7 +159,6 @@ MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp,
|
||||
printnum_ulong(tcp, arg);
|
||||
break;
|
||||
|
||||
#ifdef HAVE_BLKGETSIZE64
|
||||
/* returns an uint64_t */
|
||||
case BLKGETSIZE64:
|
||||
if (entering(tcp))
|
||||
@ -212,7 +166,6 @@ MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp,
|
||||
tprints(", ");
|
||||
printnum_int64(tcp, arg, "%" PRIu64);
|
||||
break;
|
||||
#endif
|
||||
|
||||
/* takes a pair of uint64_t */
|
||||
case BLKDISCARD:
|
||||
|
@ -49,10 +49,23 @@ clone_repo()
|
||||
git clone --depth=1 ${branch:+--branch $branch} "$src" "$dst"
|
||||
}
|
||||
|
||||
case "$CC" in
|
||||
gcc-*)
|
||||
retry_if_failed \
|
||||
$sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||
apt_get_install $common_packages "$CC"-multilib
|
||||
;;
|
||||
clang*)
|
||||
apt_get_install $common_packages "$CC"
|
||||
;;
|
||||
*)
|
||||
apt_get_install $common_packages
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$KHEADERS" in
|
||||
*/*)
|
||||
clone_repo https://github.com/"$KHEADERS" kernel ${KBRANCH-}
|
||||
apt_get_install $common_packages
|
||||
$sudo make -C kernel headers_install INSTALL_HDR_PATH=/opt/kernel
|
||||
$sudo rm -rf kernel
|
||||
KHEADERS_INC=/opt/kernel/include
|
||||
@ -63,20 +76,8 @@ case "$KHEADERS" in
|
||||
esac
|
||||
|
||||
case "$CC" in
|
||||
gcc)
|
||||
apt_get_install $common_packages
|
||||
;;
|
||||
gcc-*)
|
||||
retry_if_failed \
|
||||
$sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||
apt_get_install $common_packages "$CC"-multilib
|
||||
;;
|
||||
clang*)
|
||||
apt_get_install $common_packages "$CC"
|
||||
;;
|
||||
musl-gcc)
|
||||
clone_repo strace/musl musl
|
||||
apt_get_install $common_packages
|
||||
cd musl
|
||||
CC=gcc
|
||||
build=
|
||||
|
@ -33,6 +33,7 @@ case "${STACKTRACE-}" in
|
||||
;;
|
||||
esac
|
||||
|
||||
CPPFLAGS=
|
||||
case "$KHEADERS" in
|
||||
*/*)
|
||||
CPPFLAGS='-isystem /opt/kernel/include'
|
||||
@ -62,7 +63,7 @@ $CC -print-multi-lib ||:
|
||||
make --version |head -1
|
||||
autoconf --version |head -1
|
||||
automake --version |head -1
|
||||
kver="$(printf '%s\n%s\n' '#include <linux/version.h>' 'LINUX_VERSION_CODE' | $CC -E -P -)"
|
||||
kver="$(printf '%s\n%s\n' '#include <linux/version.h>' 'LINUX_VERSION_CODE' | $CC $CPPFLAGS -E -P -)"
|
||||
printf 'kernel-headers %s.%s.%s\n' $(($kver/65536)) $(($kver/256%256)) $(($kver%256))
|
||||
echo 'END OF BUILD ENVIRONMENT INFORMATION'
|
||||
|
||||
|
@ -788,15 +788,6 @@ AC_CHECK_MEMBERS(m4_normalize([
|
||||
#include <linux/types.h>
|
||||
#include <linux/videodev2.h>])
|
||||
|
||||
AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
|
||||
#include <stdlib.h>
|
||||
#include <linux/fs.h>], [return !BLKGETSIZE64;])],
|
||||
[ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])]
|
||||
if test $ac_cv_have_blkgetsize64 = yes; then
|
||||
AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.])
|
||||
fi)
|
||||
|
||||
AC_CHECK_SIZEOF([long])
|
||||
SIZEOF_LONG="$ac_cv_sizeof_long"
|
||||
AC_SUBST(SIZEOF_LONG)
|
||||
|
6
debian/changelog.in
vendored
6
debian/changelog.in
vendored
@ -4,6 +4,12 @@ strace (@PACKAGE_VERSION@-1) experimental; urgency=low
|
||||
|
||||
-- Strace <@PACKAGE_BUGREPORT@> @DEB_CHANGELOGTIME@
|
||||
|
||||
strace (4.24-1) unstable; urgency=medium
|
||||
|
||||
* New upstream version.
|
||||
|
||||
-- Dmitry V. Levin <ldv@altlinux.org> Tue, 14 Aug 2018 00:01:02 +0000
|
||||
|
||||
strace (4.23-1) unstable; urgency=medium
|
||||
|
||||
* New upstream version.
|
||||
|
63
defs.h
63
defs.h
@ -330,6 +330,7 @@ extern const struct xlat evdev_abs[];
|
||||
/** Number of elements in evdev_abs array without the terminating record. */
|
||||
extern const size_t evdev_abs_size;
|
||||
|
||||
extern const struct xlat evdev_ev[];
|
||||
extern const struct xlat iffflags[];
|
||||
extern const struct xlat ip_type_of_services[];
|
||||
extern const struct xlat ipc_private[];
|
||||
@ -378,11 +379,24 @@ enum sock_proto {
|
||||
SOCK_PROTO_UNIX,
|
||||
SOCK_PROTO_TCP,
|
||||
SOCK_PROTO_UDP,
|
||||
SOCK_PROTO_UDPLITE,
|
||||
SOCK_PROTO_DCCP,
|
||||
SOCK_PROTO_SCTP,
|
||||
SOCK_PROTO_L2TP_IP,
|
||||
SOCK_PROTO_PING,
|
||||
SOCK_PROTO_RAW,
|
||||
SOCK_PROTO_TCPv6,
|
||||
SOCK_PROTO_UDPv6,
|
||||
SOCK_PROTO_NETLINK
|
||||
SOCK_PROTO_UDPLITEv6,
|
||||
SOCK_PROTO_DCCPv6,
|
||||
SOCK_PROTO_L2TP_IPv6,
|
||||
SOCK_PROTO_SCTPv6,
|
||||
SOCK_PROTO_PINGv6,
|
||||
SOCK_PROTO_RAWv6,
|
||||
SOCK_PROTO_NETLINK,
|
||||
};
|
||||
extern enum sock_proto get_proto_by_name(const char *);
|
||||
extern int get_family_by_proto(enum sock_proto proto);
|
||||
|
||||
enum iov_decode {
|
||||
IOV_DECODE_ADDR,
|
||||
@ -692,9 +706,9 @@ printxval_searchn(const struct xlat *xlat, size_t xlat_size, uint64_t val,
|
||||
*/
|
||||
#define printxval_search(xlat__, val__, dflt__) \
|
||||
printxval_searchn(xlat__, ARRAY_SIZE(xlat__) - 1, val__, dflt__)
|
||||
#define printxval_search_ex(xlat__, val__, dflt__) \
|
||||
#define printxval_search_ex(xlat__, val__, dflt__, style__) \
|
||||
printxval_searchn_ex((xlat__), ARRAY_SIZE(xlat__) - 1, (val__), \
|
||||
(dflt__), XLAT_STYLE_DEFAULT)
|
||||
(dflt__), (style__))
|
||||
|
||||
extern int printxval_indexn_ex(const struct xlat *, size_t xlat_size,
|
||||
uint64_t val, const char *dflt, enum xlat_style);
|
||||
@ -734,6 +748,30 @@ printxval_dispatch(const struct xlat *xlat, size_t xlat_size, uint64_t val,
|
||||
XLAT_STYLE_DEFAULT);
|
||||
}
|
||||
|
||||
enum xlat_style_private_flag_bits {
|
||||
/* print_array */
|
||||
PAF_PRINT_INDICES_BIT = XLAT_STYLE_SPEC_BITS + 1,
|
||||
PAF_INDEX_XLAT_SORTED_BIT,
|
||||
PAF_INDEX_XLAT_VALUE_INDEXED_BIT,
|
||||
|
||||
/* print_xlat */
|
||||
PXF_DEFAULT_STR_BIT,
|
||||
};
|
||||
|
||||
#define FLAG_(name_) name_ = 1 << name_##_BIT
|
||||
|
||||
enum xlat_style_private_flags {
|
||||
/* print_array */
|
||||
FLAG_(PAF_PRINT_INDICES),
|
||||
FLAG_(PAF_INDEX_XLAT_SORTED),
|
||||
FLAG_(PAF_INDEX_XLAT_VALUE_INDEXED),
|
||||
|
||||
/* print_xlat */
|
||||
FLAG_(PXF_DEFAULT_STR),
|
||||
};
|
||||
|
||||
#undef FLAG_
|
||||
|
||||
/** Print a value in accordance with xlat formatting settings. */
|
||||
extern void print_xlat_ex(uint64_t val, const char *str, enum xlat_style style);
|
||||
#define print_xlat(val_) \
|
||||
@ -785,21 +823,6 @@ typedef bool (*tfetch_mem_fn)(struct tcb *, kernel_ulong_t addr,
|
||||
typedef bool (*print_fn)(struct tcb *, void *elem_buf,
|
||||
size_t elem_size, void *opaque_data);
|
||||
|
||||
enum print_array_flag_bits {
|
||||
PAF_PRINT_INDICES_BIT = XLAT_STYLE_SPEC_BITS + 1,
|
||||
PAF_INDEX_XLAT_SORTED_BIT,
|
||||
PAF_INDEX_XLAT_VALUE_INDEXED_BIT,
|
||||
};
|
||||
|
||||
#define FLAG_(name_) name_ = 1 << name_##_BIT
|
||||
|
||||
enum print_array_flags {
|
||||
FLAG_(PAF_PRINT_INDICES),
|
||||
FLAG_(PAF_INDEX_XLAT_SORTED),
|
||||
FLAG_(PAF_INDEX_XLAT_VALUE_INDEXED),
|
||||
};
|
||||
|
||||
#undef FLAG_
|
||||
|
||||
/**
|
||||
* @param flags Combination of xlat style settings and additional flags from
|
||||
@ -868,6 +891,8 @@ print_inet_addr(int af, const void *addr, unsigned int len, const char *var_name
|
||||
extern bool
|
||||
decode_inet_addr(struct tcb *, kernel_ulong_t addr,
|
||||
unsigned int len, int family, const char *var_name);
|
||||
extern void print_ax25_addr(const void /* ax25_address */ *addr);
|
||||
extern void print_x25_addr(const void /* struct x25_address */ *addr);
|
||||
extern const char *get_sockaddr_by_inode(struct tcb *, int fd, unsigned long inode);
|
||||
extern bool print_sockaddr_by_inode(struct tcb *, int fd, unsigned long inode);
|
||||
extern void print_dirfd(struct tcb *, int);
|
||||
@ -926,6 +951,7 @@ fetch_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr);
|
||||
extern void
|
||||
print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr);
|
||||
|
||||
extern const char *get_ifname(const unsigned int ifindex);
|
||||
extern void print_ifindex(unsigned int);
|
||||
|
||||
extern void print_bpf_filter_code(const uint16_t code, bool extended);
|
||||
@ -944,6 +970,7 @@ DECL_IOCTL(file);
|
||||
DECL_IOCTL(fs_x);
|
||||
DECL_IOCTL(inotify);
|
||||
DECL_IOCTL(kvm);
|
||||
DECL_IOCTL(nbd);
|
||||
DECL_IOCTL(nsfs);
|
||||
DECL_IOCTL(ptp);
|
||||
DECL_IOCTL(scsi);
|
||||
|
14
evdev.c
14
evdev.c
@ -30,6 +30,7 @@
|
||||
#include "defs.h"
|
||||
|
||||
#include "xlat/evdev_abs.h"
|
||||
#include "xlat/evdev_ev.h"
|
||||
|
||||
#ifdef HAVE_LINUX_INPUT_H
|
||||
|
||||
@ -47,7 +48,6 @@
|
||||
# include "xlat/evdev_relative_axes.h"
|
||||
# include "xlat/evdev_snd.h"
|
||||
# include "xlat/evdev_switch.h"
|
||||
# include "xlat/evdev_sync.h"
|
||||
|
||||
# ifndef SYN_MAX
|
||||
# define SYN_MAX 0xf
|
||||
@ -171,10 +171,10 @@ decode_bitset_(struct tcb *const tcp, const kernel_ulong_t arg,
|
||||
tprints(", ");
|
||||
|
||||
unsigned int size;
|
||||
if ((kernel_ulong_t) tcp->u_rval > max_nr)
|
||||
if ((kernel_ulong_t) tcp->u_rval > max_nr / 8)
|
||||
size = max_nr;
|
||||
else
|
||||
size = tcp->u_rval;
|
||||
size = tcp->u_rval * 8;
|
||||
char decoded_arg[size];
|
||||
|
||||
if (umove_or_printaddr(tcp, arg, &decoded_arg))
|
||||
@ -208,7 +208,7 @@ decode_bitset_(struct tcb *const tcp, const kernel_ulong_t arg,
|
||||
|
||||
#define decode_bitset(tcp_, arg_, decode_nr_, max_nr_, dflt_, xt_) \
|
||||
decode_bitset_((tcp_), (arg_), (decode_nr_), (max_nr_), \
|
||||
(dflt_), ARRAY_SIZE(decode_nr_), (xt_))
|
||||
(dflt_), ARRAY_SIZE(decode_nr_) - 1, (xt_))
|
||||
|
||||
# ifdef EVIOCGMTSLOTS
|
||||
static int
|
||||
@ -258,9 +258,9 @@ bit_ioctl(struct tcb *const tcp, const unsigned int ev_nr,
|
||||
const kernel_ulong_t arg)
|
||||
{
|
||||
switch (ev_nr) {
|
||||
case EV_SYN:
|
||||
return decode_bitset(tcp, arg, evdev_sync,
|
||||
SYN_MAX, "SYN_???", XT_INDEXED);
|
||||
case 0:
|
||||
return decode_bitset(tcp, arg, evdev_ev,
|
||||
EV_MAX, "EV_???", XT_SORTED);
|
||||
case EV_KEY:
|
||||
return decode_bitset(tcp, arg, evdev_keycode,
|
||||
KEY_MAX, "KEY_???", XT_INDEXED);
|
||||
|
@ -36,11 +36,11 @@
|
||||
struct number_set *read_set;
|
||||
struct number_set *write_set;
|
||||
struct number_set *signal_set;
|
||||
struct number_set *trace_set;
|
||||
|
||||
static struct number_set *abbrev_set;
|
||||
static struct number_set *inject_set;
|
||||
static struct number_set *raw_set;
|
||||
static struct number_set *trace_set;
|
||||
static struct number_set *verbose_set;
|
||||
|
||||
/* Only syscall numbers are personality-specific so far. */
|
||||
|
380
filter_seccomp.c
380
filter_seccomp.c
@ -1,380 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Chen Jingpiao <chenjingpiao@gmail.com>
|
||||
* Copyright (c) 2018 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
#include "ptrace.h"
|
||||
#include <sys/prctl.h>
|
||||
#include <sys/wait.h>
|
||||
#include <linux/audit.h>
|
||||
#include <linux/filter.h>
|
||||
#include <linux/seccomp.h>
|
||||
#include <asm/unistd.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "filter_seccomp.h"
|
||||
#include "number_set.h"
|
||||
|
||||
bool enable_seccomp_filter = false;
|
||||
bool seccomp_before_ptrace;
|
||||
|
||||
static void
|
||||
check_seccomp_order_do_child(void)
|
||||
{
|
||||
struct sock_filter filter[] = {
|
||||
BPF_STMT(BPF_LD + BPF_W + BPF_ABS,
|
||||
offsetof(struct seccomp_data, nr)),
|
||||
BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, __NR_getuid, 0, 1),
|
||||
BPF_STMT(BPF_RET + BPF_K, SECCOMP_RET_TRACE),
|
||||
BPF_STMT(BPF_RET + BPF_K, SECCOMP_RET_ALLOW)
|
||||
};
|
||||
|
||||
struct sock_fprog prog = {
|
||||
.len = ARRAY_SIZE(filter),
|
||||
.filter = filter
|
||||
};
|
||||
if (ptrace(PTRACE_TRACEME, 0, NULL, NULL) < 0)
|
||||
perror_func_msg_and_die("ptrace(PTRACE_TRACEME, ...");
|
||||
if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) < 0)
|
||||
perror_func_msg_and_die("prctl(PR_SET_NO_NEW_PRIVS, 1, ...");
|
||||
if (prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog) < 0)
|
||||
perror_func_msg_and_die("prctl(PR_SET_SECCOMP)");
|
||||
kill(getpid(), SIGSTOP);
|
||||
syscall(__NR_getuid);
|
||||
pause();
|
||||
_exit(0);
|
||||
}
|
||||
|
||||
static void
|
||||
check_seccomp_order_tracer(int pid)
|
||||
{
|
||||
int status, tracee_pid, flags = 0;
|
||||
|
||||
while (1) {
|
||||
errno = 0;
|
||||
tracee_pid = waitpid(pid, &status, 0);
|
||||
if (tracee_pid <= 0) {
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
perror_func_msg_and_die("unexpected wait result %d",
|
||||
tracee_pid);
|
||||
}
|
||||
if (flags == 0) {
|
||||
if (ptrace(PTRACE_SETOPTIONS, pid, 0,
|
||||
PTRACE_O_TRACESECCOMP) < 0)
|
||||
perror_func_msg_and_die("ptrace(PTRACE_SETOPTIONS, ...");
|
||||
if (ptrace(PTRACE_SYSCALL, pid, NULL, NULL) < 0)
|
||||
perror_func_msg_and_die("ptrace(PTRACE_SYSCALL, ...");
|
||||
} else if (flags == 1) {
|
||||
if ((status >> 16) == PTRACE_EVENT_SECCOMP)
|
||||
seccomp_before_ptrace = true;
|
||||
else
|
||||
seccomp_before_ptrace = false;
|
||||
kill(pid, SIGKILL);
|
||||
} else {
|
||||
if (WIFSIGNALED(status))
|
||||
break;
|
||||
|
||||
error_func_msg_and_die("unexpected wait status %#x",
|
||||
status);
|
||||
}
|
||||
flags++;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
check_seccomp_order(void)
|
||||
{
|
||||
int pid;
|
||||
|
||||
pid = fork();
|
||||
if (pid < 0)
|
||||
perror_func_msg_and_die("fork");
|
||||
|
||||
if (pid == 0)
|
||||
check_seccomp_order_do_child();
|
||||
|
||||
check_seccomp_order_tracer(pid);
|
||||
}
|
||||
|
||||
static bool
|
||||
traced_by_seccomp(unsigned int scno, unsigned int p)
|
||||
{
|
||||
return !sysent_vec[p][scno].sys_func
|
||||
|| sysent_vec[p][scno].sys_flags & TRACE_INDIRECT_SUBCALL
|
||||
|| is_number_in_set_array(scno, trace_set, p)
|
||||
|| strcmp("execve", sysent_vec[p][scno].sys_name) == 0
|
||||
|| strcmp("execveat", sysent_vec[p][scno].sys_name) == 0
|
||||
#if defined SPARC || defined SPARC64
|
||||
|| strcmp("execv", sysent_vec[p][scno].sys_name) == 0
|
||||
#endif
|
||||
|| strcmp("socketcall", sysent_vec[p][scno].sys_name) == 0
|
||||
|| strcmp("ipc", sysent_vec[p][scno].sys_name) == 0
|
||||
#ifdef LINUX_MIPSO32
|
||||
|| strcmp("syscall", sysent_vec[p][scno].sys_name) == 0
|
||||
#endif
|
||||
;
|
||||
}
|
||||
|
||||
static void
|
||||
check_bpf_instruction_number(void)
|
||||
{
|
||||
for (unsigned int p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
|
||||
unsigned int lower = UINT_MAX, count = 0;
|
||||
|
||||
for (unsigned int i = 0; i < nsyscall_vec[p]; ++i) {
|
||||
if (traced_by_seccomp(i, p)) {
|
||||
if (lower == UINT_MAX)
|
||||
lower = i;
|
||||
continue;
|
||||
}
|
||||
if (lower == UINT_MAX)
|
||||
continue;
|
||||
if (lower + 1 == i)
|
||||
count++;
|
||||
else
|
||||
count += 2;
|
||||
lower = UINT_MAX;
|
||||
}
|
||||
if (lower != UINT_MAX)
|
||||
count += 2;
|
||||
if (count > SECCOMP_TRACE_SYSCALL_MAX) {
|
||||
enable_seccomp_filter = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
check_seccomp_filter(void)
|
||||
{
|
||||
if (!enable_seccomp_filter)
|
||||
goto end;
|
||||
#ifdef SECCOMP_MODE_FILTER
|
||||
int rc;
|
||||
|
||||
if (NOMMU_SYSTEM) {
|
||||
enable_seccomp_filter = false;
|
||||
goto end;
|
||||
}
|
||||
|
||||
rc = prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0);
|
||||
if (rc < 0 && errno == EINVAL)
|
||||
enable_seccomp_filter = false;
|
||||
else
|
||||
enable_seccomp_filter = true;
|
||||
if (enable_seccomp_filter)
|
||||
check_bpf_instruction_number();
|
||||
if (enable_seccomp_filter)
|
||||
check_seccomp_order();
|
||||
#else
|
||||
enable_seccomp_filter = false;
|
||||
#endif
|
||||
end:
|
||||
debug_msg("seccomp-filter: %s",
|
||||
enable_seccomp_filter ? "enable" : "disable");
|
||||
}
|
||||
|
||||
static unsigned short
|
||||
bpf_add_traced_syscall(struct sock_filter *filter,
|
||||
unsigned int lower, unsigned int upper)
|
||||
{
|
||||
if (lower + 1 == upper) {
|
||||
/* filter[X].jt will set when return instruction added */
|
||||
SET_BPF_JUMP(filter, BPF_JMP + BPF_JEQ + BPF_K, lower, 0, 0);
|
||||
return 1;
|
||||
} else {
|
||||
SET_BPF_JUMP(filter, BPF_JMP + BPF_JGE + BPF_K, lower, 0, 1);
|
||||
++filter;
|
||||
/* filter[X].jf will set when return instruction added */
|
||||
SET_BPF_JUMP(filter, BPF_JMP + BPF_JGE + BPF_K, upper, 0, 0);
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
dump_seccomp_bpf(const struct sock_filter *filter, unsigned short len)
|
||||
{
|
||||
for (unsigned int i = 0; i < len; ++i) {
|
||||
if (filter[i].code == BPF_LD + BPF_W + BPF_ABS) {
|
||||
debug_msg("STMT(BPF_LD + BPF_W + BPF_ABS, %u)", filter[i].k);
|
||||
} else if (filter[i].code == BPF_RET + BPF_K) {
|
||||
debug_msg("STMT(BPF_RET + BPF_K, %u)", filter[i].k);
|
||||
} else if (filter[i].code == BPF_JMP + BPF_JEQ + BPF_K) {
|
||||
debug_msg("JUMP(BPF_JMP + BPF_JEQ + BPF_K, %u, %u, %u)",
|
||||
filter[i].jt, filter[i].jf, filter[i].k);
|
||||
} else if (filter[i].code == BPF_JMP + BPF_JGE + BPF_K) {
|
||||
debug_msg("JUMP(BPF_JMP + BPF_JGE + BPF_K, %u, %u, %u)",
|
||||
filter[i].jt, filter[i].jf, filter[i].k);
|
||||
} else {
|
||||
debug_msg("STMT(%u, %u, %u, %u)",
|
||||
filter[i].code, filter[i].jt,
|
||||
filter[i].jf, filter[i].k);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned short
|
||||
init_sock_filter(struct sock_filter *filter)
|
||||
{
|
||||
unsigned short pos = 0;
|
||||
#if SUPPORTED_PERSONALITIES > 1
|
||||
unsigned int audit_arch_vec[] = {
|
||||
# if defined X86_64
|
||||
AUDIT_ARCH_X86_64,
|
||||
AUDIT_ARCH_I386,
|
||||
AUDIT_ARCH_X86_64
|
||||
# elif SUPPORTED_PERSONALITIES == 2
|
||||
AUDIT_ARCH_X86_64,
|
||||
AUDIT_ARCH_I386
|
||||
# endif
|
||||
};
|
||||
#endif
|
||||
unsigned int syscall_bit_vec[] = {
|
||||
#if defined X86_64
|
||||
0, 0, __X32_SYSCALL_BIT
|
||||
#elif defined X32
|
||||
__X32_SYSCALL_BIT, 0
|
||||
#elif SUPPORTED_PERSONALITIES == 2
|
||||
0, 0
|
||||
#else
|
||||
0
|
||||
#endif
|
||||
};
|
||||
|
||||
#if SUPPORTED_PERSONALITIES > 1
|
||||
SET_BPF_STMT(&filter[pos++], BPF_LD + BPF_W + BPF_ABS,
|
||||
offsetof(struct seccomp_data, arch));
|
||||
#endif
|
||||
for (unsigned int p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
|
||||
unsigned int lower = UINT_MAX;
|
||||
unsigned short previous = pos, start, end;
|
||||
|
||||
#if SUPPORTED_PERSONALITIES > 1
|
||||
/* filter[X].jf will set when return instruction added */
|
||||
SET_BPF_JUMP(&filter[pos++], BPF_JMP + BPF_JEQ + BPF_K,
|
||||
audit_arch_vec[p], 0, 0);
|
||||
#endif
|
||||
SET_BPF_STMT(&filter[pos++], BPF_LD + BPF_W + BPF_ABS,
|
||||
offsetof(struct seccomp_data, nr));
|
||||
|
||||
start = pos;
|
||||
for (unsigned int i = 0; i < nsyscall_vec[p]; ++i) {
|
||||
if (traced_by_seccomp(i, p)) {
|
||||
if (lower == UINT_MAX)
|
||||
lower = i;
|
||||
continue;
|
||||
}
|
||||
if (lower == UINT_MAX)
|
||||
continue;
|
||||
pos += bpf_add_traced_syscall(filter + pos,
|
||||
lower + syscall_bit_vec[p],
|
||||
i + syscall_bit_vec[p]);
|
||||
lower = UINT_MAX;
|
||||
}
|
||||
if (lower != UINT_MAX)
|
||||
pos += bpf_add_traced_syscall(filter + pos,
|
||||
lower + syscall_bit_vec[p],
|
||||
nsyscall_vec[p] + syscall_bit_vec[p]);
|
||||
end = pos;
|
||||
|
||||
#ifdef X86_64
|
||||
if (p == 0) {
|
||||
SET_BPF_JUMP(&filter[pos++], BPF_JMP + BPF_JGE + BPF_K,
|
||||
__X32_SYSCALL_BIT, 0, 2);
|
||||
SET_BPF_STMT(&filter[pos++], BPF_LD + BPF_W + BPF_ABS,
|
||||
offsetof(struct seccomp_data, arch));
|
||||
SET_BPF_JUMP(&filter[pos++], BPF_JMP + BPF_JEQ + BPF_K,
|
||||
AUDIT_ARCH_X86_64, 3, 0);
|
||||
|
||||
SET_BPF_STMT(&filter[pos++], BPF_LD + BPF_W + BPF_ABS,
|
||||
offsetof(struct seccomp_data, nr));
|
||||
}
|
||||
#endif
|
||||
SET_BPF_JUMP(&filter[pos++], BPF_JMP + BPF_JGE + BPF_K,
|
||||
nsyscall_vec[p] + syscall_bit_vec[p], 1, 0);
|
||||
|
||||
SET_BPF_STMT(&filter[pos++], BPF_RET + BPF_K,
|
||||
SECCOMP_RET_ALLOW);
|
||||
SET_BPF_STMT(&filter[pos++], BPF_RET + BPF_K,
|
||||
SECCOMP_RET_TRACE);
|
||||
filter[previous].jf = pos - previous - 1;
|
||||
for (unsigned int i = start; i < end; ++i) {
|
||||
if (BPF_CLASS(filter[i].code) != BPF_JMP)
|
||||
continue;
|
||||
if (BPF_OP(filter[i].code) == BPF_JEQ)
|
||||
filter[i].jt = pos - i - 2;
|
||||
else if (BPF_OP(filter[i].code) == BPF_JGE
|
||||
&& filter[i].jf == 0)
|
||||
filter[i].jf = pos - i - 2;
|
||||
}
|
||||
}
|
||||
#if SUPPORTED_PERSONALITIES > 1
|
||||
SET_BPF_STMT(&filter[pos++], BPF_RET + BPF_K, SECCOMP_RET_TRACE);
|
||||
#endif
|
||||
|
||||
dump_seccomp_bpf(filter, pos);
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
static void
|
||||
do_seccomp(struct sock_fprog *prog)
|
||||
{
|
||||
if (prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, prog) < 0)
|
||||
perror_msg_and_die("prctl");
|
||||
}
|
||||
|
||||
void
|
||||
init_seccomp_filter(void)
|
||||
{
|
||||
struct sock_filter filter[SECCOMP_BPF_MAXINSNS];
|
||||
unsigned short len;
|
||||
|
||||
len = init_sock_filter(filter);
|
||||
|
||||
struct sock_fprog prog = {
|
||||
.len = len,
|
||||
.filter = filter
|
||||
};
|
||||
|
||||
if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) < 0)
|
||||
perror_msg_and_die("prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)");
|
||||
|
||||
do_seccomp(&prog);
|
||||
}
|
||||
|
||||
int
|
||||
seccomp_filter_restart_operator(const struct tcb *tcp)
|
||||
{
|
||||
if (tcp
|
||||
&& (tcp->flags & TCB_INSYSCALL)
|
||||
&& traced_by_seccomp(tcp->scno, current_personality))
|
||||
return PTRACE_SYSCALL;
|
||||
return PTRACE_CONT;
|
||||
}
|
7
futex.c
7
futex.c
@ -41,6 +41,7 @@
|
||||
# define FUTEX_OP_OPARG_SHIFT 8
|
||||
#endif
|
||||
|
||||
#include "xlat/futexbitset.h"
|
||||
#include "xlat/futexops.h"
|
||||
#include "xlat/futexwakeops.h"
|
||||
#include "xlat/futexwakecmps.h"
|
||||
@ -74,11 +75,13 @@ SYS_FUNC(futex)
|
||||
tprintf(", %u", val);
|
||||
tprints(", ");
|
||||
print_timespec(tcp, timeout);
|
||||
tprintf(", %#x", val3);
|
||||
tprints(", ");
|
||||
printxval(futexbitset, val3, NULL);
|
||||
break;
|
||||
case FUTEX_WAKE_BITSET:
|
||||
tprintf(", %u", val);
|
||||
tprintf(", %#x", val3);
|
||||
tprints(", ");
|
||||
printxval(futexbitset, val3, NULL);
|
||||
break;
|
||||
case FUTEX_REQUEUE:
|
||||
tprintf(", %u", val);
|
||||
|
29
gcc_compat.h
29
gcc_compat.h
@ -33,10 +33,20 @@
|
||||
# define GNUC_PREREQ(maj, min) \
|
||||
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
|
||||
#else
|
||||
# define __attribute__(x) /* empty */
|
||||
# define GNUC_PREREQ(maj, min) 0
|
||||
#endif
|
||||
|
||||
#if defined __clang__ && defined __clang_major__ && defined __clang_minor__
|
||||
# define CLANG_PREREQ(maj, min) \
|
||||
((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min))
|
||||
#else
|
||||
# define CLANG_PREREQ(maj, min) 0
|
||||
#endif
|
||||
|
||||
#if !(GNUC_PREREQ(2, 0) || CLANG_PREREQ(1, 0))
|
||||
# define __attribute__(x) /* empty */
|
||||
#endif
|
||||
|
||||
#if GNUC_PREREQ(2, 5)
|
||||
# define ATTRIBUTE_NORETURN __attribute__((__noreturn__))
|
||||
#else
|
||||
@ -99,6 +109,23 @@
|
||||
# define ATTRIBUTE_FALLTHROUGH ((void) 0)
|
||||
#endif
|
||||
|
||||
#if CLANG_PREREQ(2, 8)
|
||||
# define DIAG_PUSH_IGNORE_OVERRIDE_INIT \
|
||||
_Pragma("clang diagnostic push"); \
|
||||
_Pragma("clang diagnostic ignored \"-Winitializer-overrides\"");
|
||||
# define DIAG_POP_IGNORE_OVERRIDE_INIT \
|
||||
_Pragma("clang diagnostic pop");
|
||||
#elif GNUC_PREREQ(4, 2)
|
||||
# define DIAG_PUSH_IGNORE_OVERRIDE_INIT \
|
||||
_Pragma("GCC diagnostic push"); \
|
||||
_Pragma("GCC diagnostic ignored \"-Woverride-init\"");
|
||||
# define DIAG_POP_IGNORE_OVERRIDE_INIT \
|
||||
_Pragma("GCC diagnostic pop");
|
||||
#else
|
||||
# define DIAG_PUSH_IGNORE_OVERRIDE_INIT /* empty */
|
||||
# define DIAG_POP_IGNORE_OVERRIDE_INIT /* empty */
|
||||
#endif
|
||||
|
||||
#if GNUC_PREREQ(6, 0)
|
||||
# define DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE \
|
||||
_Pragma("GCC diagnostic push"); \
|
||||
|
9
ioctl.c
9
ioctl.c
@ -33,8 +33,6 @@
|
||||
#include <linux/ioctl.h>
|
||||
#include "xlat/ioctl_dirs.h"
|
||||
|
||||
#include "xlat/evdev_ev.h"
|
||||
|
||||
static int
|
||||
compare(const void *a, const void *b)
|
||||
{
|
||||
@ -99,7 +97,10 @@ evdev_decode_number(const unsigned int code)
|
||||
|
||||
if (nr >= 0x20 && nr <= 0x20 + 0x1f) {
|
||||
tprints("EVIOCGBIT(");
|
||||
printxval(evdev_ev, nr - 0x20, "EV_???");
|
||||
if (nr == 0x20)
|
||||
tprintf("0");
|
||||
else
|
||||
printxval(evdev_ev, nr - 0x20, "EV_???");
|
||||
tprintf(", %u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
} else if (nr >= 0x40 && nr <= 0x40 + 0x3f) {
|
||||
@ -326,6 +327,8 @@ ioctl_decode(struct tcb *tcp)
|
||||
#endif
|
||||
case 'I':
|
||||
return inotify_ioctl(tcp, code, arg);
|
||||
case 0xab:
|
||||
return nbd_ioctl(tcp, code, arg);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
14
ioprio.c
14
ioprio.c
@ -29,21 +29,7 @@
|
||||
#include "defs.h"
|
||||
#include "xstring.h"
|
||||
|
||||
enum {
|
||||
IOPRIO_WHO_PROCESS = 1,
|
||||
IOPRIO_WHO_PGRP,
|
||||
IOPRIO_WHO_USER
|
||||
};
|
||||
|
||||
#include "xlat/ioprio_who.h"
|
||||
|
||||
enum {
|
||||
IOPRIO_CLASS_NONE,
|
||||
IOPRIO_CLASS_RT,
|
||||
IOPRIO_CLASS_BE,
|
||||
IOPRIO_CLASS_IDLE
|
||||
};
|
||||
|
||||
#include "xlat/ioprio_class.h"
|
||||
|
||||
#define IOPRIO_CLASS_SHIFT (13)
|
||||
|
13
kvm.c
13
kvm.c
@ -323,6 +323,16 @@ kvm_ioctl_decode_sregs(struct tcb *const tcp, const unsigned int code,
|
||||
}
|
||||
# endif /* HAVE_STRUCT_KVM_SREGS */
|
||||
|
||||
# include "xlat/kvm_cap.h"
|
||||
static int
|
||||
kvm_ioctl_decode_check_extension(struct tcb *const tcp, const unsigned int code,
|
||||
const kernel_ulong_t arg)
|
||||
{
|
||||
tprints(", ");
|
||||
printxval_index(kvm_cap, arg, "KVM_CAP_???");
|
||||
return RVAL_IOCTL_DECODED;
|
||||
}
|
||||
|
||||
# include "xlat/kvm_exit_reason.h"
|
||||
static void
|
||||
kvm_ioctl_run_attach_auxstr(struct tcb *const tcp,
|
||||
@ -403,6 +413,9 @@ kvm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t a
|
||||
return kvm_ioctl_decode_cpuid2(tcp, code, arg);
|
||||
# endif
|
||||
|
||||
case KVM_CHECK_EXTENSION:
|
||||
return kvm_ioctl_decode_check_extension(tcp, code, arg);
|
||||
|
||||
case KVM_CREATE_VM:
|
||||
return RVAL_DECODED | RVAL_FD;
|
||||
|
||||
|
@ -794,17 +794,13 @@
|
||||
{ "linux/dvb/audio.h", "AUDIO_CLEAR_BUFFER", _IOC_NONE, 0x6f0c, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_CONTINUE", _IOC_NONE, 0x6f04, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_GET_CAPABILITIES", _IOC_READ, 0x6f0b, 0x04 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_GET_PTS", _IOC_READ, 0x6f13, 0x08 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_GET_STATUS", _IOC_READ, 0x6f0a, 0x20 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_PAUSE", _IOC_NONE, 0x6f03, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_PLAY", _IOC_NONE, 0x6f02, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SELECT_SOURCE", _IOC_NONE, 0x6f05, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_ATTRIBUTES", _IOC_WRITE, 0x6f11, 0x02 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_AV_SYNC", _IOC_NONE, 0x6f07, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_BYPASS_MODE", _IOC_NONE, 0x6f08, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_EXT_ID", _IOC_NONE, 0x6f10, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_ID", _IOC_NONE, 0x6f0d, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_KARAOKE", _IOC_WRITE, 0x6f12, 0x0c },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_MIXER", _IOC_WRITE, 0x6f0e, 0x08 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_MUTE", _IOC_NONE, 0x6f06, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_STREAMTYPE", _IOC_NONE, 0x6f0f, 0x00 },
|
||||
@ -863,23 +859,15 @@
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_CAPABILITIES", _IOC_READ, 0x6f21, 0x04 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_EVENT", _IOC_READ, 0x6f1c, 0x14 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_FRAME_COUNT", _IOC_READ, 0x6f3a, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_FRAME_RATE", _IOC_READ, 0x6f38, 0x04 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_NAVI", _IOC_READ, 0x6f34, 0x404 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_PTS", _IOC_READ, 0x6f39, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_SIZE", _IOC_READ, 0x6f37, 0x0c },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_STATUS", _IOC_READ, 0x6f1b, 0x14 },
|
||||
{ "linux/dvb/video.h", "VIDEO_PLAY", _IOC_NONE, 0x6f16, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SELECT_SOURCE", _IOC_NONE, 0x6f19, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_ATTRIBUTES", _IOC_NONE, 0x6f35, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_BLANK", _IOC_NONE, 0x6f1a, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_DISPLAY_FORMAT", _IOC_NONE, 0x6f1d, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_FORMAT", _IOC_NONE, 0x6f25, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_HIGHLIGHT", _IOC_WRITE, 0x6f27, 0x10 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_ID", _IOC_NONE, 0x6f23, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_SPU", _IOC_WRITE, 0x6f32, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_SPU_PALETTE", _IOC_WRITE, 0x6f33, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_STREAMTYPE", _IOC_NONE, 0x6f24, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_SYSTEM", _IOC_NONE, 0x6f26, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SLOWMOTION", _IOC_NONE, 0x6f20, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_STILLPICTURE", _IOC_WRITE, 0x6f1e, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_STOP", _IOC_NONE, 0x6f15, 0x00 },
|
||||
@ -952,6 +940,14 @@
|
||||
{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SET_ISO_CHANNELS", _IOC_WRITE, 0x2317, 0x0c },
|
||||
{ "linux/firewire-cdev.h", "FW_CDEV_IOC_START_ISO", _IOC_WRITE, 0x230a, 0x10 },
|
||||
{ "linux/firewire-cdev.h", "FW_CDEV_IOC_STOP_ISO", _IOC_WRITE, 0x230b, 0x04 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_CHECK_EXTENSION", _IOC_NONE, 0xb601, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_PR", _IOC_NONE, 0xb680, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_GET_API_VERSION", _IOC_NONE, 0xb600, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_MAP", _IOC_NONE, 0xb643, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_UNMAP", _IOC_NONE, 0xb644, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_INFO", _IOC_NONE, 0xb641, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_REGION_INFO", _IOC_NONE, 0xb642, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_RESET", _IOC_NONE, 0xb640, 0x00 },
|
||||
{ "linux/fs.h", "BLKALIGNOFF", _IOC_NONE, 0x127a, 0x00 },
|
||||
{ "linux/fs.h", "BLKBSZGET", _IOC_READ, 0x1270, 0x04 },
|
||||
{ "linux/fs.h", "BLKBSZSET", _IOC_WRITE, 0x1271, 0x04 },
|
||||
@ -1004,6 +1000,10 @@
|
||||
{ "linux/fs.h", "FS_IOC_SETFSLABEL", _IOC_WRITE, 0x9432, 0x100 },
|
||||
{ "linux/fs.h", "FS_IOC_SETVERSION", _IOC_WRITE, 0x7602, 0x04 },
|
||||
{ "linux/fs.h", "FS_IOC_SET_ENCRYPTION_POLICY", _IOC_READ, 0x6613, 0x0c },
|
||||
{ "linux/fsi.h", "FSI_SCOM_CHECK", _IOC_READ, 0x7300, 0x04 },
|
||||
{ "linux/fsi.h", "FSI_SCOM_READ", _IOC_READ|_IOC_WRITE, 0x7301, 0x1e },
|
||||
{ "linux/fsi.h", "FSI_SCOM_RESET", _IOC_WRITE, 0x7303, 0x04 },
|
||||
{ "linux/fsi.h", "FSI_SCOM_WRITE", _IOC_READ|_IOC_WRITE, 0x7302, 0x1e },
|
||||
{ "linux/fsl-diu-fb.h", "MFB_GET_ALPHA", _IOC_READ, 0x4d00, 0x01 },
|
||||
{ "linux/fsl-diu-fb.h", "MFB_GET_AOID", _IOC_READ, 0x4d04, 0x08 },
|
||||
{ "linux/fsl-diu-fb.h", "MFB_GET_GAMMA", _IOC_READ, 0x4d01, 0x01 },
|
||||
@ -1335,6 +1335,7 @@
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_VERSION", _IOC_READ, 0x4b01, 0x08 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_MAP_MEMORY_TO_GPU", _IOC_READ|_IOC_WRITE, 0x4b18, 0x18 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_RESET_EVENT", _IOC_WRITE, 0x4b0b, 0x08 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_CU_MASK", _IOC_WRITE, 0x4b1a, 0x10 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_EVENT", _IOC_WRITE, 0x4b0a, 0x08 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_MEMORY_POLICY", _IOC_WRITE, 0x4b04, 0x20 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_SCRATCH_BACKING_VA", _IOC_READ|_IOC_WRITE, 0x4b11, 0x10 },
|
||||
@ -1512,9 +1513,12 @@
|
||||
{ "linux/omapfb.h", "OMAPFB_WAITFORVSYNC", _IOC_NONE, 0x4f39, 0x00 },
|
||||
{ "linux/pcitest.h", "PCITEST_BAR", _IOC_NONE, 0x5001, 0x00 },
|
||||
{ "linux/pcitest.h", "PCITEST_COPY", _IOC_WRITE, 0x5006, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_GET_IRQTYPE", _IOC_NONE, 0x5009, 0x00 },
|
||||
{ "linux/pcitest.h", "PCITEST_LEGACY_IRQ", _IOC_NONE, 0x5002, 0x00 },
|
||||
{ "linux/pcitest.h", "PCITEST_MSI", _IOC_WRITE, 0x5003, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_MSIX", _IOC_WRITE, 0x5007, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_READ", _IOC_WRITE, 0x5005, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_SET_IRQTYPE", _IOC_WRITE, 0x5008, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_WRITE", _IOC_WRITE, 0x5004, 0x04 },
|
||||
{ "linux/perf_event.h", "PERF_EVENT_IOC_DISABLE", _IOC_NONE, 0x2401, 0x00 },
|
||||
{ "linux/perf_event.h", "PERF_EVENT_IOC_ENABLE", _IOC_NONE, 0x2400, 0x00 },
|
||||
@ -2027,6 +2031,7 @@
|
||||
{ "linux/usb/functionfs.h", "FUNCTIONFS_INTERFACE_REVMAP", _IOC_NONE, 0x6780, 0x00 },
|
||||
{ "linux/usb/g_printer.h", "GADGET_GET_PRINTER_STATUS", _IOC_READ, 0x6721, 0x01 },
|
||||
{ "linux/usb/g_printer.h", "GADGET_SET_PRINTER_STATUS", _IOC_READ|_IOC_WRITE, 0x6722, 0x01 },
|
||||
{ "linux/usb/g_uvc.h", "UVCIOC_SEND_RESPONSE", _IOC_WRITE, 0x5501, 0x40 },
|
||||
{ "linux/usb/gadgetfs.h", "GADGETFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 },
|
||||
{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 },
|
||||
{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 },
|
||||
@ -2038,12 +2043,17 @@
|
||||
{ "linux/usb/tmc.h", "USBTMC488_IOCTL_LOCAL_LOCKOUT", _IOC_NONE, 0x5b15, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC488_IOCTL_READ_STB", _IOC_READ, 0x5b12, 0x01 },
|
||||
{ "linux/usb/tmc.h", "USBTMC488_IOCTL_REN_CONTROL", _IOC_WRITE, 0x5b13, 0x01 },
|
||||
{ "linux/usb/tmc.h", "USBTMC488_IOCTL_TRIGGER", _IOC_NONE, 0x5b16, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_IN", _IOC_NONE, 0x5b04, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_OUT", _IOC_NONE, 0x5b03, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR", _IOC_NONE, 0x5b02, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_IN_HALT", _IOC_NONE, 0x5b07, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_OUT_HALT", _IOC_NONE, 0x5b06, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_CONFIG_TERMCHAR", _IOC_WRITE, 0x5b0c, 0x02 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_EOM_ENABLE", _IOC_WRITE, 0x5b0b, 0x01 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_GET_TIMEOUT", _IOC_READ, 0x5b09, 0x04 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_INDICATOR_PULSE", _IOC_NONE, 0x5b01, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_SET_TIMEOUT", _IOC_WRITE, 0x5b0a, 0x04 },
|
||||
{ "linux/usbdevice_fs.h", "USBDEVFS_ALLOC_STREAMS", _IOC_READ, 0x551c, 0x08 },
|
||||
{ "linux/usbdevice_fs.h", "USBDEVFS_BULK", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 },
|
||||
{ "linux/usbdevice_fs.h", "USBDEVFS_BULK32", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 },
|
||||
@ -2087,21 +2097,14 @@
|
||||
{ "linux/userfaultfd.h", "UFFDIO_ZEROPAGE", _IOC_READ|_IOC_WRITE, 0xaa04, 0x20 },
|
||||
{ "linux/uvcvideo.h", "UVCIOC_CTRL_MAP", _IOC_READ|_IOC_WRITE, 0x7520, 0x58 },
|
||||
{ "linux/uvcvideo.h", "UVCIOC_CTRL_QUERY", _IOC_READ|_IOC_WRITE, 0x7521, 0x0a },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x564b, 0x40 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_SIZE", _IOC_READ|_IOC_WRITE, 0x564a, 0x40 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_MBUS_CODE", _IOC_READ|_IOC_WRITE, 0x5602, 0x30 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x38 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x24 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0x58 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5615, 0x30 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x563d, 0x40 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_CROP", _IOC_READ|_IOC_WRITE, 0x563c, 0x38 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x24 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0x58 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5616, 0x30 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x563e, 0x40 },
|
||||
@ -2143,6 +2146,7 @@
|
||||
{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY", _IOC_NONE, 0x3b76, 0x00 },
|
||||
{ "linux/vfio.h", "VFIO_IOMMU_UNMAP_DMA", _IOC_NONE, 0x3b72, 0x00 },
|
||||
{ "linux/vfio.h", "VFIO_SET_IOMMU", _IOC_NONE, 0x3b66, 0x00 },
|
||||
{ "linux/vhost.h", "VHOST_GET_BACKEND_FEATURES", _IOC_READ, 0xaf26, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_GET_FEATURES", _IOC_READ, 0xaf00, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_GET_VRING_BASE", _IOC_READ|_IOC_WRITE, 0xaf12, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_GET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf24, 0x08 },
|
||||
@ -2154,6 +2158,7 @@
|
||||
{ "linux/vhost.h", "VHOST_SCSI_GET_EVENTS_MISSED", _IOC_WRITE, 0xaf44, 0x04 },
|
||||
{ "linux/vhost.h", "VHOST_SCSI_SET_ENDPOINT", _IOC_WRITE, 0xaf40, 0xe8 },
|
||||
{ "linux/vhost.h", "VHOST_SCSI_SET_EVENTS_MISSED", _IOC_WRITE, 0xaf43, 0x04 },
|
||||
{ "linux/vhost.h", "VHOST_SET_BACKEND_FEATURES", _IOC_WRITE, 0xaf25, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_SET_FEATURES", _IOC_WRITE, 0xaf00, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_SET_LOG_BASE", _IOC_WRITE, 0xaf04, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_SET_LOG_FD", _IOC_WRITE, 0xaf07, 0x04 },
|
||||
@ -2223,7 +2228,6 @@
|
||||
{ "linux/videodev2.h", "VIDIOC_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 },
|
||||
{ "linux/videodev2.h", "VIDIOC_QUERY_EXT_CTRL", _IOC_READ|_IOC_WRITE, 0x5667, 0xe8 },
|
||||
{ "linux/videodev2.h", "VIDIOC_REQBUFS", _IOC_READ|_IOC_WRITE, 0x5608, 0x14 },
|
||||
{ "linux/videodev2.h", "VIDIOC_RESERVED", _IOC_NONE, 0x5601, 0x00 },
|
||||
{ "linux/videodev2.h", "VIDIOC_STREAMOFF", _IOC_WRITE, 0x5613, 0x04 },
|
||||
{ "linux/videodev2.h", "VIDIOC_STREAMON", _IOC_WRITE, 0x5612, 0x04 },
|
||||
{ "linux/videodev2.h", "VIDIOC_SUBSCRIBE_EVENT", _IOC_WRITE, 0x565a, 0x20 },
|
||||
@ -2750,6 +2754,10 @@
|
||||
{ "xen/evtchn.h", "IOCTL_EVTCHN_RESET", _IOC_NONE, 0x4505, 0x00 },
|
||||
{ "xen/evtchn.h", "IOCTL_EVTCHN_RESTRICT_DOMID", _IOC_NONE, 0x4506, 0x02 },
|
||||
{ "xen/evtchn.h", "IOCTL_EVTCHN_UNBIND", _IOC_NONE, 0x4503, 0x04 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS", _IOC_NONE, 0x4709, 0x14 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED", _IOC_NONE, 0x470a, 0x08 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_RELEASE", _IOC_NONE, 0x470c, 0x08 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_TO_REFS", _IOC_NONE, 0x470b, 0x14 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR", _IOC_NONE, 0x4702, 0x18 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_GRANT_COPY", _IOC_NONE, 0x4708, 0x08 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_MAP_GRANT_REF", _IOC_NONE, 0x4700, 0x18 },
|
||||
|
@ -794,17 +794,13 @@
|
||||
{ "linux/dvb/audio.h", "AUDIO_CLEAR_BUFFER", _IOC_NONE, 0x6f0c, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_CONTINUE", _IOC_NONE, 0x6f04, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_GET_CAPABILITIES", _IOC_READ, 0x6f0b, 0x04 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_GET_PTS", _IOC_READ, 0x6f13, 0x08 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_GET_STATUS", _IOC_READ, 0x6f0a, 0x20 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_PAUSE", _IOC_NONE, 0x6f03, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_PLAY", _IOC_NONE, 0x6f02, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SELECT_SOURCE", _IOC_NONE, 0x6f05, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_ATTRIBUTES", _IOC_WRITE, 0x6f11, 0x02 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_AV_SYNC", _IOC_NONE, 0x6f07, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_BYPASS_MODE", _IOC_NONE, 0x6f08, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_EXT_ID", _IOC_NONE, 0x6f10, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_ID", _IOC_NONE, 0x6f0d, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_KARAOKE", _IOC_WRITE, 0x6f12, 0x0c },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_MIXER", _IOC_WRITE, 0x6f0e, 0x08 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_MUTE", _IOC_NONE, 0x6f06, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_STREAMTYPE", _IOC_NONE, 0x6f0f, 0x00 },
|
||||
@ -863,23 +859,15 @@
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_CAPABILITIES", _IOC_READ, 0x6f21, 0x04 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_EVENT", _IOC_READ, 0x6f1c, 0x14 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_FRAME_COUNT", _IOC_READ, 0x6f3a, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_FRAME_RATE", _IOC_READ, 0x6f38, 0x04 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_NAVI", _IOC_READ, 0x6f34, 0x404 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_PTS", _IOC_READ, 0x6f39, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_SIZE", _IOC_READ, 0x6f37, 0x0c },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_STATUS", _IOC_READ, 0x6f1b, 0x14 },
|
||||
{ "linux/dvb/video.h", "VIDEO_PLAY", _IOC_NONE, 0x6f16, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SELECT_SOURCE", _IOC_NONE, 0x6f19, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_ATTRIBUTES", _IOC_NONE, 0x6f35, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_BLANK", _IOC_NONE, 0x6f1a, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_DISPLAY_FORMAT", _IOC_NONE, 0x6f1d, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_FORMAT", _IOC_NONE, 0x6f25, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_HIGHLIGHT", _IOC_WRITE, 0x6f27, 0x10 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_ID", _IOC_NONE, 0x6f23, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_SPU", _IOC_WRITE, 0x6f32, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_SPU_PALETTE", _IOC_WRITE, 0x6f33, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_STREAMTYPE", _IOC_NONE, 0x6f24, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_SYSTEM", _IOC_NONE, 0x6f26, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SLOWMOTION", _IOC_NONE, 0x6f20, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_STILLPICTURE", _IOC_WRITE, 0x6f1e, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_STOP", _IOC_NONE, 0x6f15, 0x00 },
|
||||
@ -952,6 +940,14 @@
|
||||
{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SET_ISO_CHANNELS", _IOC_WRITE, 0x2317, 0x0c },
|
||||
{ "linux/firewire-cdev.h", "FW_CDEV_IOC_START_ISO", _IOC_WRITE, 0x230a, 0x10 },
|
||||
{ "linux/firewire-cdev.h", "FW_CDEV_IOC_STOP_ISO", _IOC_WRITE, 0x230b, 0x04 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_CHECK_EXTENSION", _IOC_NONE, 0xb601, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_PR", _IOC_NONE, 0xb680, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_GET_API_VERSION", _IOC_NONE, 0xb600, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_MAP", _IOC_NONE, 0xb643, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_UNMAP", _IOC_NONE, 0xb644, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_INFO", _IOC_NONE, 0xb641, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_REGION_INFO", _IOC_NONE, 0xb642, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_RESET", _IOC_NONE, 0xb640, 0x00 },
|
||||
{ "linux/fs.h", "BLKALIGNOFF", _IOC_NONE, 0x127a, 0x00 },
|
||||
{ "linux/fs.h", "BLKBSZGET", _IOC_READ, 0x1270, 0x04 },
|
||||
{ "linux/fs.h", "BLKBSZSET", _IOC_WRITE, 0x1271, 0x04 },
|
||||
@ -1004,6 +1000,10 @@
|
||||
{ "linux/fs.h", "FS_IOC_SETFSLABEL", _IOC_WRITE, 0x9432, 0x100 },
|
||||
{ "linux/fs.h", "FS_IOC_SETVERSION", _IOC_WRITE, 0x7602, 0x04 },
|
||||
{ "linux/fs.h", "FS_IOC_SET_ENCRYPTION_POLICY", _IOC_READ, 0x6613, 0x0c },
|
||||
{ "linux/fsi.h", "FSI_SCOM_CHECK", _IOC_READ, 0x7300, 0x04 },
|
||||
{ "linux/fsi.h", "FSI_SCOM_READ", _IOC_READ|_IOC_WRITE, 0x7301, 0x20 },
|
||||
{ "linux/fsi.h", "FSI_SCOM_RESET", _IOC_WRITE, 0x7303, 0x04 },
|
||||
{ "linux/fsi.h", "FSI_SCOM_WRITE", _IOC_READ|_IOC_WRITE, 0x7302, 0x20 },
|
||||
{ "linux/fsl-diu-fb.h", "MFB_GET_ALPHA", _IOC_READ, 0x4d00, 0x01 },
|
||||
{ "linux/fsl-diu-fb.h", "MFB_GET_AOID", _IOC_READ, 0x4d04, 0x08 },
|
||||
{ "linux/fsl-diu-fb.h", "MFB_GET_GAMMA", _IOC_READ, 0x4d01, 0x01 },
|
||||
@ -1335,6 +1335,7 @@
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_VERSION", _IOC_READ, 0x4b01, 0x08 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_MAP_MEMORY_TO_GPU", _IOC_READ|_IOC_WRITE, 0x4b18, 0x18 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_RESET_EVENT", _IOC_WRITE, 0x4b0b, 0x08 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_CU_MASK", _IOC_WRITE, 0x4b1a, 0x10 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_EVENT", _IOC_WRITE, 0x4b0a, 0x08 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_MEMORY_POLICY", _IOC_WRITE, 0x4b04, 0x20 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_SCRATCH_BACKING_VA", _IOC_READ|_IOC_WRITE, 0x4b11, 0x10 },
|
||||
@ -1512,9 +1513,12 @@
|
||||
{ "linux/omapfb.h", "OMAPFB_WAITFORVSYNC", _IOC_NONE, 0x4f39, 0x00 },
|
||||
{ "linux/pcitest.h", "PCITEST_BAR", _IOC_NONE, 0x5001, 0x00 },
|
||||
{ "linux/pcitest.h", "PCITEST_COPY", _IOC_WRITE, 0x5006, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_GET_IRQTYPE", _IOC_NONE, 0x5009, 0x00 },
|
||||
{ "linux/pcitest.h", "PCITEST_LEGACY_IRQ", _IOC_NONE, 0x5002, 0x00 },
|
||||
{ "linux/pcitest.h", "PCITEST_MSI", _IOC_WRITE, 0x5003, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_MSIX", _IOC_WRITE, 0x5007, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_READ", _IOC_WRITE, 0x5005, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_SET_IRQTYPE", _IOC_WRITE, 0x5008, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_WRITE", _IOC_WRITE, 0x5004, 0x04 },
|
||||
{ "linux/perf_event.h", "PERF_EVENT_IOC_DISABLE", _IOC_NONE, 0x2401, 0x00 },
|
||||
{ "linux/perf_event.h", "PERF_EVENT_IOC_ENABLE", _IOC_NONE, 0x2400, 0x00 },
|
||||
@ -2027,6 +2031,7 @@
|
||||
{ "linux/usb/functionfs.h", "FUNCTIONFS_INTERFACE_REVMAP", _IOC_NONE, 0x6780, 0x00 },
|
||||
{ "linux/usb/g_printer.h", "GADGET_GET_PRINTER_STATUS", _IOC_READ, 0x6721, 0x01 },
|
||||
{ "linux/usb/g_printer.h", "GADGET_SET_PRINTER_STATUS", _IOC_READ|_IOC_WRITE, 0x6722, 0x01 },
|
||||
{ "linux/usb/g_uvc.h", "UVCIOC_SEND_RESPONSE", _IOC_WRITE, 0x5501, 0x40 },
|
||||
{ "linux/usb/gadgetfs.h", "GADGETFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 },
|
||||
{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 },
|
||||
{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 },
|
||||
@ -2038,12 +2043,17 @@
|
||||
{ "linux/usb/tmc.h", "USBTMC488_IOCTL_LOCAL_LOCKOUT", _IOC_NONE, 0x5b15, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC488_IOCTL_READ_STB", _IOC_READ, 0x5b12, 0x01 },
|
||||
{ "linux/usb/tmc.h", "USBTMC488_IOCTL_REN_CONTROL", _IOC_WRITE, 0x5b13, 0x01 },
|
||||
{ "linux/usb/tmc.h", "USBTMC488_IOCTL_TRIGGER", _IOC_NONE, 0x5b16, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_IN", _IOC_NONE, 0x5b04, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_OUT", _IOC_NONE, 0x5b03, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR", _IOC_NONE, 0x5b02, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_IN_HALT", _IOC_NONE, 0x5b07, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_OUT_HALT", _IOC_NONE, 0x5b06, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_CONFIG_TERMCHAR", _IOC_WRITE, 0x5b0c, 0x02 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_EOM_ENABLE", _IOC_WRITE, 0x5b0b, 0x01 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_GET_TIMEOUT", _IOC_READ, 0x5b09, 0x04 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_INDICATOR_PULSE", _IOC_NONE, 0x5b01, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_SET_TIMEOUT", _IOC_WRITE, 0x5b0a, 0x04 },
|
||||
{ "linux/usbdevice_fs.h", "USBDEVFS_ALLOC_STREAMS", _IOC_READ, 0x551c, 0x08 },
|
||||
{ "linux/usbdevice_fs.h", "USBDEVFS_BULK", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 },
|
||||
{ "linux/usbdevice_fs.h", "USBDEVFS_BULK32", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 },
|
||||
@ -2087,21 +2097,14 @@
|
||||
{ "linux/userfaultfd.h", "UFFDIO_ZEROPAGE", _IOC_READ|_IOC_WRITE, 0xaa04, 0x20 },
|
||||
{ "linux/uvcvideo.h", "UVCIOC_CTRL_MAP", _IOC_READ|_IOC_WRITE, 0x7520, 0x58 },
|
||||
{ "linux/uvcvideo.h", "UVCIOC_CTRL_QUERY", _IOC_READ|_IOC_WRITE, 0x7521, 0x0c },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x564b, 0x40 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_SIZE", _IOC_READ|_IOC_WRITE, 0x564a, 0x40 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_MBUS_CODE", _IOC_READ|_IOC_WRITE, 0x5602, 0x30 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x38 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x24 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0x58 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5615, 0x30 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x563d, 0x40 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_CROP", _IOC_READ|_IOC_WRITE, 0x563c, 0x38 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x24 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0x58 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5616, 0x30 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x563e, 0x40 },
|
||||
@ -2143,6 +2146,7 @@
|
||||
{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY", _IOC_NONE, 0x3b76, 0x00 },
|
||||
{ "linux/vfio.h", "VFIO_IOMMU_UNMAP_DMA", _IOC_NONE, 0x3b72, 0x00 },
|
||||
{ "linux/vfio.h", "VFIO_SET_IOMMU", _IOC_NONE, 0x3b66, 0x00 },
|
||||
{ "linux/vhost.h", "VHOST_GET_BACKEND_FEATURES", _IOC_READ, 0xaf26, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_GET_FEATURES", _IOC_READ, 0xaf00, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_GET_VRING_BASE", _IOC_READ|_IOC_WRITE, 0xaf12, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_GET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf24, 0x08 },
|
||||
@ -2154,6 +2158,7 @@
|
||||
{ "linux/vhost.h", "VHOST_SCSI_GET_EVENTS_MISSED", _IOC_WRITE, 0xaf44, 0x04 },
|
||||
{ "linux/vhost.h", "VHOST_SCSI_SET_ENDPOINT", _IOC_WRITE, 0xaf40, 0xe8 },
|
||||
{ "linux/vhost.h", "VHOST_SCSI_SET_EVENTS_MISSED", _IOC_WRITE, 0xaf43, 0x04 },
|
||||
{ "linux/vhost.h", "VHOST_SET_BACKEND_FEATURES", _IOC_WRITE, 0xaf25, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_SET_FEATURES", _IOC_WRITE, 0xaf00, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_SET_LOG_BASE", _IOC_WRITE, 0xaf04, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_SET_LOG_FD", _IOC_WRITE, 0xaf07, 0x04 },
|
||||
@ -2223,7 +2228,6 @@
|
||||
{ "linux/videodev2.h", "VIDIOC_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 },
|
||||
{ "linux/videodev2.h", "VIDIOC_QUERY_EXT_CTRL", _IOC_READ|_IOC_WRITE, 0x5667, 0xe8 },
|
||||
{ "linux/videodev2.h", "VIDIOC_REQBUFS", _IOC_READ|_IOC_WRITE, 0x5608, 0x14 },
|
||||
{ "linux/videodev2.h", "VIDIOC_RESERVED", _IOC_NONE, 0x5601, 0x00 },
|
||||
{ "linux/videodev2.h", "VIDIOC_STREAMOFF", _IOC_WRITE, 0x5613, 0x04 },
|
||||
{ "linux/videodev2.h", "VIDIOC_STREAMON", _IOC_WRITE, 0x5612, 0x04 },
|
||||
{ "linux/videodev2.h", "VIDIOC_SUBSCRIBE_EVENT", _IOC_WRITE, 0x565a, 0x20 },
|
||||
@ -2750,6 +2754,10 @@
|
||||
{ "xen/evtchn.h", "IOCTL_EVTCHN_RESET", _IOC_NONE, 0x4505, 0x00 },
|
||||
{ "xen/evtchn.h", "IOCTL_EVTCHN_RESTRICT_DOMID", _IOC_NONE, 0x4506, 0x02 },
|
||||
{ "xen/evtchn.h", "IOCTL_EVTCHN_UNBIND", _IOC_NONE, 0x4503, 0x04 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS", _IOC_NONE, 0x4709, 0x14 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED", _IOC_NONE, 0x470a, 0x08 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_RELEASE", _IOC_NONE, 0x470c, 0x08 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_TO_REFS", _IOC_NONE, 0x470b, 0x14 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR", _IOC_NONE, 0x4702, 0x18 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_GRANT_COPY", _IOC_NONE, 0x4708, 0x08 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_MAP_GRANT_REF", _IOC_NONE, 0x4700, 0x18 },
|
||||
|
@ -794,17 +794,13 @@
|
||||
{ "linux/dvb/audio.h", "AUDIO_CLEAR_BUFFER", _IOC_NONE, 0x6f0c, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_CONTINUE", _IOC_NONE, 0x6f04, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_GET_CAPABILITIES", _IOC_READ, 0x6f0b, 0x04 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_GET_PTS", _IOC_READ, 0x6f13, 0x08 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_GET_STATUS", _IOC_READ, 0x6f0a, 0x20 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_PAUSE", _IOC_NONE, 0x6f03, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_PLAY", _IOC_NONE, 0x6f02, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SELECT_SOURCE", _IOC_NONE, 0x6f05, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_ATTRIBUTES", _IOC_WRITE, 0x6f11, 0x02 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_AV_SYNC", _IOC_NONE, 0x6f07, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_BYPASS_MODE", _IOC_NONE, 0x6f08, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_EXT_ID", _IOC_NONE, 0x6f10, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_ID", _IOC_NONE, 0x6f0d, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_KARAOKE", _IOC_WRITE, 0x6f12, 0x0c },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_MIXER", _IOC_WRITE, 0x6f0e, 0x08 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_MUTE", _IOC_NONE, 0x6f06, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_STREAMTYPE", _IOC_NONE, 0x6f0f, 0x00 },
|
||||
@ -863,23 +859,15 @@
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_CAPABILITIES", _IOC_READ, 0x6f21, 0x04 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_EVENT", _IOC_READ, 0x6f1c, 0x14 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_FRAME_COUNT", _IOC_READ, 0x6f3a, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_FRAME_RATE", _IOC_READ, 0x6f38, 0x04 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_NAVI", _IOC_READ, 0x6f34, 0x404 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_PTS", _IOC_READ, 0x6f39, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_SIZE", _IOC_READ, 0x6f37, 0x0c },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_STATUS", _IOC_READ, 0x6f1b, 0x14 },
|
||||
{ "linux/dvb/video.h", "VIDEO_PLAY", _IOC_NONE, 0x6f16, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SELECT_SOURCE", _IOC_NONE, 0x6f19, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_ATTRIBUTES", _IOC_NONE, 0x6f35, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_BLANK", _IOC_NONE, 0x6f1a, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_DISPLAY_FORMAT", _IOC_NONE, 0x6f1d, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_FORMAT", _IOC_NONE, 0x6f25, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_HIGHLIGHT", _IOC_WRITE, 0x6f27, 0x10 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_ID", _IOC_NONE, 0x6f23, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_SPU", _IOC_WRITE, 0x6f32, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_SPU_PALETTE", _IOC_WRITE, 0x6f33, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_STREAMTYPE", _IOC_NONE, 0x6f24, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_SYSTEM", _IOC_NONE, 0x6f26, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SLOWMOTION", _IOC_NONE, 0x6f20, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_STILLPICTURE", _IOC_WRITE, 0x6f1e, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_STOP", _IOC_NONE, 0x6f15, 0x00 },
|
||||
@ -952,6 +940,14 @@
|
||||
{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SET_ISO_CHANNELS", _IOC_WRITE, 0x2317, 0x10 },
|
||||
{ "linux/firewire-cdev.h", "FW_CDEV_IOC_START_ISO", _IOC_WRITE, 0x230a, 0x10 },
|
||||
{ "linux/firewire-cdev.h", "FW_CDEV_IOC_STOP_ISO", _IOC_WRITE, 0x230b, 0x04 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_CHECK_EXTENSION", _IOC_NONE, 0xb601, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_PR", _IOC_NONE, 0xb680, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_GET_API_VERSION", _IOC_NONE, 0xb600, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_MAP", _IOC_NONE, 0xb643, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_UNMAP", _IOC_NONE, 0xb644, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_INFO", _IOC_NONE, 0xb641, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_REGION_INFO", _IOC_NONE, 0xb642, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_RESET", _IOC_NONE, 0xb640, 0x00 },
|
||||
{ "linux/fs.h", "BLKALIGNOFF", _IOC_NONE, 0x127a, 0x00 },
|
||||
{ "linux/fs.h", "BLKBSZGET", _IOC_READ, 0x1270, 0x04 },
|
||||
{ "linux/fs.h", "BLKBSZSET", _IOC_WRITE, 0x1271, 0x04 },
|
||||
@ -1004,6 +1000,10 @@
|
||||
{ "linux/fs.h", "FS_IOC_SETFSLABEL", _IOC_WRITE, 0x9432, 0x100 },
|
||||
{ "linux/fs.h", "FS_IOC_SETVERSION", _IOC_WRITE, 0x7602, 0x04 },
|
||||
{ "linux/fs.h", "FS_IOC_SET_ENCRYPTION_POLICY", _IOC_READ, 0x6613, 0x0c },
|
||||
{ "linux/fsi.h", "FSI_SCOM_CHECK", _IOC_READ, 0x7300, 0x04 },
|
||||
{ "linux/fsi.h", "FSI_SCOM_READ", _IOC_READ|_IOC_WRITE, 0x7301, 0x20 },
|
||||
{ "linux/fsi.h", "FSI_SCOM_RESET", _IOC_WRITE, 0x7303, 0x04 },
|
||||
{ "linux/fsi.h", "FSI_SCOM_WRITE", _IOC_READ|_IOC_WRITE, 0x7302, 0x20 },
|
||||
{ "linux/fsl-diu-fb.h", "MFB_GET_ALPHA", _IOC_READ, 0x4d00, 0x01 },
|
||||
{ "linux/fsl-diu-fb.h", "MFB_GET_AOID", _IOC_READ, 0x4d04, 0x08 },
|
||||
{ "linux/fsl-diu-fb.h", "MFB_GET_GAMMA", _IOC_READ, 0x4d01, 0x01 },
|
||||
@ -1335,6 +1335,7 @@
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_VERSION", _IOC_READ, 0x4b01, 0x08 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_MAP_MEMORY_TO_GPU", _IOC_READ|_IOC_WRITE, 0x4b18, 0x18 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_RESET_EVENT", _IOC_WRITE, 0x4b0b, 0x08 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_CU_MASK", _IOC_WRITE, 0x4b1a, 0x10 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_EVENT", _IOC_WRITE, 0x4b0a, 0x08 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_MEMORY_POLICY", _IOC_WRITE, 0x4b04, 0x20 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_SCRATCH_BACKING_VA", _IOC_READ|_IOC_WRITE, 0x4b11, 0x10 },
|
||||
@ -1512,9 +1513,12 @@
|
||||
{ "linux/omapfb.h", "OMAPFB_WAITFORVSYNC", _IOC_NONE, 0x4f39, 0x00 },
|
||||
{ "linux/pcitest.h", "PCITEST_BAR", _IOC_NONE, 0x5001, 0x00 },
|
||||
{ "linux/pcitest.h", "PCITEST_COPY", _IOC_WRITE, 0x5006, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_GET_IRQTYPE", _IOC_NONE, 0x5009, 0x00 },
|
||||
{ "linux/pcitest.h", "PCITEST_LEGACY_IRQ", _IOC_NONE, 0x5002, 0x00 },
|
||||
{ "linux/pcitest.h", "PCITEST_MSI", _IOC_WRITE, 0x5003, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_MSIX", _IOC_WRITE, 0x5007, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_READ", _IOC_WRITE, 0x5005, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_SET_IRQTYPE", _IOC_WRITE, 0x5008, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_WRITE", _IOC_WRITE, 0x5004, 0x04 },
|
||||
{ "linux/perf_event.h", "PERF_EVENT_IOC_DISABLE", _IOC_NONE, 0x2401, 0x00 },
|
||||
{ "linux/perf_event.h", "PERF_EVENT_IOC_ENABLE", _IOC_NONE, 0x2400, 0x00 },
|
||||
@ -2027,6 +2031,7 @@
|
||||
{ "linux/usb/functionfs.h", "FUNCTIONFS_INTERFACE_REVMAP", _IOC_NONE, 0x6780, 0x00 },
|
||||
{ "linux/usb/g_printer.h", "GADGET_GET_PRINTER_STATUS", _IOC_READ, 0x6721, 0x01 },
|
||||
{ "linux/usb/g_printer.h", "GADGET_SET_PRINTER_STATUS", _IOC_READ|_IOC_WRITE, 0x6722, 0x01 },
|
||||
{ "linux/usb/g_uvc.h", "UVCIOC_SEND_RESPONSE", _IOC_WRITE, 0x5501, 0x40 },
|
||||
{ "linux/usb/gadgetfs.h", "GADGETFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 },
|
||||
{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 },
|
||||
{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 },
|
||||
@ -2038,12 +2043,17 @@
|
||||
{ "linux/usb/tmc.h", "USBTMC488_IOCTL_LOCAL_LOCKOUT", _IOC_NONE, 0x5b15, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC488_IOCTL_READ_STB", _IOC_READ, 0x5b12, 0x01 },
|
||||
{ "linux/usb/tmc.h", "USBTMC488_IOCTL_REN_CONTROL", _IOC_WRITE, 0x5b13, 0x01 },
|
||||
{ "linux/usb/tmc.h", "USBTMC488_IOCTL_TRIGGER", _IOC_NONE, 0x5b16, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_IN", _IOC_NONE, 0x5b04, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_OUT", _IOC_NONE, 0x5b03, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR", _IOC_NONE, 0x5b02, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_IN_HALT", _IOC_NONE, 0x5b07, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_OUT_HALT", _IOC_NONE, 0x5b06, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_CONFIG_TERMCHAR", _IOC_WRITE, 0x5b0c, 0x02 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_EOM_ENABLE", _IOC_WRITE, 0x5b0b, 0x01 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_GET_TIMEOUT", _IOC_READ, 0x5b09, 0x04 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_INDICATOR_PULSE", _IOC_NONE, 0x5b01, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_SET_TIMEOUT", _IOC_WRITE, 0x5b0a, 0x04 },
|
||||
{ "linux/usbdevice_fs.h", "USBDEVFS_ALLOC_STREAMS", _IOC_READ, 0x551c, 0x08 },
|
||||
{ "linux/usbdevice_fs.h", "USBDEVFS_BULK", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 },
|
||||
{ "linux/usbdevice_fs.h", "USBDEVFS_BULK32", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 },
|
||||
@ -2087,21 +2097,14 @@
|
||||
{ "linux/userfaultfd.h", "UFFDIO_ZEROPAGE", _IOC_READ|_IOC_WRITE, 0xaa04, 0x20 },
|
||||
{ "linux/uvcvideo.h", "UVCIOC_CTRL_MAP", _IOC_READ|_IOC_WRITE, 0x7520, 0x58 },
|
||||
{ "linux/uvcvideo.h", "UVCIOC_CTRL_QUERY", _IOC_READ|_IOC_WRITE, 0x7521, 0x0c },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x564b, 0x40 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_SIZE", _IOC_READ|_IOC_WRITE, 0x564a, 0x40 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_MBUS_CODE", _IOC_READ|_IOC_WRITE, 0x5602, 0x30 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x38 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x24 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0x58 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5615, 0x30 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x563d, 0x40 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_CROP", _IOC_READ|_IOC_WRITE, 0x563c, 0x38 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x24 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0x58 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5616, 0x30 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x563e, 0x40 },
|
||||
@ -2143,6 +2146,7 @@
|
||||
{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY", _IOC_NONE, 0x3b76, 0x00 },
|
||||
{ "linux/vfio.h", "VFIO_IOMMU_UNMAP_DMA", _IOC_NONE, 0x3b72, 0x00 },
|
||||
{ "linux/vfio.h", "VFIO_SET_IOMMU", _IOC_NONE, 0x3b66, 0x00 },
|
||||
{ "linux/vhost.h", "VHOST_GET_BACKEND_FEATURES", _IOC_READ, 0xaf26, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_GET_FEATURES", _IOC_READ, 0xaf00, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_GET_VRING_BASE", _IOC_READ|_IOC_WRITE, 0xaf12, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_GET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf24, 0x08 },
|
||||
@ -2154,6 +2158,7 @@
|
||||
{ "linux/vhost.h", "VHOST_SCSI_GET_EVENTS_MISSED", _IOC_WRITE, 0xaf44, 0x04 },
|
||||
{ "linux/vhost.h", "VHOST_SCSI_SET_ENDPOINT", _IOC_WRITE, 0xaf40, 0xe8 },
|
||||
{ "linux/vhost.h", "VHOST_SCSI_SET_EVENTS_MISSED", _IOC_WRITE, 0xaf43, 0x04 },
|
||||
{ "linux/vhost.h", "VHOST_SET_BACKEND_FEATURES", _IOC_WRITE, 0xaf25, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_SET_FEATURES", _IOC_WRITE, 0xaf00, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_SET_LOG_BASE", _IOC_WRITE, 0xaf04, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_SET_LOG_FD", _IOC_WRITE, 0xaf07, 0x04 },
|
||||
@ -2223,7 +2228,6 @@
|
||||
{ "linux/videodev2.h", "VIDIOC_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 },
|
||||
{ "linux/videodev2.h", "VIDIOC_QUERY_EXT_CTRL", _IOC_READ|_IOC_WRITE, 0x5667, 0xe8 },
|
||||
{ "linux/videodev2.h", "VIDIOC_REQBUFS", _IOC_READ|_IOC_WRITE, 0x5608, 0x14 },
|
||||
{ "linux/videodev2.h", "VIDIOC_RESERVED", _IOC_NONE, 0x5601, 0x00 },
|
||||
{ "linux/videodev2.h", "VIDIOC_STREAMOFF", _IOC_WRITE, 0x5613, 0x04 },
|
||||
{ "linux/videodev2.h", "VIDIOC_STREAMON", _IOC_WRITE, 0x5612, 0x04 },
|
||||
{ "linux/videodev2.h", "VIDIOC_SUBSCRIBE_EVENT", _IOC_WRITE, 0x565a, 0x20 },
|
||||
@ -2750,6 +2754,10 @@
|
||||
{ "xen/evtchn.h", "IOCTL_EVTCHN_RESET", _IOC_NONE, 0x4505, 0x00 },
|
||||
{ "xen/evtchn.h", "IOCTL_EVTCHN_RESTRICT_DOMID", _IOC_NONE, 0x4506, 0x02 },
|
||||
{ "xen/evtchn.h", "IOCTL_EVTCHN_UNBIND", _IOC_NONE, 0x4503, 0x04 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS", _IOC_NONE, 0x4709, 0x14 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED", _IOC_NONE, 0x470a, 0x08 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_RELEASE", _IOC_NONE, 0x470c, 0x08 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_TO_REFS", _IOC_NONE, 0x470b, 0x14 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR", _IOC_NONE, 0x4702, 0x18 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_GRANT_COPY", _IOC_NONE, 0x4708, 0x08 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_MAP_GRANT_REF", _IOC_NONE, 0x4700, 0x18 },
|
||||
|
@ -794,17 +794,13 @@
|
||||
{ "linux/dvb/audio.h", "AUDIO_CLEAR_BUFFER", _IOC_NONE, 0x6f0c, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_CONTINUE", _IOC_NONE, 0x6f04, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_GET_CAPABILITIES", _IOC_READ, 0x6f0b, 0x04 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_GET_PTS", _IOC_READ, 0x6f13, 0x08 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_GET_STATUS", _IOC_READ, 0x6f0a, 0x20 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_PAUSE", _IOC_NONE, 0x6f03, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_PLAY", _IOC_NONE, 0x6f02, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SELECT_SOURCE", _IOC_NONE, 0x6f05, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_ATTRIBUTES", _IOC_WRITE, 0x6f11, 0x02 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_AV_SYNC", _IOC_NONE, 0x6f07, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_BYPASS_MODE", _IOC_NONE, 0x6f08, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_EXT_ID", _IOC_NONE, 0x6f10, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_ID", _IOC_NONE, 0x6f0d, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_KARAOKE", _IOC_WRITE, 0x6f12, 0x0c },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_MIXER", _IOC_WRITE, 0x6f0e, 0x08 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_MUTE", _IOC_NONE, 0x6f06, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_STREAMTYPE", _IOC_NONE, 0x6f0f, 0x00 },
|
||||
@ -863,23 +859,15 @@
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_CAPABILITIES", _IOC_READ, 0x6f21, 0x04 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_EVENT", _IOC_READ, 0x6f1c, 0x20 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_FRAME_COUNT", _IOC_READ, 0x6f3a, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_FRAME_RATE", _IOC_READ, 0x6f38, 0x04 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_NAVI", _IOC_READ, 0x6f34, 0x404 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_PTS", _IOC_READ, 0x6f39, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_SIZE", _IOC_READ, 0x6f37, 0x0c },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_STATUS", _IOC_READ, 0x6f1b, 0x14 },
|
||||
{ "linux/dvb/video.h", "VIDEO_PLAY", _IOC_NONE, 0x6f16, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SELECT_SOURCE", _IOC_NONE, 0x6f19, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_ATTRIBUTES", _IOC_NONE, 0x6f35, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_BLANK", _IOC_NONE, 0x6f1a, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_DISPLAY_FORMAT", _IOC_NONE, 0x6f1d, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_FORMAT", _IOC_NONE, 0x6f25, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_HIGHLIGHT", _IOC_WRITE, 0x6f27, 0x10 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_ID", _IOC_NONE, 0x6f23, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_SPU", _IOC_WRITE, 0x6f32, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_SPU_PALETTE", _IOC_WRITE, 0x6f33, 0x10 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_STREAMTYPE", _IOC_NONE, 0x6f24, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_SYSTEM", _IOC_NONE, 0x6f26, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SLOWMOTION", _IOC_NONE, 0x6f20, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_STILLPICTURE", _IOC_WRITE, 0x6f1e, 0x10 },
|
||||
{ "linux/dvb/video.h", "VIDEO_STOP", _IOC_NONE, 0x6f15, 0x00 },
|
||||
@ -952,6 +940,14 @@
|
||||
{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SET_ISO_CHANNELS", _IOC_WRITE, 0x2317, 0x10 },
|
||||
{ "linux/firewire-cdev.h", "FW_CDEV_IOC_START_ISO", _IOC_WRITE, 0x230a, 0x10 },
|
||||
{ "linux/firewire-cdev.h", "FW_CDEV_IOC_STOP_ISO", _IOC_WRITE, 0x230b, 0x04 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_CHECK_EXTENSION", _IOC_NONE, 0xb601, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_PR", _IOC_NONE, 0xb680, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_GET_API_VERSION", _IOC_NONE, 0xb600, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_MAP", _IOC_NONE, 0xb643, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_UNMAP", _IOC_NONE, 0xb644, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_INFO", _IOC_NONE, 0xb641, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_REGION_INFO", _IOC_NONE, 0xb642, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_RESET", _IOC_NONE, 0xb640, 0x00 },
|
||||
{ "linux/fs.h", "BLKALIGNOFF", _IOC_NONE, 0x127a, 0x00 },
|
||||
{ "linux/fs.h", "BLKBSZGET", _IOC_READ, 0x1270, 0x08 },
|
||||
{ "linux/fs.h", "BLKBSZSET", _IOC_WRITE, 0x1271, 0x08 },
|
||||
@ -1004,6 +1000,10 @@
|
||||
{ "linux/fs.h", "FS_IOC_SETFSLABEL", _IOC_WRITE, 0x9432, 0x100 },
|
||||
{ "linux/fs.h", "FS_IOC_SETVERSION", _IOC_WRITE, 0x7602, 0x08 },
|
||||
{ "linux/fs.h", "FS_IOC_SET_ENCRYPTION_POLICY", _IOC_READ, 0x6613, 0x0c },
|
||||
{ "linux/fsi.h", "FSI_SCOM_CHECK", _IOC_READ, 0x7300, 0x04 },
|
||||
{ "linux/fsi.h", "FSI_SCOM_READ", _IOC_READ|_IOC_WRITE, 0x7301, 0x20 },
|
||||
{ "linux/fsi.h", "FSI_SCOM_RESET", _IOC_WRITE, 0x7303, 0x04 },
|
||||
{ "linux/fsi.h", "FSI_SCOM_WRITE", _IOC_READ|_IOC_WRITE, 0x7302, 0x20 },
|
||||
{ "linux/fsl-diu-fb.h", "MFB_GET_ALPHA", _IOC_READ, 0x4d00, 0x01 },
|
||||
{ "linux/fsl-diu-fb.h", "MFB_GET_AOID", _IOC_READ, 0x4d04, 0x08 },
|
||||
{ "linux/fsl-diu-fb.h", "MFB_GET_GAMMA", _IOC_READ, 0x4d01, 0x01 },
|
||||
@ -1335,6 +1335,7 @@
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_VERSION", _IOC_READ, 0x4b01, 0x08 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_MAP_MEMORY_TO_GPU", _IOC_READ|_IOC_WRITE, 0x4b18, 0x18 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_RESET_EVENT", _IOC_WRITE, 0x4b0b, 0x08 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_CU_MASK", _IOC_WRITE, 0x4b1a, 0x10 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_EVENT", _IOC_WRITE, 0x4b0a, 0x08 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_MEMORY_POLICY", _IOC_WRITE, 0x4b04, 0x20 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_SCRATCH_BACKING_VA", _IOC_READ|_IOC_WRITE, 0x4b11, 0x10 },
|
||||
@ -1512,9 +1513,12 @@
|
||||
{ "linux/omapfb.h", "OMAPFB_WAITFORVSYNC", _IOC_NONE, 0x4f39, 0x00 },
|
||||
{ "linux/pcitest.h", "PCITEST_BAR", _IOC_NONE, 0x5001, 0x00 },
|
||||
{ "linux/pcitest.h", "PCITEST_COPY", _IOC_WRITE, 0x5006, 0x08 },
|
||||
{ "linux/pcitest.h", "PCITEST_GET_IRQTYPE", _IOC_NONE, 0x5009, 0x00 },
|
||||
{ "linux/pcitest.h", "PCITEST_LEGACY_IRQ", _IOC_NONE, 0x5002, 0x00 },
|
||||
{ "linux/pcitest.h", "PCITEST_MSI", _IOC_WRITE, 0x5003, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_MSIX", _IOC_WRITE, 0x5007, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_READ", _IOC_WRITE, 0x5005, 0x08 },
|
||||
{ "linux/pcitest.h", "PCITEST_SET_IRQTYPE", _IOC_WRITE, 0x5008, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_WRITE", _IOC_WRITE, 0x5004, 0x08 },
|
||||
{ "linux/perf_event.h", "PERF_EVENT_IOC_DISABLE", _IOC_NONE, 0x2401, 0x00 },
|
||||
{ "linux/perf_event.h", "PERF_EVENT_IOC_ENABLE", _IOC_NONE, 0x2400, 0x00 },
|
||||
@ -2027,6 +2031,7 @@
|
||||
{ "linux/usb/functionfs.h", "FUNCTIONFS_INTERFACE_REVMAP", _IOC_NONE, 0x6780, 0x00 },
|
||||
{ "linux/usb/g_printer.h", "GADGET_GET_PRINTER_STATUS", _IOC_READ, 0x6721, 0x01 },
|
||||
{ "linux/usb/g_printer.h", "GADGET_SET_PRINTER_STATUS", _IOC_READ|_IOC_WRITE, 0x6722, 0x01 },
|
||||
{ "linux/usb/g_uvc.h", "UVCIOC_SEND_RESPONSE", _IOC_WRITE, 0x5501, 0x40 },
|
||||
{ "linux/usb/gadgetfs.h", "GADGETFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 },
|
||||
{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 },
|
||||
{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 },
|
||||
@ -2038,12 +2043,17 @@
|
||||
{ "linux/usb/tmc.h", "USBTMC488_IOCTL_LOCAL_LOCKOUT", _IOC_NONE, 0x5b15, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC488_IOCTL_READ_STB", _IOC_READ, 0x5b12, 0x01 },
|
||||
{ "linux/usb/tmc.h", "USBTMC488_IOCTL_REN_CONTROL", _IOC_WRITE, 0x5b13, 0x01 },
|
||||
{ "linux/usb/tmc.h", "USBTMC488_IOCTL_TRIGGER", _IOC_NONE, 0x5b16, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_IN", _IOC_NONE, 0x5b04, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_OUT", _IOC_NONE, 0x5b03, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR", _IOC_NONE, 0x5b02, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_IN_HALT", _IOC_NONE, 0x5b07, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_OUT_HALT", _IOC_NONE, 0x5b06, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_CONFIG_TERMCHAR", _IOC_WRITE, 0x5b0c, 0x02 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_EOM_ENABLE", _IOC_WRITE, 0x5b0b, 0x01 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_GET_TIMEOUT", _IOC_READ, 0x5b09, 0x04 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_INDICATOR_PULSE", _IOC_NONE, 0x5b01, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_SET_TIMEOUT", _IOC_WRITE, 0x5b0a, 0x04 },
|
||||
{ "linux/usbdevice_fs.h", "USBDEVFS_ALLOC_STREAMS", _IOC_READ, 0x551c, 0x08 },
|
||||
{ "linux/usbdevice_fs.h", "USBDEVFS_BULK", _IOC_READ|_IOC_WRITE, 0x5502, 0x18 },
|
||||
{ "linux/usbdevice_fs.h", "USBDEVFS_BULK32", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 },
|
||||
@ -2087,21 +2097,14 @@
|
||||
{ "linux/userfaultfd.h", "UFFDIO_ZEROPAGE", _IOC_READ|_IOC_WRITE, 0xaa04, 0x20 },
|
||||
{ "linux/uvcvideo.h", "UVCIOC_CTRL_MAP", _IOC_READ|_IOC_WRITE, 0x7520, 0x60 },
|
||||
{ "linux/uvcvideo.h", "UVCIOC_CTRL_QUERY", _IOC_READ|_IOC_WRITE, 0x7521, 0x10 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x564b, 0x40 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_SIZE", _IOC_READ|_IOC_WRITE, 0x564a, 0x40 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_MBUS_CODE", _IOC_READ|_IOC_WRITE, 0x5602, 0x30 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x38 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x28 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0x58 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5615, 0x30 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x563d, 0x40 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_CROP", _IOC_READ|_IOC_WRITE, 0x563c, 0x38 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x28 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0x58 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5616, 0x30 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x563e, 0x40 },
|
||||
@ -2143,6 +2146,7 @@
|
||||
{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY", _IOC_NONE, 0x3b76, 0x00 },
|
||||
{ "linux/vfio.h", "VFIO_IOMMU_UNMAP_DMA", _IOC_NONE, 0x3b72, 0x00 },
|
||||
{ "linux/vfio.h", "VFIO_SET_IOMMU", _IOC_NONE, 0x3b66, 0x00 },
|
||||
{ "linux/vhost.h", "VHOST_GET_BACKEND_FEATURES", _IOC_READ, 0xaf26, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_GET_FEATURES", _IOC_READ, 0xaf00, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_GET_VRING_BASE", _IOC_READ|_IOC_WRITE, 0xaf12, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_GET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf24, 0x08 },
|
||||
@ -2154,6 +2158,7 @@
|
||||
{ "linux/vhost.h", "VHOST_SCSI_GET_EVENTS_MISSED", _IOC_WRITE, 0xaf44, 0x04 },
|
||||
{ "linux/vhost.h", "VHOST_SCSI_SET_ENDPOINT", _IOC_WRITE, 0xaf40, 0xe8 },
|
||||
{ "linux/vhost.h", "VHOST_SCSI_SET_EVENTS_MISSED", _IOC_WRITE, 0xaf43, 0x04 },
|
||||
{ "linux/vhost.h", "VHOST_SET_BACKEND_FEATURES", _IOC_WRITE, 0xaf25, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_SET_FEATURES", _IOC_WRITE, 0xaf00, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_SET_LOG_BASE", _IOC_WRITE, 0xaf04, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_SET_LOG_FD", _IOC_WRITE, 0xaf07, 0x04 },
|
||||
@ -2223,7 +2228,6 @@
|
||||
{ "linux/videodev2.h", "VIDIOC_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 },
|
||||
{ "linux/videodev2.h", "VIDIOC_QUERY_EXT_CTRL", _IOC_READ|_IOC_WRITE, 0x5667, 0xe8 },
|
||||
{ "linux/videodev2.h", "VIDIOC_REQBUFS", _IOC_READ|_IOC_WRITE, 0x5608, 0x14 },
|
||||
{ "linux/videodev2.h", "VIDIOC_RESERVED", _IOC_NONE, 0x5601, 0x00 },
|
||||
{ "linux/videodev2.h", "VIDIOC_STREAMOFF", _IOC_WRITE, 0x5613, 0x04 },
|
||||
{ "linux/videodev2.h", "VIDIOC_STREAMON", _IOC_WRITE, 0x5612, 0x04 },
|
||||
{ "linux/videodev2.h", "VIDIOC_SUBSCRIBE_EVENT", _IOC_WRITE, 0x565a, 0x20 },
|
||||
@ -2750,6 +2754,10 @@
|
||||
{ "xen/evtchn.h", "IOCTL_EVTCHN_RESET", _IOC_NONE, 0x4505, 0x00 },
|
||||
{ "xen/evtchn.h", "IOCTL_EVTCHN_RESTRICT_DOMID", _IOC_NONE, 0x4506, 0x02 },
|
||||
{ "xen/evtchn.h", "IOCTL_EVTCHN_UNBIND", _IOC_NONE, 0x4503, 0x04 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS", _IOC_NONE, 0x4709, 0x14 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED", _IOC_NONE, 0x470a, 0x08 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_RELEASE", _IOC_NONE, 0x470c, 0x08 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_TO_REFS", _IOC_NONE, 0x470b, 0x14 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR", _IOC_NONE, 0x4702, 0x18 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_GRANT_COPY", _IOC_NONE, 0x4708, 0x10 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_MAP_GRANT_REF", _IOC_NONE, 0x4700, 0x18 },
|
||||
|
@ -424,11 +424,12 @@
|
||||
[396] = { 1, 0, SEN(pkey_free), "pkey_free" },
|
||||
[397] = { 5, TD|TF|TSTA, SEN(statx), "statx" },
|
||||
[398] = { 4, 0, SEN(rseq), "rseq" },
|
||||
[399] = { 6, 0, SEN(io_pgetevents), "io_pgetevents" },
|
||||
|
||||
#ifdef __ARM_EABI__
|
||||
# define ARM_FIRST_SHUFFLED_SYSCALL 400
|
||||
# define ARM_FIRST_SHUFFLED_SYSCALL 500
|
||||
#else
|
||||
# define SYS_socket_subcall 400
|
||||
# define SYS_socket_subcall 500
|
||||
# include "subcall.h"
|
||||
# define ARM_FIRST_SHUFFLED_SYSCALL (SYS_ipc_subcall + SYS_ipc_nsubcalls)
|
||||
#endif /* !__ARM_EABI__ */
|
||||
|
@ -44,6 +44,7 @@
|
||||
{ "linux/kvm.h", "KVM_GET_MSRS", _IOC_READ|_IOC_WRITE, 0xae88, 0x08 },
|
||||
{ "linux/kvm.h", "KVM_GET_MSR_FEATURE_INDEX_LIST", _IOC_READ|_IOC_WRITE, 0xae0a, 0x04 },
|
||||
{ "linux/kvm.h", "KVM_GET_MSR_INDEX_LIST", _IOC_READ|_IOC_WRITE, 0xae02, 0x04 },
|
||||
{ "linux/kvm.h", "KVM_GET_NESTED_STATE", _IOC_READ|_IOC_WRITE, 0xaebe, 0x80 },
|
||||
{ "linux/kvm.h", "KVM_GET_NR_MMU_PAGES", _IOC_NONE, 0xae45, 0x00 },
|
||||
{ "linux/kvm.h", "KVM_GET_ONE_REG", _IOC_WRITE, 0xaeab, 0x10 },
|
||||
{ "linux/kvm.h", "KVM_GET_PIT", _IOC_READ|_IOC_WRITE, 0xae65, 0x48 },
|
||||
@ -88,6 +89,7 @@
|
||||
{ "linux/kvm.h", "KVM_SET_MEMORY_REGION", _IOC_WRITE, 0xae40, 0x18 },
|
||||
{ "linux/kvm.h", "KVM_SET_MP_STATE", _IOC_WRITE, 0xae99, 0x04 },
|
||||
{ "linux/kvm.h", "KVM_SET_MSRS", _IOC_WRITE, 0xae89, 0x08 },
|
||||
{ "linux/kvm.h", "KVM_SET_NESTED_STATE", _IOC_WRITE, 0xaebf, 0x80 },
|
||||
{ "linux/kvm.h", "KVM_SET_NR_MMU_PAGES", _IOC_NONE, 0xae44, 0x00 },
|
||||
{ "linux/kvm.h", "KVM_SET_ONE_REG", _IOC_WRITE, 0xaeac, 0x10 },
|
||||
{ "linux/kvm.h", "KVM_SET_PIT", _IOC_READ, 0xae66, 0x48 },
|
||||
|
@ -3,6 +3,8 @@
|
||||
|
||||
#include <linux/inet_diag.h>
|
||||
|
||||
#include "gcc_compat.h"
|
||||
|
||||
/* Request structure */
|
||||
struct smc_diag_req {
|
||||
uint8_t diag_family;
|
||||
@ -28,6 +30,8 @@ enum {
|
||||
SMC_DIAG_CONNINFO,
|
||||
SMC_DIAG_LGRINFO,
|
||||
SMC_DIAG_SHUTDOWN,
|
||||
SMC_DIAG_DMBINFO,
|
||||
SMC_DIAG_FALLBACK,
|
||||
};
|
||||
|
||||
/* SMC_DIAG_CONNINFO */
|
||||
@ -64,9 +68,25 @@ struct smc_diag_linkinfo {
|
||||
uint8_t peer_gid[40];
|
||||
};
|
||||
|
||||
/* SMC_DIAG_LGRINFO */
|
||||
struct smc_diag_lgrinfo {
|
||||
struct smc_diag_linkinfo lnk[1];
|
||||
uint8_t role;
|
||||
};
|
||||
|
||||
/* SMC_DIAG_DMBINFO */
|
||||
struct smcd_diag_dmbinfo {
|
||||
uint32_t linkid;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) peer_gid;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) my_gid;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) token;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) peer_token;
|
||||
};
|
||||
|
||||
/* SMC_DIAG_FALLBACK */
|
||||
struct smc_diag_fallback {
|
||||
uint32_t reason;
|
||||
uint32_t peer_diagnosis;
|
||||
};
|
||||
|
||||
#endif /* !STRACE_LINUX_SMC_DIAG_H */
|
||||
|
@ -359,6 +359,7 @@
|
||||
[358] = { 6, TD, SEN(preadv2), "preadv2" },
|
||||
[359] = { 6, TD, SEN(pwritev2), "pwritev2" },
|
||||
[360] = { 5, TD|TF|TSTA, SEN(statx), "statx" },
|
||||
[361] = { 6, 0, SEN(io_pgetevents), "io_pgetevents" },
|
||||
|
||||
#define SYS_socket_subcall 400
|
||||
#include "subcall.h"
|
||||
|
@ -357,6 +357,7 @@
|
||||
[358] = { 6, TD, SEN(preadv2), "preadv2" },
|
||||
[359] = { 6, TD, SEN(pwritev2), "pwritev2" },
|
||||
[360] = { 5, TD|TF|TSTA, SEN(statx), "statx" },
|
||||
[361] = { 6, 0, SEN(io_pgetevents), "io_pgetevents" },
|
||||
|
||||
#define SYS_socket_subcall 400
|
||||
#include "subcall.h"
|
||||
|
@ -794,17 +794,13 @@
|
||||
{ "linux/dvb/audio.h", "AUDIO_CLEAR_BUFFER", _IOC_NONE, 0x6f0c, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_CONTINUE", _IOC_NONE, 0x6f04, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_GET_CAPABILITIES", _IOC_READ, 0x6f0b, 0x04 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_GET_PTS", _IOC_READ, 0x6f13, 0x08 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_GET_STATUS", _IOC_READ, 0x6f0a, 0x20 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_PAUSE", _IOC_NONE, 0x6f03, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_PLAY", _IOC_NONE, 0x6f02, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SELECT_SOURCE", _IOC_NONE, 0x6f05, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_ATTRIBUTES", _IOC_WRITE, 0x6f11, 0x02 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_AV_SYNC", _IOC_NONE, 0x6f07, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_BYPASS_MODE", _IOC_NONE, 0x6f08, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_EXT_ID", _IOC_NONE, 0x6f10, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_ID", _IOC_NONE, 0x6f0d, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_KARAOKE", _IOC_WRITE, 0x6f12, 0x0c },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_MIXER", _IOC_WRITE, 0x6f0e, 0x08 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_MUTE", _IOC_NONE, 0x6f06, 0x00 },
|
||||
{ "linux/dvb/audio.h", "AUDIO_SET_STREAMTYPE", _IOC_NONE, 0x6f0f, 0x00 },
|
||||
@ -863,23 +859,15 @@
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_CAPABILITIES", _IOC_READ, 0x6f21, 0x04 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_EVENT", _IOC_READ, 0x6f1c, 0x14 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_FRAME_COUNT", _IOC_READ, 0x6f3a, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_FRAME_RATE", _IOC_READ, 0x6f38, 0x04 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_NAVI", _IOC_READ, 0x6f34, 0x404 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_PTS", _IOC_READ, 0x6f39, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_SIZE", _IOC_READ, 0x6f37, 0x0c },
|
||||
{ "linux/dvb/video.h", "VIDEO_GET_STATUS", _IOC_READ, 0x6f1b, 0x14 },
|
||||
{ "linux/dvb/video.h", "VIDEO_PLAY", _IOC_NONE, 0x6f16, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SELECT_SOURCE", _IOC_NONE, 0x6f19, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_ATTRIBUTES", _IOC_NONE, 0x6f35, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_BLANK", _IOC_NONE, 0x6f1a, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_DISPLAY_FORMAT", _IOC_NONE, 0x6f1d, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_FORMAT", _IOC_NONE, 0x6f25, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_HIGHLIGHT", _IOC_WRITE, 0x6f27, 0x10 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_ID", _IOC_NONE, 0x6f23, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_SPU", _IOC_WRITE, 0x6f32, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_SPU_PALETTE", _IOC_WRITE, 0x6f33, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_STREAMTYPE", _IOC_NONE, 0x6f24, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SET_SYSTEM", _IOC_NONE, 0x6f26, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_SLOWMOTION", _IOC_NONE, 0x6f20, 0x00 },
|
||||
{ "linux/dvb/video.h", "VIDEO_STILLPICTURE", _IOC_WRITE, 0x6f1e, 0x08 },
|
||||
{ "linux/dvb/video.h", "VIDEO_STOP", _IOC_NONE, 0x6f15, 0x00 },
|
||||
@ -952,6 +940,14 @@
|
||||
{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SET_ISO_CHANNELS", _IOC_WRITE, 0x2317, 0x10 },
|
||||
{ "linux/firewire-cdev.h", "FW_CDEV_IOC_START_ISO", _IOC_WRITE, 0x230a, 0x10 },
|
||||
{ "linux/firewire-cdev.h", "FW_CDEV_IOC_STOP_ISO", _IOC_WRITE, 0x230b, 0x04 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_CHECK_EXTENSION", _IOC_NONE, 0xb601, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_PR", _IOC_NONE, 0xb680, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_GET_API_VERSION", _IOC_NONE, 0xb600, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_MAP", _IOC_NONE, 0xb643, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_UNMAP", _IOC_NONE, 0xb644, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_INFO", _IOC_NONE, 0xb641, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_REGION_INFO", _IOC_NONE, 0xb642, 0x00 },
|
||||
{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_RESET", _IOC_NONE, 0xb640, 0x00 },
|
||||
{ "linux/fs.h", "BLKALIGNOFF", _IOC_NONE, 0x127a, 0x00 },
|
||||
{ "linux/fs.h", "BLKBSZGET", _IOC_READ, 0x1270, 0x04 },
|
||||
{ "linux/fs.h", "BLKBSZSET", _IOC_WRITE, 0x1271, 0x04 },
|
||||
@ -1004,6 +1000,10 @@
|
||||
{ "linux/fs.h", "FS_IOC_SETFSLABEL", _IOC_WRITE, 0x9432, 0x100 },
|
||||
{ "linux/fs.h", "FS_IOC_SETVERSION", _IOC_WRITE, 0x7602, 0x04 },
|
||||
{ "linux/fs.h", "FS_IOC_SET_ENCRYPTION_POLICY", _IOC_READ, 0x6613, 0x0c },
|
||||
{ "linux/fsi.h", "FSI_SCOM_CHECK", _IOC_READ, 0x7300, 0x04 },
|
||||
{ "linux/fsi.h", "FSI_SCOM_READ", _IOC_READ|_IOC_WRITE, 0x7301, 0x20 },
|
||||
{ "linux/fsi.h", "FSI_SCOM_RESET", _IOC_WRITE, 0x7303, 0x04 },
|
||||
{ "linux/fsi.h", "FSI_SCOM_WRITE", _IOC_READ|_IOC_WRITE, 0x7302, 0x20 },
|
||||
{ "linux/fsl-diu-fb.h", "MFB_GET_ALPHA", _IOC_READ, 0x4d00, 0x01 },
|
||||
{ "linux/fsl-diu-fb.h", "MFB_GET_AOID", _IOC_READ, 0x4d04, 0x08 },
|
||||
{ "linux/fsl-diu-fb.h", "MFB_GET_GAMMA", _IOC_READ, 0x4d01, 0x01 },
|
||||
@ -1335,6 +1335,7 @@
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_VERSION", _IOC_READ, 0x4b01, 0x08 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_MAP_MEMORY_TO_GPU", _IOC_READ|_IOC_WRITE, 0x4b18, 0x18 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_RESET_EVENT", _IOC_WRITE, 0x4b0b, 0x08 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_CU_MASK", _IOC_WRITE, 0x4b1a, 0x10 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_EVENT", _IOC_WRITE, 0x4b0a, 0x08 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_MEMORY_POLICY", _IOC_WRITE, 0x4b04, 0x20 },
|
||||
{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_SCRATCH_BACKING_VA", _IOC_READ|_IOC_WRITE, 0x4b11, 0x10 },
|
||||
@ -1512,9 +1513,12 @@
|
||||
{ "linux/omapfb.h", "OMAPFB_WAITFORVSYNC", _IOC_NONE, 0x4f39, 0x00 },
|
||||
{ "linux/pcitest.h", "PCITEST_BAR", _IOC_NONE, 0x5001, 0x00 },
|
||||
{ "linux/pcitest.h", "PCITEST_COPY", _IOC_WRITE, 0x5006, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_GET_IRQTYPE", _IOC_NONE, 0x5009, 0x00 },
|
||||
{ "linux/pcitest.h", "PCITEST_LEGACY_IRQ", _IOC_NONE, 0x5002, 0x00 },
|
||||
{ "linux/pcitest.h", "PCITEST_MSI", _IOC_WRITE, 0x5003, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_MSIX", _IOC_WRITE, 0x5007, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_READ", _IOC_WRITE, 0x5005, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_SET_IRQTYPE", _IOC_WRITE, 0x5008, 0x04 },
|
||||
{ "linux/pcitest.h", "PCITEST_WRITE", _IOC_WRITE, 0x5004, 0x04 },
|
||||
{ "linux/perf_event.h", "PERF_EVENT_IOC_DISABLE", _IOC_NONE, 0x2401, 0x00 },
|
||||
{ "linux/perf_event.h", "PERF_EVENT_IOC_ENABLE", _IOC_NONE, 0x2400, 0x00 },
|
||||
@ -2027,6 +2031,7 @@
|
||||
{ "linux/usb/functionfs.h", "FUNCTIONFS_INTERFACE_REVMAP", _IOC_NONE, 0x6780, 0x00 },
|
||||
{ "linux/usb/g_printer.h", "GADGET_GET_PRINTER_STATUS", _IOC_READ, 0x6721, 0x01 },
|
||||
{ "linux/usb/g_printer.h", "GADGET_SET_PRINTER_STATUS", _IOC_READ|_IOC_WRITE, 0x6722, 0x01 },
|
||||
{ "linux/usb/g_uvc.h", "UVCIOC_SEND_RESPONSE", _IOC_WRITE, 0x5501, 0x40 },
|
||||
{ "linux/usb/gadgetfs.h", "GADGETFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 },
|
||||
{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 },
|
||||
{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 },
|
||||
@ -2038,12 +2043,17 @@
|
||||
{ "linux/usb/tmc.h", "USBTMC488_IOCTL_LOCAL_LOCKOUT", _IOC_NONE, 0x5b15, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC488_IOCTL_READ_STB", _IOC_READ, 0x5b12, 0x01 },
|
||||
{ "linux/usb/tmc.h", "USBTMC488_IOCTL_REN_CONTROL", _IOC_WRITE, 0x5b13, 0x01 },
|
||||
{ "linux/usb/tmc.h", "USBTMC488_IOCTL_TRIGGER", _IOC_NONE, 0x5b16, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_IN", _IOC_NONE, 0x5b04, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_OUT", _IOC_NONE, 0x5b03, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR", _IOC_NONE, 0x5b02, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_IN_HALT", _IOC_NONE, 0x5b07, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_OUT_HALT", _IOC_NONE, 0x5b06, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_CONFIG_TERMCHAR", _IOC_WRITE, 0x5b0c, 0x02 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_EOM_ENABLE", _IOC_WRITE, 0x5b0b, 0x01 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_GET_TIMEOUT", _IOC_READ, 0x5b09, 0x04 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_INDICATOR_PULSE", _IOC_NONE, 0x5b01, 0x00 },
|
||||
{ "linux/usb/tmc.h", "USBTMC_IOCTL_SET_TIMEOUT", _IOC_WRITE, 0x5b0a, 0x04 },
|
||||
{ "linux/usbdevice_fs.h", "USBDEVFS_ALLOC_STREAMS", _IOC_READ, 0x551c, 0x08 },
|
||||
{ "linux/usbdevice_fs.h", "USBDEVFS_BULK", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 },
|
||||
{ "linux/usbdevice_fs.h", "USBDEVFS_BULK32", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 },
|
||||
@ -2087,21 +2097,14 @@
|
||||
{ "linux/userfaultfd.h", "UFFDIO_ZEROPAGE", _IOC_READ|_IOC_WRITE, 0xaa04, 0x20 },
|
||||
{ "linux/uvcvideo.h", "UVCIOC_CTRL_MAP", _IOC_READ|_IOC_WRITE, 0x7520, 0x58 },
|
||||
{ "linux/uvcvideo.h", "UVCIOC_CTRL_QUERY", _IOC_READ|_IOC_WRITE, 0x7521, 0x0c },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x564b, 0x40 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_SIZE", _IOC_READ|_IOC_WRITE, 0x564a, 0x40 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_MBUS_CODE", _IOC_READ|_IOC_WRITE, 0x5602, 0x30 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x38 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x24 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0x58 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5615, 0x30 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x563d, 0x40 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_CROP", _IOC_READ|_IOC_WRITE, 0x563c, 0x38 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x24 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0x58 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5616, 0x30 },
|
||||
{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x563e, 0x40 },
|
||||
@ -2143,6 +2146,7 @@
|
||||
{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY", _IOC_NONE, 0x3b76, 0x00 },
|
||||
{ "linux/vfio.h", "VFIO_IOMMU_UNMAP_DMA", _IOC_NONE, 0x3b72, 0x00 },
|
||||
{ "linux/vfio.h", "VFIO_SET_IOMMU", _IOC_NONE, 0x3b66, 0x00 },
|
||||
{ "linux/vhost.h", "VHOST_GET_BACKEND_FEATURES", _IOC_READ, 0xaf26, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_GET_FEATURES", _IOC_READ, 0xaf00, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_GET_VRING_BASE", _IOC_READ|_IOC_WRITE, 0xaf12, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_GET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf24, 0x08 },
|
||||
@ -2154,6 +2158,7 @@
|
||||
{ "linux/vhost.h", "VHOST_SCSI_GET_EVENTS_MISSED", _IOC_WRITE, 0xaf44, 0x04 },
|
||||
{ "linux/vhost.h", "VHOST_SCSI_SET_ENDPOINT", _IOC_WRITE, 0xaf40, 0xe8 },
|
||||
{ "linux/vhost.h", "VHOST_SCSI_SET_EVENTS_MISSED", _IOC_WRITE, 0xaf43, 0x04 },
|
||||
{ "linux/vhost.h", "VHOST_SET_BACKEND_FEATURES", _IOC_WRITE, 0xaf25, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_SET_FEATURES", _IOC_WRITE, 0xaf00, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_SET_LOG_BASE", _IOC_WRITE, 0xaf04, 0x08 },
|
||||
{ "linux/vhost.h", "VHOST_SET_LOG_FD", _IOC_WRITE, 0xaf07, 0x04 },
|
||||
@ -2223,7 +2228,6 @@
|
||||
{ "linux/videodev2.h", "VIDIOC_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 },
|
||||
{ "linux/videodev2.h", "VIDIOC_QUERY_EXT_CTRL", _IOC_READ|_IOC_WRITE, 0x5667, 0xe8 },
|
||||
{ "linux/videodev2.h", "VIDIOC_REQBUFS", _IOC_READ|_IOC_WRITE, 0x5608, 0x14 },
|
||||
{ "linux/videodev2.h", "VIDIOC_RESERVED", _IOC_NONE, 0x5601, 0x00 },
|
||||
{ "linux/videodev2.h", "VIDIOC_STREAMOFF", _IOC_WRITE, 0x5613, 0x04 },
|
||||
{ "linux/videodev2.h", "VIDIOC_STREAMON", _IOC_WRITE, 0x5612, 0x04 },
|
||||
{ "linux/videodev2.h", "VIDIOC_SUBSCRIBE_EVENT", _IOC_WRITE, 0x565a, 0x20 },
|
||||
@ -2750,6 +2754,10 @@
|
||||
{ "xen/evtchn.h", "IOCTL_EVTCHN_RESET", _IOC_NONE, 0x4505, 0x00 },
|
||||
{ "xen/evtchn.h", "IOCTL_EVTCHN_RESTRICT_DOMID", _IOC_NONE, 0x4506, 0x02 },
|
||||
{ "xen/evtchn.h", "IOCTL_EVTCHN_UNBIND", _IOC_NONE, 0x4503, 0x04 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS", _IOC_NONE, 0x4709, 0x14 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED", _IOC_NONE, 0x470a, 0x08 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_RELEASE", _IOC_NONE, 0x470c, 0x08 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_TO_REFS", _IOC_NONE, 0x470b, 0x14 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR", _IOC_NONE, 0x4702, 0x18 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_GRANT_COPY", _IOC_NONE, 0x4708, 0x08 },
|
||||
{ "xen/gntdev.h", "IOCTL_GNTDEV_MAP_GRANT_REF", _IOC_NONE, 0x4700, 0x18 },
|
||||
|
@ -44,6 +44,7 @@
|
||||
{ "linux/kvm.h", "KVM_GET_MSRS", _IOC_READ|_IOC_WRITE, 0xae88, 0x08 },
|
||||
{ "linux/kvm.h", "KVM_GET_MSR_FEATURE_INDEX_LIST", _IOC_READ|_IOC_WRITE, 0xae0a, 0x04 },
|
||||
{ "linux/kvm.h", "KVM_GET_MSR_INDEX_LIST", _IOC_READ|_IOC_WRITE, 0xae02, 0x04 },
|
||||
{ "linux/kvm.h", "KVM_GET_NESTED_STATE", _IOC_READ|_IOC_WRITE, 0xaebe, 0x80 },
|
||||
{ "linux/kvm.h", "KVM_GET_NR_MMU_PAGES", _IOC_NONE, 0xae45, 0x00 },
|
||||
{ "linux/kvm.h", "KVM_GET_ONE_REG", _IOC_WRITE, 0xaeab, 0x10 },
|
||||
{ "linux/kvm.h", "KVM_GET_PIT", _IOC_READ|_IOC_WRITE, 0xae65, 0x48 },
|
||||
@ -88,6 +89,7 @@
|
||||
{ "linux/kvm.h", "KVM_SET_MEMORY_REGION", _IOC_WRITE, 0xae40, 0x18 },
|
||||
{ "linux/kvm.h", "KVM_SET_MP_STATE", _IOC_WRITE, 0xae99, 0x04 },
|
||||
{ "linux/kvm.h", "KVM_SET_MSRS", _IOC_WRITE, 0xae89, 0x08 },
|
||||
{ "linux/kvm.h", "KVM_SET_NESTED_STATE", _IOC_WRITE, 0xaebf, 0x80 },
|
||||
{ "linux/kvm.h", "KVM_SET_NR_MMU_PAGES", _IOC_NONE, 0xae44, 0x00 },
|
||||
{ "linux/kvm.h", "KVM_SET_ONE_REG", _IOC_WRITE, 0xaeac, 0x10 },
|
||||
{ "linux/kvm.h", "KVM_SET_PIT", _IOC_READ, 0xae66, 0x48 },
|
||||
|
@ -337,6 +337,6 @@
|
||||
[346] = { 6, TD, SEN(preadv2), "preadv2" },
|
||||
[347] = { 6, TD, SEN(pwritev2), "pwritev2" },
|
||||
[348] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
|
||||
[249] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
|
||||
[349] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
|
||||
[350] = { 1, 0, SEN(pkey_free), "pkey_free" },
|
||||
[351] = { 5, TD|TF|TSTA, SEN(statx), "statx" },
|
||||
|
@ -5,11 +5,13 @@ gl_WARN_ADD([-Wformat-security])
|
||||
gl_WARN_ADD([-Wignored-qualifiers])
|
||||
gl_WARN_ADD([-Wimplicit-fallthrough=5])
|
||||
gl_WARN_ADD([-Winit-self])
|
||||
gl_WARN_ADD([-Winitializer-overrides])
|
||||
gl_WARN_ADD([-Wlogical-op])
|
||||
gl_WARN_ADD([-Wmissing-parameter-type])
|
||||
gl_WARN_ADD([-Wnested-externs])
|
||||
gl_WARN_ADD([-Wold-style-declaration])
|
||||
gl_WARN_ADD([-Wold-style-definition])
|
||||
gl_WARN_ADD([-Woverride-init])
|
||||
gl_WARN_ADD([-Wsign-compare])
|
||||
gl_WARN_ADD([-Wtype-limits])
|
||||
gl_WARN_ADD([-Wwrite-strings])
|
||||
|
4
macros.h
4
macros.h
@ -48,6 +48,10 @@
|
||||
#endif
|
||||
#define CLAMP(val, min, max) MIN(MAX(min, val), max)
|
||||
|
||||
#ifndef ROUNDUP
|
||||
# define ROUNDUP(val_, div_) ((((val_) + (div_) - 1) / (div_)) * (div_))
|
||||
#endif
|
||||
|
||||
#ifndef offsetofend
|
||||
# define offsetofend(type_, member_) \
|
||||
(offsetof(type_, member_) + sizeof(((type_ *)0)->member_))
|
||||
|
@ -404,7 +404,7 @@ s/^\([[:space:]]\+[^),]\+)\),$/\1/' >> "$tmpdir/$f"
|
||||
arm_list='KVM_ARM_[A-Z_]+'
|
||||
ppc_list='KVM_ALLOCATE_RMA|KVM_CREATE_SPAPR_TCE|KVM_CREATE_SPAPR_TCE_64|KVM_PPC_[A-Z1-9_]+'
|
||||
s390_list='KVM_S390_[A-Z_]+'
|
||||
x86_list='KVM_GET_CPUID2|KVM_GET_DEBUGREGS|KVM_GET_EMULATED_CPUID|KVM_GET_LAPIC|KVM_GET_MSRS|KVM_GET_MSR_FEATURE_INDEX_LIST|KVM_GET_MSR_INDEX_LIST|KVM_GET_PIT|KVM_GET_PIT2|KVM_GET_SUPPORTED_CPUID|KVM_GET_VCPU_EVENTS|KVM_GET_XCRS|KVM_GET_XSAVE|KVM_HYPERV_EVENTFD|KVM_SET_CPUID|KVM_SET_CPUID2|KVM_SET_DEBUGREGS|KVM_SET_LAPIC|KVM_SET_MEMORY_ALIAS|KVM_SET_MSRS|KVM_SET_PIT|KVM_SET_PIT2|KVM_SET_VCPU_EVENTS|KVM_SET_XCRS|KVM_SET_XSAVE|KVM_XEN_HVM_CONFIG|KVM_X86_[A-Z_]+'
|
||||
x86_list='KVM_GET_CPUID2|KVM_GET_DEBUGREGS|KVM_GET_EMULATED_CPUID|KVM_GET_LAPIC|KVM_GET_MSRS|KVM_GET_MSR_FEATURE_INDEX_LIST|KVM_GET_MSR_INDEX_LIST|KVM_GET_NESTED_STATE|KVM_GET_PIT|KVM_GET_PIT2|KVM_GET_SUPPORTED_CPUID|KVM_GET_VCPU_EVENTS|KVM_GET_XCRS|KVM_GET_XSAVE|KVM_HYPERV_EVENTFD|KVM_SET_CPUID|KVM_SET_CPUID2|KVM_SET_DEBUGREGS|KVM_SET_LAPIC|KVM_SET_MEMORY_ALIAS|KVM_SET_MSRS|KVM_SET_NESTED_STATE|KVM_SET_PIT|KVM_SET_PIT2|KVM_SET_VCPU_EVENTS|KVM_SET_XCRS|KVM_SET_XSAVE|KVM_XEN_HVM_CONFIG|KVM_X86_[A-Z_]+'
|
||||
case "$uname_m" in
|
||||
aarch64|arm*) list="$ppc_list|$s390_list|$x86_list" ;;
|
||||
ppc*) list="$arm_list|$s390_list|$x86_list" ;;
|
||||
@ -414,6 +414,10 @@ s/^\([[:space:]]\+[^),]\+)\),$/\1/' >> "$tmpdir/$f"
|
||||
esac
|
||||
sed -r -i "/[[:space:]]($list)[[:space:]]/d" "$tmpdir"/header.out
|
||||
;;
|
||||
*linux/v4l2-subdev.h)
|
||||
sed -r -i '/[[:space:]]VIDIOC_SUBDEV_(DV_TIMINGS_CAP|ENUM_DV_TIMINGS|ENUMSTD|G_DV_TIMINGS|G_EDID|G_STD|QUERY_DV_TIMINGS|QUERYSTD|S_DV_TIMINGS|S_EDID|S_STD)[[:space:]]/d' \
|
||||
"$tmpdir"/header.out
|
||||
;;
|
||||
esac
|
||||
|
||||
# Need to exclude ioctl commands defined elsewhere.
|
||||
|
@ -1,5 +1,4 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Chen Jingpiao <chenjingpiao@gmail.com>
|
||||
* Copyright (c) 2018 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -26,32 +25,49 @@
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef STRACE_SECCOMP_FILTER_H
|
||||
#define STRACE_SECCOMP_FILTER_H
|
||||
|
||||
#include "defs.h"
|
||||
#include "print_fields.h"
|
||||
#include <linux/ioctl.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/nbd.h>
|
||||
|
||||
#ifdef HAVE_LINUX_SECCOMP_H
|
||||
# include <linux/seccomp.h>
|
||||
#endif
|
||||
#define XLAT_MACROS_ONLY
|
||||
# include "xlat/nbd_ioctl_cmds.h"
|
||||
#undef XLAT_MACROS_ONLY
|
||||
|
||||
#define SECCOMP_TRACE_SYSCALL_MAX (SUPPORTED_PERSONALITIES * 150)
|
||||
#define SECCOMP_BPF_MAXINSNS (SECCOMP_TRACE_SYSCALL_MAX + 200)
|
||||
#include "xlat/nbd_ioctl_flags.h"
|
||||
|
||||
extern bool enable_seccomp_filter;
|
||||
extern bool seccomp_before_ptrace;
|
||||
int
|
||||
nbd_ioctl(struct tcb *const tcp, const unsigned int code,
|
||||
const kernel_ulong_t arg)
|
||||
{
|
||||
switch (code) {
|
||||
case NBD_DISCONNECT:
|
||||
case NBD_CLEAR_SOCK:
|
||||
case NBD_DO_IT:
|
||||
case NBD_CLEAR_QUE:
|
||||
case NBD_PRINT_DEBUG:
|
||||
return RVAL_IOCTL_DECODED;
|
||||
|
||||
extern void check_seccomp_filter(void);
|
||||
extern void init_seccomp_filter(void);
|
||||
extern int seccomp_filter_restart_operator(const struct tcb *);
|
||||
case NBD_SET_SOCK:
|
||||
tprints(", ");
|
||||
printfd(tcp, arg);
|
||||
return RVAL_IOCTL_DECODED;
|
||||
|
||||
#define SET_BPF(filter, code, jt, jf, k) \
|
||||
(*(filter) = (struct sock_filter) { code, jt, jf, k })
|
||||
case NBD_SET_BLKSIZE:
|
||||
case NBD_SET_SIZE:
|
||||
case NBD_SET_SIZE_BLOCKS:
|
||||
case NBD_SET_TIMEOUT:
|
||||
tprints(", ");
|
||||
tprintf("%" PRI_klu, arg);
|
||||
return RVAL_IOCTL_DECODED;
|
||||
|
||||
#define SET_BPF_STMT(filter, code, k) \
|
||||
SET_BPF(filter, code, 0, 0, k)
|
||||
case NBD_SET_FLAGS:
|
||||
tprints(", ");
|
||||
printflags(nbd_ioctl_flags, arg, "NBD_IOC_FLAG_???");
|
||||
return RVAL_IOCTL_DECODED;
|
||||
|
||||
#define SET_BPF_JUMP(filter, code, k, jt, jf) \
|
||||
SET_BPF(filter, code, jt, jf, k)
|
||||
|
||||
#endif /* !STRACE_SECCOMP_FILTER_H */
|
||||
default:
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
}
|
23
net.c
23
net.c
@ -86,7 +86,9 @@
|
||||
|
||||
#define XLAT_MACROS_ONLY
|
||||
# include "xlat/addrfams.h"
|
||||
# include "xlat/ethernet_protocols.h"
|
||||
#undef XLAT_MACROS_ONLY
|
||||
#include "xlat/ax25_protocols.h"
|
||||
#include "xlat/irda_protocols.h"
|
||||
#include "xlat/can_protocols.h"
|
||||
#include "xlat/bt_protocols.h"
|
||||
@ -144,10 +146,23 @@ SYS_FUNC(socket)
|
||||
printxval_search(inet_protocols, tcp->u_arg[2], "IPPROTO_???");
|
||||
break;
|
||||
|
||||
case AF_AX25:
|
||||
/* Those are not available in public headers. */
|
||||
printxval_searchn_ex(ARRSZ_PAIR(ax25_protocols), tcp->u_arg[2],
|
||||
"AX25_P_???", XLAT_STYLE_VERBOSE);
|
||||
break;
|
||||
|
||||
case AF_NETLINK:
|
||||
printxval(netlink_protocols, tcp->u_arg[2], "NETLINK_???");
|
||||
break;
|
||||
|
||||
case AF_PACKET:
|
||||
tprints("htons(");
|
||||
printxval_searchn(ethernet_protocols, ethernet_protocols_size,
|
||||
ntohs(tcp->u_arg[2]), "ETH_P_???");
|
||||
tprints(")");
|
||||
break;
|
||||
|
||||
case AF_IRDA:
|
||||
printxval_index(can_protocols, tcp->u_arg[2], "IRDAPROTO_???");
|
||||
break;
|
||||
@ -437,6 +452,7 @@ SYS_FUNC(socketpair)
|
||||
#include "xlat/getsock_ipv6_options.h"
|
||||
#include "xlat/setsock_ipv6_options.h"
|
||||
#include "xlat/sock_ipx_options.h"
|
||||
#include "xlat/sock_ax25_options.h"
|
||||
#include "xlat/sock_netlink_options.h"
|
||||
#include "xlat/sock_packet_options.h"
|
||||
#include "xlat/sock_raw_options.h"
|
||||
@ -458,6 +474,7 @@ SYS_FUNC(socketpair)
|
||||
#include "xlat/sock_nfcllcp_options.h"
|
||||
#include "xlat/sock_kcm_options.h"
|
||||
#include "xlat/sock_tls_options.h"
|
||||
#include "xlat/sock_xdp_options.h"
|
||||
|
||||
static void
|
||||
print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level,
|
||||
@ -487,6 +504,9 @@ print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level,
|
||||
case SOL_IPX:
|
||||
printxval(sock_ipx_options, name, "IPX_???");
|
||||
break;
|
||||
case SOL_AX25:
|
||||
printxval_search(sock_ax25_options, name, "AX25_???");
|
||||
break;
|
||||
case SOL_PACKET:
|
||||
printxval(sock_packet_options, name, "PACKET_???");
|
||||
break;
|
||||
@ -550,6 +570,9 @@ print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level,
|
||||
case SOL_TLS:
|
||||
printxval(sock_tls_options, name, "TLS_???");
|
||||
break;
|
||||
case SOL_XDP:
|
||||
printxval_index(sock_xdp_options, name, "XDP_???");
|
||||
break;
|
||||
|
||||
/* Other SOL_* protocol levels still need work. */
|
||||
|
||||
|
@ -438,7 +438,7 @@ decode_nlmsg_flags(const uint16_t flags, const uint16_t type,
|
||||
} else if (family < ARRAY_SIZE(nlmsg_flags) && nlmsg_flags[family])
|
||||
table = nlmsg_flags[family](type);
|
||||
|
||||
printflags_ex(flags, "NLM_F_???", XLAT_STYLE_ABBREV,
|
||||
printflags_ex(flags, "NLM_F_???", XLAT_STYLE_DEFAULT,
|
||||
netlink_flags, table, NULL);
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
||||
#ifndef STRACE_NETLINK_H
|
||||
#define STRACE_NETLINK_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <sys/socket.h>
|
||||
#include <linux/netlink.h>
|
||||
|
||||
@ -63,4 +64,12 @@
|
||||
# define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
|
||||
#endif
|
||||
|
||||
static inline bool
|
||||
is_nlmsg_ok(const struct nlmsghdr *const nlh, const ssize_t len)
|
||||
{
|
||||
return len >= (ssize_t) sizeof(*nlh)
|
||||
&& nlh->nlmsg_len >= sizeof(*nlh)
|
||||
&& (size_t) len >= nlh->nlmsg_len;
|
||||
}
|
||||
|
||||
#endif /* !STRACE_NETLINK_H */
|
||||
|
@ -70,10 +70,13 @@ decode_netlink_netfilter(struct tcb *const tcp,
|
||||
tprints(", res_id=");
|
||||
if (subsys_id == NFNL_SUBSYS_NFTABLES
|
||||
&& res_id == NFNL_SUBSYS_NFTABLES) {
|
||||
tprints("htons(NFNL_SUBSYS_NFTABLES)");
|
||||
print_xlat_ex(nfmsg.res_id,
|
||||
"htons(NFNL_SUBSYS_NFTABLES)",
|
||||
XLAT_STYLE_DEFAULT);
|
||||
} else if (subsys_id == NFNL_SUBSYS_NFTABLES
|
||||
&& nfmsg.res_id == NFNL_SUBSYS_NFTABLES) {
|
||||
tprints("NFNL_SUBSYS_NFTABLES");
|
||||
print_xlat_ex(nfmsg.res_id, "NFNL_SUBSYS_NFTABLES",
|
||||
XLAT_STYLE_DEFAULT);
|
||||
} else {
|
||||
tprintf("htons(%d)", res_id);
|
||||
}
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include <linux/sock_diag.h>
|
||||
#include <linux/packet_diag.h>
|
||||
|
||||
#include "xlat/af_packet_versions.h"
|
||||
#include "xlat/packet_diag_attrs.h"
|
||||
#include "xlat/packet_diag_info_flags.h"
|
||||
#include "xlat/packet_diag_show.h"
|
||||
@ -52,10 +53,11 @@ DECL_NETLINK_DIAG_DECODER(decode_packet_diag_req)
|
||||
if (!umoven_or_printaddr(tcp, addr + offset,
|
||||
sizeof(req) - offset,
|
||||
(char *) &req + offset)) {
|
||||
tprints("sdiag_protocol=");
|
||||
printxval_searchn(ethernet_protocols,
|
||||
ethernet_protocols_size,
|
||||
req.sdiag_protocol, "ETH_P_???");
|
||||
/*
|
||||
* AF_PACKET currently doesn't support protocol values
|
||||
* other than 0.
|
||||
*/
|
||||
PRINT_FIELD_X("", req, sdiag_protocol);
|
||||
PRINT_FIELD_U(", ", req, pdiag_ino);
|
||||
PRINT_FIELD_FLAGS(", ", req, pdiag_show,
|
||||
packet_diag_show, "PACKET_SHOW_???");
|
||||
@ -79,8 +81,9 @@ decode_packet_diag_info(struct tcb *const tcp,
|
||||
if (umove_or_printaddr(tcp, addr, &pinfo))
|
||||
return true;
|
||||
|
||||
PRINT_FIELD_U("{", pinfo, pdi_index);
|
||||
PRINT_FIELD_U(", ", pinfo, pdi_version);
|
||||
PRINT_FIELD_IFINDEX("{", pinfo, pdi_index);
|
||||
PRINT_FIELD_XVAL(", ", pinfo, pdi_version, af_packet_versions,
|
||||
"TPACKET_???");
|
||||
PRINT_FIELD_U(", ", pinfo, pdi_reserve);
|
||||
PRINT_FIELD_U(", ", pinfo, pdi_copy_thresh);
|
||||
PRINT_FIELD_U(", ", pinfo, pdi_tstamp);
|
||||
@ -172,7 +175,7 @@ static const nla_decoder_t packet_diag_msg_nla_decoders[] = {
|
||||
[PACKET_DIAG_RX_RING] = decode_packet_diag_ring,
|
||||
[PACKET_DIAG_TX_RING] = decode_packet_diag_ring,
|
||||
[PACKET_DIAG_FANOUT] = decode_nla_u32,
|
||||
[PACKET_DIAG_UID] = decode_nla_u32,
|
||||
[PACKET_DIAG_UID] = decode_nla_uid,
|
||||
[PACKET_DIAG_MEMINFO] = decode_nla_meminfo,
|
||||
[PACKET_DIAG_FILTER] = decode_packet_diag_filter
|
||||
};
|
||||
@ -191,7 +194,10 @@ DECL_NETLINK_DIAG_DECODER(decode_packet_diag_msg)
|
||||
(char *) &msg + offset)) {
|
||||
PRINT_FIELD_XVAL("", msg, pdiag_type,
|
||||
socktypes, "SOCK_???");
|
||||
PRINT_FIELD_U(", ", msg, pdiag_num);
|
||||
PRINT_FIELD_XVAL_SORTED_SIZED(", ", msg, pdiag_num,
|
||||
ethernet_protocols,
|
||||
ethernet_protocols_size,
|
||||
"ETH_P_???");
|
||||
PRINT_FIELD_U(", ", msg, pdiag_ino);
|
||||
PRINT_FIELD_COOKIE(", ", msg, pdiag_cookie);
|
||||
decode_nla = true;
|
||||
|
@ -29,20 +29,27 @@
|
||||
#include "defs.h"
|
||||
#include <sys/socket.h>
|
||||
|
||||
#ifdef AF_SMC
|
||||
#ifndef AF_SMC
|
||||
# define XLAT_MACROS_ONLY
|
||||
# include "xlat/addrfams.h"
|
||||
# undef XLAT_MACROS_ONLY
|
||||
#endif
|
||||
|
||||
# include "netlink.h"
|
||||
# include "netlink_sock_diag.h"
|
||||
# include "nlattr.h"
|
||||
# include "print_fields.h"
|
||||
#include "netlink.h"
|
||||
#include "netlink_sock_diag.h"
|
||||
#include "nlattr.h"
|
||||
#include "print_fields.h"
|
||||
|
||||
# include <arpa/inet.h>
|
||||
# include <linux/smc_diag.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <linux/smc_diag.h>
|
||||
|
||||
# include "xlat/smc_diag_attrs.h"
|
||||
# include "xlat/smc_diag_extended_flags.h"
|
||||
# include "xlat/smc_link_group_roles.h"
|
||||
# include "xlat/smc_states.h"
|
||||
#include "xlat/smc_decl_codes.h"
|
||||
#include "xlat/smc_diag_attrs.h"
|
||||
#include "xlat/smc_diag_extended_flags.h"
|
||||
#include "xlat/smc_diag_mode.h"
|
||||
#include "xlat/smc_link_group_roles.h"
|
||||
#include "xlat/smc_states.h"
|
||||
#include "xlat/sock_shutdown_flags.h"
|
||||
|
||||
DECL_NETLINK_DIAG_DECODER(decode_smc_diag_req)
|
||||
{
|
||||
@ -142,10 +149,76 @@ decode_smc_diag_lgrinfo(struct tcb *const tcp,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
decode_smc_diag_shutdown(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
const struct decode_nla_xlat_opts opts = {
|
||||
ARRSZ_PAIR(sock_shutdown_flags), "???_SHUTDOWN",
|
||||
.size = 1,
|
||||
};
|
||||
|
||||
return decode_nla_flags(tcp, addr, len, &opts);
|
||||
}
|
||||
|
||||
static bool
|
||||
decode_smc_diag_dmbinfo(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
struct smcd_diag_dmbinfo dinfo;
|
||||
|
||||
if (len < sizeof(dinfo))
|
||||
return false;
|
||||
if (umove_or_printaddr(tcp, addr, &dinfo))
|
||||
return true;
|
||||
|
||||
PRINT_FIELD_U("{", dinfo, linkid);
|
||||
PRINT_FIELD_X(", ", dinfo, peer_gid);
|
||||
PRINT_FIELD_X(", ", dinfo, my_gid);
|
||||
PRINT_FIELD_X(", ", dinfo, token);
|
||||
PRINT_FIELD_X(", ", dinfo, peer_token);
|
||||
tprints("}");
|
||||
|
||||
return true;
|
||||
}
|
||||
static bool
|
||||
decode_smc_diag_fallback(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
struct smc_diag_fallback fb;
|
||||
|
||||
if (len < sizeof(fb))
|
||||
return false;
|
||||
if (umove_or_printaddr(tcp, addr, &fb))
|
||||
return true;
|
||||
|
||||
/*
|
||||
* We print them verbose since they are defined in a non-UAPI header,
|
||||
* net/smc/smc_clc.h
|
||||
*/
|
||||
tprints("{reason=");
|
||||
printxval_search_ex(smc_decl_codes, fb.reason,
|
||||
"SMC_CLC_DECL_???", XLAT_STYLE_VERBOSE);
|
||||
tprints(", peer_diagnosis=");
|
||||
printxval_search_ex(smc_decl_codes, fb.peer_diagnosis,
|
||||
"SMC_CLC_DECL_???", XLAT_STYLE_VERBOSE);
|
||||
tprints("}");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static const nla_decoder_t smc_diag_msg_nla_decoders[] = {
|
||||
[SMC_DIAG_CONNINFO] = decode_smc_diag_conninfo,
|
||||
[SMC_DIAG_LGRINFO] = decode_smc_diag_lgrinfo,
|
||||
[SMC_DIAG_SHUTDOWN] = decode_nla_u8
|
||||
[SMC_DIAG_SHUTDOWN] = decode_smc_diag_shutdown,
|
||||
[SMC_DIAG_DMBINFO] = decode_smc_diag_dmbinfo,
|
||||
[SMC_DIAG_FALLBACK] = decode_smc_diag_fallback,
|
||||
};
|
||||
|
||||
DECL_NETLINK_DIAG_DECODER(decode_smc_diag_msg)
|
||||
@ -162,7 +235,9 @@ DECL_NETLINK_DIAG_DECODER(decode_smc_diag_msg)
|
||||
(void *) &msg + offset)) {
|
||||
PRINT_FIELD_XVAL("", msg, diag_state,
|
||||
smc_states, "SMC_???");
|
||||
PRINT_FIELD_U(", ", msg, diag_fallback);
|
||||
PRINT_FIELD_XVAL_INDEX(", ", msg, diag_fallback,
|
||||
smc_diag_mode,
|
||||
"SMC_DIAG_MODE_???");
|
||||
PRINT_FIELD_U(", ", msg, diag_shutdown);
|
||||
/*
|
||||
* AF_SMC protocol family socket handler
|
||||
@ -186,5 +261,3 @@ DECL_NETLINK_DIAG_DECODER(decode_smc_diag_msg)
|
||||
ARRAY_SIZE(smc_diag_msg_nla_decoders), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* AF_SMC */
|
||||
|
@ -31,6 +31,10 @@
|
||||
#include "netlink.h"
|
||||
#include "netlink_sock_diag.h"
|
||||
|
||||
#define XLAT_MACROS_ONLY
|
||||
#include "xlat/addrfams.h"
|
||||
#undef XLAT_MACROS_ONLY
|
||||
|
||||
static void
|
||||
decode_family(struct tcb *const tcp, const uint8_t family,
|
||||
const kernel_ulong_t addr, const unsigned int len)
|
||||
@ -50,14 +54,12 @@ typedef DECL_NETLINK_DIAG_DECODER((*netlink_diag_decoder_t));
|
||||
static const struct {
|
||||
const netlink_diag_decoder_t request, response;
|
||||
} diag_decoders[] = {
|
||||
[AF_UNIX] = { decode_unix_diag_req, decode_unix_diag_msg },
|
||||
[AF_INET] = { decode_inet_diag_req, decode_inet_diag_msg },
|
||||
[AF_INET6] = { decode_inet_diag_req, decode_inet_diag_msg },
|
||||
[AF_NETLINK] = { decode_netlink_diag_req, decode_netlink_diag_msg },
|
||||
[AF_PACKET] = { decode_packet_diag_req, decode_packet_diag_msg },
|
||||
#ifdef AF_SMC
|
||||
[AF_SMC] = { decode_smc_diag_req, decode_smc_diag_msg },
|
||||
#endif
|
||||
[AF_UNIX] = { decode_unix_diag_req, decode_unix_diag_msg }
|
||||
};
|
||||
|
||||
bool
|
||||
|
35
nlattr.c
35
nlattr.c
@ -101,7 +101,8 @@ decode_nlattr_with_data(struct tcb *const tcp,
|
||||
print_nlattr(nla, table, dflt);
|
||||
|
||||
if (nla_len > NLA_HDRLEN) {
|
||||
const unsigned int idx = size ? nla->nla_type : 0;
|
||||
const unsigned int idx =
|
||||
size ? nla->nla_type & NLA_TYPE_MASK : 0;
|
||||
|
||||
tprints(", ");
|
||||
if (!decoders
|
||||
@ -357,6 +358,38 @@ decode_nla_ip_proto(struct tcb *const tcp,
|
||||
return decode_nla_xval(tcp, addr, len, &opts);
|
||||
}
|
||||
|
||||
bool
|
||||
decode_nla_in_addr(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
struct in_addr in;
|
||||
|
||||
if (len < sizeof(in))
|
||||
return false;
|
||||
else if (!umove_or_printaddr(tcp, addr, &in))
|
||||
print_inet_addr(AF_INET, &in, sizeof(in), NULL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
decode_nla_in6_addr(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
struct in6_addr in6;
|
||||
|
||||
if (len < sizeof(in6))
|
||||
return false;
|
||||
else if (!umove_or_printaddr(tcp, addr, &in6))
|
||||
print_inet_addr(AF_INET6, &in6, sizeof(in6), NULL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
decode_nla_flags(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
|
2
nlattr.h
2
nlattr.h
@ -102,6 +102,8 @@ DECL_NLA(gid);
|
||||
DECL_NLA(ifindex);
|
||||
DECL_NLA(ether_proto);
|
||||
DECL_NLA(ip_proto);
|
||||
DECL_NLA(in_addr);
|
||||
DECL_NLA(in6_addr);
|
||||
DECL_NLA(meminfo);
|
||||
DECL_NLA(rt_class);
|
||||
DECL_NLA(rt_proto);
|
||||
|
12
nsfs.c
12
nsfs.c
@ -41,15 +41,9 @@ nsfs_ioctl(struct tcb *tcp, unsigned int code, kernel_ulong_t arg)
|
||||
case NS_GET_NSTYPE:
|
||||
if (entering(tcp))
|
||||
return 0;
|
||||
if (!syserror(tcp)) {
|
||||
const char *outstr;
|
||||
outstr = xlookup(setns_types, tcp->u_rval);
|
||||
if (outstr) {
|
||||
tcp->auxstr = outstr;
|
||||
return RVAL_IOCTL_DECODED | RVAL_STR;
|
||||
}
|
||||
}
|
||||
return RVAL_IOCTL_DECODED;
|
||||
if (!syserror(tcp))
|
||||
tcp->auxstr = xlookup(setns_types, tcp->u_rval);
|
||||
return RVAL_IOCTL_DECODED | RVAL_STR;
|
||||
case NS_GET_OWNER_UID:
|
||||
if (entering(tcp))
|
||||
return 0;
|
||||
|
@ -62,6 +62,5 @@ free_number_set_array(struct number_set *, unsigned int nmemb);
|
||||
extern struct number_set *read_set;
|
||||
extern struct number_set *write_set;
|
||||
extern struct number_set *signal_set;
|
||||
extern struct number_set *trace_set;
|
||||
|
||||
#endif /* !STRACE_NUMBER_SET_H */
|
||||
|
99
perf.c
99
perf.c
@ -31,6 +31,7 @@
|
||||
#include "defs.h"
|
||||
|
||||
#include "perf_event_struct.h"
|
||||
#include "print_fields.h"
|
||||
|
||||
#include "xlat/hw_breakpoint_len.h"
|
||||
#include "xlat/hw_breakpoint_type.h"
|
||||
@ -111,12 +112,6 @@ fetch_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define PRINT_XLAT(prefix, xlat, x, dflt) \
|
||||
do { \
|
||||
tprints(prefix); \
|
||||
printxval_search(xlat, x, dflt); \
|
||||
} while (0)
|
||||
|
||||
void
|
||||
print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
{
|
||||
@ -159,9 +154,9 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
use_new_size = 1;
|
||||
}
|
||||
|
||||
PRINT_XLAT("{type=", perf_type_id, attr->type, "PERF_TYPE_???");
|
||||
tprints(", size=");
|
||||
printxval(perf_attr_size, attr->size, "PERF_ATTR_SIZE_???");
|
||||
PRINT_FIELD_XVAL("{", *attr, type, perf_type_id, "PERF_TYPE_???");
|
||||
PRINT_FIELD_XVAL(", ", *attr, size, perf_attr_size,
|
||||
"PERF_ATTR_SIZE_???");
|
||||
|
||||
if (use_new_size) {
|
||||
tprints(" => ");
|
||||
@ -175,12 +170,12 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
|
||||
switch (attr->type) {
|
||||
case PERF_TYPE_HARDWARE:
|
||||
PRINT_XLAT(", config=", perf_hw_id, attr->config,
|
||||
"PERF_COUNT_HW_???");
|
||||
PRINT_FIELD_XVAL(", ", *attr, config, perf_hw_id,
|
||||
"PERF_COUNT_HW_???");
|
||||
break;
|
||||
case PERF_TYPE_SOFTWARE:
|
||||
PRINT_XLAT(", config=", perf_sw_ids, attr->config,
|
||||
"PERF_COUNT_SW_???");
|
||||
PRINT_FIELD_XVAL(", ", *attr, config, perf_sw_ids,
|
||||
"PERF_COUNT_SW_???");
|
||||
break;
|
||||
case PERF_TYPE_TRACEPOINT:
|
||||
/*
|
||||
@ -188,17 +183,20 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
* debugfs tracing/events/../../id if ftrace is enabled
|
||||
* in the kernel."
|
||||
*/
|
||||
tprintf(", config=%" PRIu64, attr->config);
|
||||
PRINT_FIELD_U(", ", *attr, config);
|
||||
break;
|
||||
case PERF_TYPE_HW_CACHE:
|
||||
/*
|
||||
* (perf_hw_cache_id) | (perf_hw_cache_op_id << 8) |
|
||||
* (perf_hw_cache_op_result_id << 16)
|
||||
*/
|
||||
PRINT_XLAT(", config=", perf_hw_cache_id, attr->config & 0xFF,
|
||||
"PERF_COUNT_HW_CACHE_???");
|
||||
PRINT_XLAT("|", perf_hw_cache_op_id, (attr->config >> 8) & 0xFF,
|
||||
tprints(", config=");
|
||||
printxval(perf_hw_cache_id, attr->config & 0xFF,
|
||||
"PERF_COUNT_HW_CACHE_???");
|
||||
tprints("|");
|
||||
printxval(perf_hw_cache_op_id, (attr->config >> 8) & 0xFF,
|
||||
"PERF_COUNT_HW_CACHE_OP_???");
|
||||
tprints("<<8|");
|
||||
/*
|
||||
* Current code (see set_ext_hw_attr in arch/x86/events/core.c,
|
||||
* tile_map_cache_event in arch/tile/kernel/perf_event.c,
|
||||
@ -214,9 +212,9 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
* armpmu_map_cache_event in drivers/perf/arm_pmu.c) assumes
|
||||
* that cache result is 8 bits in size.
|
||||
*/
|
||||
PRINT_XLAT("<<8|", perf_hw_cache_op_result_id,
|
||||
(attr->config >> 16) & 0xFF,
|
||||
"PERF_COUNT_HW_CACHE_RESULT_???");
|
||||
printxval(perf_hw_cache_op_result_id,
|
||||
(attr->config >> 16) & 0xFF,
|
||||
"PERF_COUNT_HW_CACHE_RESULT_???");
|
||||
tprints("<<16");
|
||||
if (attr->config >> 24) {
|
||||
tprintf("|%#" PRIx64 "<<24", attr->config >> 24);
|
||||
@ -241,7 +239,7 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
* to zero. Its parameters are set in other places."
|
||||
*/
|
||||
default:
|
||||
tprintf(", config=%#" PRIx64, attr->config);
|
||||
PRINT_FIELD_X(", ", *attr, config);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -249,17 +247,14 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
goto print_perf_event_attr_out;
|
||||
|
||||
if (attr->freq)
|
||||
tprintf(", sample_freq=%" PRIu64, attr->sample_freq);
|
||||
PRINT_FIELD_U(", ", *attr, sample_freq);
|
||||
else
|
||||
tprintf(", sample_period=%" PRIu64, attr->sample_period);
|
||||
PRINT_FIELD_U(", ", *attr, sample_period);
|
||||
|
||||
tprints(", sample_type=");
|
||||
printflags64(perf_event_sample_format, attr->sample_type,
|
||||
"PERF_SAMPLE_???");
|
||||
|
||||
tprints(", read_format=");
|
||||
printflags64(perf_event_read_format, attr->read_format,
|
||||
"PERF_FORMAT_???");
|
||||
PRINT_FIELD_FLAGS(", ", *attr, sample_type, perf_event_sample_format,
|
||||
"PERF_SAMPLE_???");
|
||||
PRINT_FIELD_FLAGS(", ", *attr, read_format, perf_event_read_format,
|
||||
"PERF_FORMAT_???");
|
||||
|
||||
tprintf(", disabled=%u"
|
||||
", inherit=%u"
|
||||
@ -330,22 +325,22 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
}
|
||||
|
||||
if (attr->watermark)
|
||||
tprintf(", wakeup_watermark=%u", attr->wakeup_watermark);
|
||||
PRINT_FIELD_U(", ", *attr, wakeup_watermark);
|
||||
else
|
||||
tprintf(", wakeup_events=%u", attr->wakeup_events);
|
||||
PRINT_FIELD_U(", ", *attr, wakeup_events);
|
||||
|
||||
if (attr->type == PERF_TYPE_BREAKPOINT)
|
||||
/* Any combination of R/W with X is deemed invalid */
|
||||
PRINT_XLAT(", bp_type=", hw_breakpoint_type, attr->bp_type,
|
||||
(attr->bp_type <=
|
||||
(HW_BREAKPOINT_X | HW_BREAKPOINT_RW)) ?
|
||||
"HW_BREAKPOINT_INVALID" :
|
||||
"HW_BREAKPOINT_???");
|
||||
PRINT_FIELD_XVAL(", ", *attr, bp_type, hw_breakpoint_type,
|
||||
(attr->bp_type <=
|
||||
(HW_BREAKPOINT_X | HW_BREAKPOINT_RW))
|
||||
? "HW_BREAKPOINT_INVALID"
|
||||
: "HW_BREAKPOINT_???");
|
||||
|
||||
if (attr->type == PERF_TYPE_BREAKPOINT)
|
||||
tprintf(", bp_addr=%#" PRIx64, attr->bp_addr);
|
||||
PRINT_FIELD_X(", ", *attr, bp_addr);
|
||||
else
|
||||
tprintf(", config1=%#" PRIx64, attr->config1);
|
||||
PRINT_FIELD_X(", ", *attr, config1);
|
||||
|
||||
/*
|
||||
* Fields after bp_addr/config1 are optional and may not present; check
|
||||
@ -354,15 +349,15 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
|
||||
_PERF_CHECK_FIELD(bp_len);
|
||||
if (attr->type == PERF_TYPE_BREAKPOINT)
|
||||
tprintf(", bp_len=%" PRIu64, attr->bp_len);
|
||||
PRINT_FIELD_U(", ", *attr, bp_len);
|
||||
else
|
||||
tprintf(", config2=%#" PRIx64, attr->config2);
|
||||
PRINT_FIELD_X(", ", *attr, config2);
|
||||
|
||||
_PERF_CHECK_FIELD(branch_sample_type);
|
||||
if (attr->sample_type & PERF_SAMPLE_BRANCH_STACK) {
|
||||
tprints(", branch_sample_type=");
|
||||
printflags64(perf_branch_sample_type, attr->branch_sample_type,
|
||||
"PERF_SAMPLE_BRANCH_???");
|
||||
PRINT_FIELD_FLAGS(", ", *attr, branch_sample_type,
|
||||
perf_branch_sample_type,
|
||||
"PERF_SAMPLE_BRANCH_???");
|
||||
}
|
||||
|
||||
_PERF_CHECK_FIELD(sample_regs_user);
|
||||
@ -372,7 +367,7 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
* described in the kernel header
|
||||
* arch/ARCH/include/uapi/asm/perf_regs.h."
|
||||
*/
|
||||
tprintf(", sample_regs_user=%#" PRIx64, attr->sample_regs_user);
|
||||
PRINT_FIELD_X(", ", *attr, sample_regs_user);
|
||||
|
||||
_PERF_CHECK_FIELD(sample_stack_user);
|
||||
/*
|
||||
@ -380,26 +375,24 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
* specified."
|
||||
*/
|
||||
if (attr->sample_type & PERF_SAMPLE_STACK_USER)
|
||||
tprintf(", sample_stack_user=%#" PRIx32,
|
||||
attr->sample_stack_user);
|
||||
PRINT_FIELD_X(", ", *attr, sample_stack_user);
|
||||
|
||||
if (attr->use_clockid) {
|
||||
_PERF_CHECK_FIELD(clockid);
|
||||
tprints(", clockid=");
|
||||
printxval(clocknames, attr->clockid, "CLOCK_???");
|
||||
PRINT_FIELD_XVAL(", ", *attr, clockid, clocknames, "CLOCK_???");
|
||||
}
|
||||
|
||||
_PERF_CHECK_FIELD(sample_regs_intr);
|
||||
tprintf(", sample_regs_intr=%#" PRIx64, attr->sample_regs_intr);
|
||||
PRINT_FIELD_X(", ", *attr, sample_regs_intr);
|
||||
|
||||
_PERF_CHECK_FIELD(aux_watermark);
|
||||
tprintf(", aux_watermark=%" PRIu32, attr->aux_watermark);
|
||||
PRINT_FIELD_U(", ", *attr, aux_watermark);
|
||||
|
||||
_PERF_CHECK_FIELD(sample_max_stack);
|
||||
tprintf(", sample_max_stack=%" PRIu16, attr->sample_max_stack);
|
||||
PRINT_FIELD_U(", ", *attr, sample_max_stack);
|
||||
|
||||
/* _PERF_CHECK_FIELD(__reserved_2);
|
||||
tprintf(", __reserved2=%" PRIu16, attr->__reserved_2); */
|
||||
PRINT_FIELD_U(", ", *attr, __reserved2); */
|
||||
|
||||
print_perf_event_attr_out:
|
||||
if ((attr->size && (attr->size > size)) ||
|
||||
|
@ -135,7 +135,7 @@
|
||||
do { \
|
||||
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
|
||||
if (zero_extend_signed_to_ull((where_).field_) == UINT64_MAX) \
|
||||
print_xlat_ex(UINT64_MAX, "UINT64_MAX", XLAT_STYLE_FMT_U); \
|
||||
print_xlat_u(UINT64_MAX); \
|
||||
else \
|
||||
STRACE_PRINTF("%llu", \
|
||||
zero_extend_signed_to_ull((where_).field_)); \
|
||||
@ -183,6 +183,18 @@
|
||||
STRACE_PRINTF("%s%s=inet_addr(\"%s\")", (prefix_), #field_, \
|
||||
inet_ntoa((where_).field_))
|
||||
|
||||
#define PRINT_FIELD_AX25_ADDR(prefix_, where_, field_) \
|
||||
do { \
|
||||
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
|
||||
print_ax25_addr(&(where_).field_); \
|
||||
} while (0)
|
||||
|
||||
#define PRINT_FIELD_X25_ADDR(prefix_, where_, field_) \
|
||||
do { \
|
||||
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
|
||||
print_x25_addr(&(where_).field_); \
|
||||
} while (0)
|
||||
|
||||
#define PRINT_FIELD_NET_PORT(prefix_, where_, field_) \
|
||||
STRACE_PRINTF("%s%s=htons(%u)", (prefix_), #field_, \
|
||||
ntohs((where_).field_))
|
||||
|
@ -31,37 +31,53 @@
|
||||
#ifdef HAVE_IF_INDEXTONAME
|
||||
# include "xstring.h"
|
||||
|
||||
# define INI_PFX "if_nametoindex("
|
||||
# define INI_SFX ")"
|
||||
# define INI_PFX "if_nametoindex(\""
|
||||
# define INI_SFX "\")"
|
||||
# define IFNAME_QUOTED_SZ (sizeof(IFNAMSIZ) * 4 + 3)
|
||||
|
||||
static const char *
|
||||
const char *
|
||||
get_ifname(const unsigned int ifindex)
|
||||
{
|
||||
static char name_quoted_buf[IFNAME_QUOTED_SZ];
|
||||
char name_buf[IFNAMSIZ];
|
||||
|
||||
if (!if_indextoname(ifindex, name_buf))
|
||||
return NULL;
|
||||
|
||||
if (string_quote(name_buf, name_quoted_buf, sizeof(name_buf),
|
||||
QUOTE_0_TERMINATED | QUOTE_OMIT_LEADING_TRAILING_QUOTES,
|
||||
NULL))
|
||||
return NULL;
|
||||
|
||||
return name_quoted_buf;
|
||||
}
|
||||
|
||||
static const char *
|
||||
sprint_ifname(const unsigned int ifindex)
|
||||
{
|
||||
static char res[IFNAME_QUOTED_SZ + sizeof(INI_PFX INI_SFX)];
|
||||
|
||||
char name_buf[IFNAMSIZ];
|
||||
char name_quoted_buf[IFNAME_QUOTED_SZ];
|
||||
const char *name_quoted = get_ifname(ifindex);
|
||||
|
||||
if (if_indextoname(ifindex, name_buf)) {
|
||||
if (string_quote(name_buf, name_quoted_buf, sizeof(name_buf),
|
||||
QUOTE_0_TERMINATED, NULL))
|
||||
return NULL;
|
||||
if (!name_quoted)
|
||||
return NULL;
|
||||
|
||||
xsprintf(res, INI_PFX "%s" INI_SFX, name_quoted_buf);
|
||||
xsprintf(res, INI_PFX "%s" INI_SFX, name_quoted);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return res;
|
||||
}
|
||||
|
||||
#else /* !HAVE_IF_INDEXTONAME */
|
||||
|
||||
const char *get_ifname(const unsigned int ifindex) { return NULL; }
|
||||
|
||||
#endif /* HAVE_IF_INDEXTONAME */
|
||||
|
||||
void
|
||||
print_ifindex(const unsigned int ifindex)
|
||||
{
|
||||
#ifdef HAVE_IF_INDEXTONAME
|
||||
print_xlat_ex(ifindex, get_ifname(ifindex), XLAT_STYLE_FMT_U);
|
||||
print_xlat_ex(ifindex, sprint_ifname(ifindex), XLAT_STYLE_FMT_U);
|
||||
#else
|
||||
tprintf("%u", ifindex);
|
||||
#endif
|
||||
|
@ -57,10 +57,15 @@ print_timespec_t_utime(const timespec_t *t)
|
||||
{
|
||||
switch (t->tv_nsec) {
|
||||
case UTIME_NOW:
|
||||
tprints("UTIME_NOW");
|
||||
break;
|
||||
case UTIME_OMIT:
|
||||
tprints("UTIME_OMIT");
|
||||
if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
|
||||
print_timespec_t(t);
|
||||
if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
|
||||
break;
|
||||
|
||||
(xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE
|
||||
? tprints_comment : tprints)(t->tv_nsec == UTIME_NOW
|
||||
? "UTIME_NOW" : "UTIME_OMIT");
|
||||
break;
|
||||
default:
|
||||
print_timespec_t(t);
|
||||
|
26
process.c
26
process.c
@ -60,6 +60,7 @@ static const struct xlat struct_user_offsets[] = {
|
||||
static void
|
||||
print_user_offset_addr(const kernel_ulong_t addr)
|
||||
{
|
||||
bool no_str = false;
|
||||
const struct xlat *x;
|
||||
|
||||
for (x = struct_user_offsets; x->str; ++x) {
|
||||
@ -67,19 +68,26 @@ print_user_offset_addr(const kernel_ulong_t addr)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!x->str) {
|
||||
if (!x->str || (x == struct_user_offsets && x->val > addr))
|
||||
no_str = true;
|
||||
if (no_str || xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
|
||||
printaddr(addr);
|
||||
} else if (x->val > addr) {
|
||||
if (x == struct_user_offsets) {
|
||||
printaddr(addr);
|
||||
} else {
|
||||
--x;
|
||||
tprintf("%s + %" PRI_klu,
|
||||
x->str, addr - (kernel_ulong_t) x->val);
|
||||
}
|
||||
if (no_str || xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
|
||||
return;
|
||||
|
||||
if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
|
||||
tprints(" /* ");
|
||||
|
||||
if (x->val > addr) {
|
||||
--x;
|
||||
tprintf("%s + %" PRI_klu,
|
||||
x->str, addr - (kernel_ulong_t) x->val);
|
||||
} else {
|
||||
tprints(x->str);
|
||||
}
|
||||
|
||||
if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
|
||||
tprints(" */");
|
||||
}
|
||||
|
||||
SYS_FUNC(ptrace)
|
||||
|
48
rtnl_link.c
48
rtnl_link.c
@ -54,6 +54,7 @@
|
||||
#include "xlat/rtnl_ifla_info_data_tun_attrs.h"
|
||||
#include "xlat/rtnl_ifla_port_attrs.h"
|
||||
#include "xlat/rtnl_ifla_vf_port_attrs.h"
|
||||
#include "xlat/rtnl_ifla_xdp_attached_mode.h"
|
||||
#include "xlat/rtnl_ifla_xdp_attrs.h"
|
||||
#include "xlat/rtnl_link_attrs.h"
|
||||
#include "xlat/snmp_icmp6_stats.h"
|
||||
@ -170,7 +171,8 @@ static const nla_decoder_t ifla_brport_nla_decoders[] = {
|
||||
[IFLA_BRPORT_BCAST_FLOOD] = decode_nla_u8,
|
||||
[IFLA_BRPORT_GROUP_FWD_MASK] = decode_nla_u16,
|
||||
[IFLA_BRPORT_NEIGH_SUPPRESS] = decode_nla_u8,
|
||||
[IFLA_BRPORT_ISOLATED] = decode_nla_u8
|
||||
[IFLA_BRPORT_ISOLATED] = decode_nla_u8,
|
||||
[IFLA_BRPORT_BACKUP_PORT] = decode_nla_ifindex,
|
||||
};
|
||||
|
||||
static bool
|
||||
@ -574,11 +576,31 @@ decode_ifla_xdp_flags(struct tcb *const tcp,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
decode_ifla_xdp_attached(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
const struct decode_nla_xlat_opts opts = {
|
||||
.xlat = rtnl_ifla_xdp_attached_mode,
|
||||
.xlat_size = ARRAY_SIZE(rtnl_ifla_xdp_attached_mode),
|
||||
.xt = XT_INDEXED,
|
||||
.dflt = "XDP_ATTACHED_???",
|
||||
.size = 1,
|
||||
};
|
||||
|
||||
return decode_nla_xval(tcp, addr, len, &opts);
|
||||
}
|
||||
|
||||
static const nla_decoder_t ifla_xdp_nla_decoders[] = {
|
||||
[IFLA_XDP_FD] = decode_nla_fd,
|
||||
[IFLA_XDP_ATTACHED] = decode_nla_u8,
|
||||
[IFLA_XDP_ATTACHED] = decode_ifla_xdp_attached,
|
||||
[IFLA_XDP_FLAGS] = decode_ifla_xdp_flags,
|
||||
[IFLA_XDP_PROG_ID] = decode_nla_u32
|
||||
[IFLA_XDP_PROG_ID] = decode_nla_u32,
|
||||
[IFLA_XDP_DRV_PROG_ID] = decode_nla_u32,
|
||||
[IFLA_XDP_SKB_PROG_ID] = decode_nla_u32,
|
||||
[IFLA_XDP_HW_PROG_ID] = decode_nla_u32,
|
||||
};
|
||||
|
||||
static bool
|
||||
@ -739,22 +761,6 @@ decode_ifla_inet6_icmp6_stats(struct tcb *const tcp,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
decode_ifla_inet6_token(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
struct in6_addr in6;
|
||||
|
||||
if (len < sizeof(in6))
|
||||
return false;
|
||||
else if (!umove_or_printaddr(tcp, addr, &in6))
|
||||
print_inet_addr(AF_INET6, &in6, sizeof(in6), NULL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
decode_ifla_inet6_agm(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
@ -777,7 +783,7 @@ static const nla_decoder_t ifla_inet6_nla_decoders[] = {
|
||||
[IFLA_INET6_MCAST] = NULL, /* unused */
|
||||
[IFLA_INET6_CACHEINFO] = decode_ifla_inet6_cacheinfo,
|
||||
[IFLA_INET6_ICMP6STATS] = decode_ifla_inet6_icmp6_stats,
|
||||
[IFLA_INET6_TOKEN] = decode_ifla_inet6_token,
|
||||
[IFLA_INET6_TOKEN] = decode_nla_in6_addr,
|
||||
[IFLA_INET6_ADDR_GEN_MODE] = decode_ifla_inet6_agm,
|
||||
};
|
||||
|
||||
@ -881,6 +887,8 @@ static const nla_decoder_t ifinfomsg_nla_decoders[] = {
|
||||
[IFLA_CARRIER_UP_COUNT] = decode_nla_u32,
|
||||
[IFLA_CARRIER_DOWN_COUNT] = decode_nla_u32,
|
||||
[IFLA_NEW_IFINDEX] = decode_nla_ifindex,
|
||||
[IFLA_MIN_MTU] = decode_nla_u32,
|
||||
[IFLA_MAX_MTU] = decode_nla_u32,
|
||||
};
|
||||
|
||||
DECL_NETLINK_ROUTE_DECODER(decode_ifinfomsg)
|
||||
|
@ -47,7 +47,8 @@ static const nla_decoder_t netconfmsg_nla_decoders[] = {
|
||||
[NETCONFA_MC_FORWARDING] = decode_nla_s32,
|
||||
[NETCONFA_PROXY_NEIGH] = decode_nla_s32,
|
||||
[NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN] = decode_nla_s32,
|
||||
[NETCONFA_INPUT] = decode_nla_s32
|
||||
[NETCONFA_INPUT] = decode_nla_s32,
|
||||
[NETCONFA_BC_FORWARDING] = decode_nla_s32,
|
||||
};
|
||||
|
||||
DECL_NETLINK_ROUTE_DECODER(decode_netconfmsg)
|
||||
|
4
sock.c
4
sock.c
@ -57,6 +57,8 @@ print_ifname(const char *ifname)
|
||||
print_quoted_string(ifname, IFNAMSIZ + 1, QUOTE_0_TERMINATED);
|
||||
}
|
||||
|
||||
DIAG_PUSH_IGNORE_OVERRIDE_INIT
|
||||
|
||||
static void
|
||||
print_ifreq(struct tcb *const tcp, const unsigned int code,
|
||||
const kernel_ulong_t arg, const struct_ifreq *const ifr)
|
||||
@ -202,6 +204,8 @@ print_ifreq(struct tcb *const tcp, const unsigned int code,
|
||||
}
|
||||
}
|
||||
|
||||
DIAG_POP_IGNORE_OVERRIDE_INIT
|
||||
|
||||
static unsigned int
|
||||
print_ifc_len(int len)
|
||||
{
|
||||
|
259
sockaddr.c
259
sockaddr.c
@ -39,9 +39,11 @@
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "netlink.h"
|
||||
#include <linux/ax25.h>
|
||||
#include <linux/if_packet.h>
|
||||
#include <linux/if_arp.h>
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/x25.h>
|
||||
|
||||
#ifdef HAVE_NETIPX_IPX_H
|
||||
# include <netipx/ipx.h>
|
||||
@ -189,6 +191,164 @@ print_sockaddr_data_in6(const void *const buf, const int addrlen)
|
||||
PRINT_FIELD_U(", ", *sa_in6, sin6_scope_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that we can print an AX.25 address in its native form, otherwise it
|
||||
* makes sense to print it in raw also (or in raw only).
|
||||
*/
|
||||
enum xlat_style
|
||||
check_ax25_address(const ax25_address *addr)
|
||||
{
|
||||
enum xlat_style ret = XLAT_STYLE_DEFAULT;
|
||||
bool space_seen = false;
|
||||
bool char_seen = false;
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(addr->ax25_call) - 1; i++) {
|
||||
unsigned char c = addr->ax25_call[i];
|
||||
|
||||
/* The lowest bit should be zero */
|
||||
if (c & 1)
|
||||
ret = XLAT_STYLE_VERBOSE;
|
||||
|
||||
c >>= 1;
|
||||
|
||||
if (c == ' ')
|
||||
space_seen = true;
|
||||
else
|
||||
char_seen = true;
|
||||
|
||||
/* Sane address contains only numbers and uppercase letters */
|
||||
if ((c < '0' || c > '9') && (c < 'A' || c > 'Z') && c != ' ')
|
||||
ret = XLAT_STYLE_VERBOSE;
|
||||
if (c != ' ' && space_seen)
|
||||
ret = XLAT_STYLE_VERBOSE;
|
||||
|
||||
/* non-printable chars */
|
||||
if (c < ' ' || c > 0x7e
|
||||
/* characters used for printing comments */
|
||||
|| c == '*' || c == '/')
|
||||
return XLAT_STYLE_RAW;
|
||||
}
|
||||
|
||||
if (addr->ax25_call[ARRAY_SIZE(addr->ax25_call) - 1] & ~0x1e)
|
||||
ret = XLAT_STYLE_VERBOSE;
|
||||
|
||||
if (!char_seen && addr->ax25_call[ARRAY_SIZE(addr->ax25_call) - 1])
|
||||
ret = XLAT_STYLE_VERBOSE;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/** Convert a (presumably) valid AX.25 to a string */
|
||||
static const char *
|
||||
ax25_addr2str(const ax25_address *addr)
|
||||
{
|
||||
static char buf[ARRAY_SIZE(addr->ax25_call) + sizeof("-15")];
|
||||
char *p = buf;
|
||||
size_t end;
|
||||
|
||||
for (end = ARRAY_SIZE(addr->ax25_call) - 1; end; end--)
|
||||
if ((addr->ax25_call[end - 1] >> 1) != ' ')
|
||||
break;
|
||||
|
||||
for (size_t i = 0; i < end; i++)
|
||||
*p++ = ((unsigned char) addr->ax25_call[i]) >> 1;
|
||||
|
||||
*p++ = '-';
|
||||
|
||||
unsigned char ssid = (addr->ax25_call[ARRAY_SIZE(addr->ax25_call) - 1]
|
||||
>> 1) & 0xf;
|
||||
|
||||
if (ssid > 9) {
|
||||
*p++ = '1';
|
||||
ssid -= 10;
|
||||
}
|
||||
|
||||
*p++ = ssid + '0';
|
||||
*p = '\0';
|
||||
|
||||
if (buf[0] == '-' && buf[1] == '0')
|
||||
return "*";
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
static void
|
||||
print_ax25_addr_raw(const ax25_address *addr)
|
||||
{
|
||||
PRINT_FIELD_HEX_ARRAY("{", *addr, ax25_call);
|
||||
tprints("}");
|
||||
}
|
||||
|
||||
void
|
||||
print_ax25_addr(const void /* ax25_address */ *addr_void)
|
||||
{
|
||||
const ax25_address *addr = addr_void;
|
||||
enum xlat_style xs = check_ax25_address(addr);
|
||||
|
||||
if (xs == XLAT_STYLE_DEFAULT)
|
||||
xs = xlat_verbose(xlat_verbosity);
|
||||
|
||||
if (xs != XLAT_STYLE_ABBREV)
|
||||
print_ax25_addr_raw(addr);
|
||||
|
||||
if (xs == XLAT_STYLE_RAW)
|
||||
return;
|
||||
|
||||
const char *addr_str = ax25_addr2str(addr);
|
||||
|
||||
(xs == XLAT_STYLE_VERBOSE ? tprints_comment : tprints)(addr_str);
|
||||
}
|
||||
|
||||
static void
|
||||
print_sockaddr_data_ax25(const void *const buf, const int addrlen)
|
||||
{
|
||||
const struct full_sockaddr_ax25 *const sax25 = buf;
|
||||
size_t addrlen_us = MAX(addrlen, 0);
|
||||
bool full = sax25->fsa_ax25.sax25_ndigis ||
|
||||
(addrlen_us > sizeof(struct sockaddr_ax25));
|
||||
|
||||
if (full)
|
||||
tprints("fsa_ax25={");
|
||||
|
||||
tprints("sax25_call=");
|
||||
print_ax25_addr(&sax25->fsa_ax25.sax25_call);
|
||||
PRINT_FIELD_D(", ", sax25->fsa_ax25, sax25_ndigis);
|
||||
|
||||
if (!full)
|
||||
return;
|
||||
|
||||
tprints("}");
|
||||
|
||||
size_t has_digis = MIN((addrlen_us - sizeof(sax25->fsa_ax25))
|
||||
/ sizeof(sax25->fsa_digipeater[0]),
|
||||
ARRAY_SIZE(sax25->fsa_digipeater));
|
||||
size_t want_digis = MIN(
|
||||
(unsigned int) MAX(sax25->fsa_ax25.sax25_ndigis, 0),
|
||||
ARRAY_SIZE(sax25->fsa_digipeater));
|
||||
size_t digis = MIN(has_digis, want_digis);
|
||||
|
||||
if (want_digis == 0)
|
||||
goto digis_end;
|
||||
|
||||
tprints(", fsa_digipeater=[");
|
||||
for (size_t i = 0; i < digis; i++) {
|
||||
if (i)
|
||||
tprints(", ");
|
||||
|
||||
print_ax25_addr(sax25->fsa_digipeater + i);
|
||||
}
|
||||
|
||||
if (want_digis > has_digis)
|
||||
tprintf("%s/* ??? */", digis ? ", " : "");
|
||||
|
||||
tprints("]");
|
||||
|
||||
digis_end:
|
||||
if (addrlen_us > (has_digis * sizeof(sax25->fsa_digipeater[0])
|
||||
+ sizeof(sax25->fsa_ax25)))
|
||||
tprints(", ...");
|
||||
}
|
||||
|
||||
static void
|
||||
print_sockaddr_data_ipx(const void *const buf, const int addrlen)
|
||||
{
|
||||
@ -206,6 +366,24 @@ print_sockaddr_data_ipx(const void *const buf, const int addrlen)
|
||||
PRINT_FIELD_0X("], ", *sa_ipx, sipx_type);
|
||||
}
|
||||
|
||||
void
|
||||
print_x25_addr(const void /* struct x25_address */ *addr_void)
|
||||
{
|
||||
const struct x25_address *addr = addr_void;
|
||||
|
||||
tprints("{x25_addr=");
|
||||
print_quoted_cstring(addr->x25_addr, sizeof(addr->x25_addr));
|
||||
tprints("}");
|
||||
}
|
||||
|
||||
static void
|
||||
print_sockaddr_data_x25(const void *const buf, const int addrlen)
|
||||
{
|
||||
const struct sockaddr_x25 *const sa_x25 = buf;
|
||||
|
||||
PRINT_FIELD_X25_ADDR("", *sa_x25, sx25_addr);
|
||||
}
|
||||
|
||||
static void
|
||||
print_sockaddr_data_nl(const void *const buf, const int addrlen)
|
||||
{
|
||||
@ -368,54 +546,53 @@ print_sockaddr_data_bt(const void *const buf, const int addrlen)
|
||||
|
||||
struct sockaddr_l2 {
|
||||
/* sa_family_t */ uint16_t l2_family;
|
||||
/* little endiang */ uint16_t l2_psm;
|
||||
/* little endian */ uint16_t l2_psm;
|
||||
struct bdaddr l2_bdaddr;
|
||||
/* little endian */ uint16_t l2_cid;
|
||||
uint8_t l2_bdaddr_type;
|
||||
};
|
||||
|
||||
switch (addrlen) {
|
||||
case sizeof(struct sockaddr_hci): {
|
||||
const struct sockaddr_hci *const hci = buf;
|
||||
tprintf("hci_dev=htobs(%hu), hci_channel=",
|
||||
btohs(hci->hci_dev));
|
||||
printxval_index(hci_channels, hci->hci_channel,
|
||||
"HCI_CHANNEL_???");
|
||||
break;
|
||||
}
|
||||
case sizeof(struct sockaddr_sco): {
|
||||
const struct sockaddr_sco *const sco = buf;
|
||||
print_mac_addr("sco_bdaddr=", sco->sco_bdaddr.b,
|
||||
sizeof(sco->sco_bdaddr.b));
|
||||
break;
|
||||
}
|
||||
case sizeof(struct sockaddr_rc): {
|
||||
const struct sockaddr_rc *const rc = buf;
|
||||
print_mac_addr("rc_bdaddr=", rc->rc_bdaddr.b,
|
||||
sizeof(rc->rc_bdaddr.b));
|
||||
tprintf(", rc_channel=%u", rc->rc_channel);
|
||||
break;
|
||||
}
|
||||
case offsetof(struct sockaddr_l2, l2_bdaddr_type):
|
||||
case sizeof(struct sockaddr_l2): {
|
||||
const struct sockaddr_l2 *const l2 = buf;
|
||||
print_bluetooth_l2_psm("l2_psm=", l2->l2_psm);
|
||||
print_mac_addr(", l2_bdaddr=", l2->l2_bdaddr.b,
|
||||
sizeof(l2->l2_bdaddr.b));
|
||||
print_bluetooth_l2_cid(", l2_cid=", l2->l2_cid);
|
||||
case sizeof(struct sockaddr_hci): {
|
||||
const struct sockaddr_hci *const hci = buf;
|
||||
tprintf("hci_dev=htobs(%hu), hci_channel=",
|
||||
btohs(hci->hci_dev));
|
||||
printxval_index(hci_channels, hci->hci_channel,
|
||||
"HCI_CHANNEL_???");
|
||||
break;
|
||||
}
|
||||
case sizeof(struct sockaddr_sco): {
|
||||
const struct sockaddr_sco *const sco = buf;
|
||||
print_mac_addr("sco_bdaddr=", sco->sco_bdaddr.b,
|
||||
sizeof(sco->sco_bdaddr.b));
|
||||
break;
|
||||
}
|
||||
case sizeof(struct sockaddr_rc): {
|
||||
const struct sockaddr_rc *const rc = buf;
|
||||
print_mac_addr("rc_bdaddr=", rc->rc_bdaddr.b,
|
||||
sizeof(rc->rc_bdaddr.b));
|
||||
tprintf(", rc_channel=%u", rc->rc_channel);
|
||||
break;
|
||||
}
|
||||
case offsetof(struct sockaddr_l2, l2_bdaddr_type):
|
||||
case sizeof(struct sockaddr_l2): {
|
||||
const struct sockaddr_l2 *const l2 = buf;
|
||||
print_bluetooth_l2_psm("l2_psm=", l2->l2_psm);
|
||||
print_mac_addr(", l2_bdaddr=", l2->l2_bdaddr.b,
|
||||
sizeof(l2->l2_bdaddr.b));
|
||||
print_bluetooth_l2_cid(", l2_cid=", l2->l2_cid);
|
||||
|
||||
if (addrlen == sizeof(struct sockaddr_l2)) {
|
||||
tprints(", l2_bdaddr_type=");
|
||||
printxval_index(bdaddr_types,
|
||||
l2->l2_bdaddr_type,
|
||||
"BDADDR_???");
|
||||
}
|
||||
|
||||
break;
|
||||
if (addrlen == sizeof(struct sockaddr_l2)) {
|
||||
tprints(", l2_bdaddr_type=");
|
||||
printxval_index(bdaddr_types, l2->l2_bdaddr_type,
|
||||
"BDADDR_???");
|
||||
}
|
||||
default:
|
||||
print_sockaddr_data_raw(buf, addrlen);
|
||||
break;
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
print_sockaddr_data_raw(buf, addrlen);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -427,7 +604,9 @@ static const struct {
|
||||
} sa_printers[] = {
|
||||
[AF_UNIX] = { print_sockaddr_data_un, SIZEOF_SA_FAMILY + 1 },
|
||||
[AF_INET] = { print_sockaddr_data_in, sizeof(struct sockaddr_in) },
|
||||
[AF_AX25] = { print_sockaddr_data_ax25, sizeof(struct sockaddr_ax25) },
|
||||
[AF_IPX] = { print_sockaddr_data_ipx, sizeof(struct sockaddr_ipx) },
|
||||
[AF_X25] = { print_sockaddr_data_x25, sizeof(struct sockaddr_x25) },
|
||||
[AF_INET6] = { print_sockaddr_data_in6, SIN6_MIN_LEN },
|
||||
[AF_NETLINK] = { print_sockaddr_data_nl, SIZEOF_SA_FAMILY + 1 },
|
||||
[AF_PACKET] = { print_sockaddr_data_ll, sizeof(struct sockaddr_ll) },
|
||||
|
113
socketutils.c
113
socketutils.c
@ -48,6 +48,10 @@
|
||||
|
||||
#include "xstring.h"
|
||||
|
||||
#define XLAT_MACROS_ONLY
|
||||
# include "xlat/inet_protocols.h"
|
||||
#undef XLAT_MACROS_ONLY
|
||||
|
||||
typedef struct {
|
||||
unsigned long inode;
|
||||
char *details;
|
||||
@ -233,9 +237,9 @@ receive_responses(struct tcb *tcp, const int fd, const unsigned long inode,
|
||||
}
|
||||
|
||||
const struct nlmsghdr *h = &hdr_buf.hdr;
|
||||
if (!NLMSG_OK(h, ret))
|
||||
if (!is_nlmsg_ok(h, ret))
|
||||
return false;
|
||||
for (; NLMSG_OK(h, ret); h = NLMSG_NEXT(h, ret)) {
|
||||
for (; is_nlmsg_ok(h, ret); h = NLMSG_NEXT(h, ret)) {
|
||||
if (h->nlmsg_type != expected_msg_type)
|
||||
return false;
|
||||
const int rc = parser(NLMSG_DATA(h),
|
||||
@ -412,11 +416,12 @@ netlink_parse_response(const void *data, const int data_len,
|
||||
}
|
||||
|
||||
static const char *
|
||||
unix_get(struct tcb *tcp, const int fd, const unsigned long inode)
|
||||
unix_get(struct tcb *tcp, const int fd, const int family, const int proto,
|
||||
const unsigned long inode, const char *name)
|
||||
{
|
||||
return unix_send_query(tcp, fd, inode)
|
||||
&& receive_responses(tcp, fd, inode, SOCK_DIAG_BY_FAMILY,
|
||||
unix_parse_response, (void *) "UNIX")
|
||||
unix_parse_response, (void *) name)
|
||||
? get_sockaddr_by_inode_cached(inode) : NULL;
|
||||
}
|
||||
|
||||
@ -431,48 +436,63 @@ inet_get(struct tcb *tcp, const int fd, const int family, const int protocol,
|
||||
}
|
||||
|
||||
static const char *
|
||||
tcp_v4_get(struct tcb *tcp, const int fd, const unsigned long inode)
|
||||
{
|
||||
return inet_get(tcp, fd, AF_INET, IPPROTO_TCP, inode, "TCP");
|
||||
}
|
||||
|
||||
static const char *
|
||||
udp_v4_get(struct tcb *tcp, const int fd, const unsigned long inode)
|
||||
{
|
||||
return inet_get(tcp, fd, AF_INET, IPPROTO_UDP, inode, "UDP");
|
||||
}
|
||||
|
||||
static const char *
|
||||
tcp_v6_get(struct tcb *tcp, const int fd, const unsigned long inode)
|
||||
{
|
||||
return inet_get(tcp, fd, AF_INET6, IPPROTO_TCP, inode, "TCPv6");
|
||||
}
|
||||
|
||||
static const char *
|
||||
udp_v6_get(struct tcb *tcp, const int fd, const unsigned long inode)
|
||||
{
|
||||
return inet_get(tcp, fd, AF_INET6, IPPROTO_UDP, inode, "UDPv6");
|
||||
}
|
||||
|
||||
static const char *
|
||||
netlink_get(struct tcb *tcp, const int fd, const unsigned long inode)
|
||||
netlink_get(struct tcb *tcp, const int fd, const int family, const int protocol,
|
||||
const unsigned long inode, const char *proto_name)
|
||||
{
|
||||
return netlink_send_query(tcp, fd, inode)
|
||||
&& receive_responses(tcp, fd, inode, SOCK_DIAG_BY_FAMILY,
|
||||
netlink_parse_response, (void *) "NETLINK")
|
||||
netlink_parse_response,
|
||||
(void *) proto_name)
|
||||
? get_sockaddr_by_inode_cached(inode) : NULL;
|
||||
}
|
||||
|
||||
static const struct {
|
||||
const char *const name;
|
||||
const char * (*const get)(struct tcb *, int, unsigned long);
|
||||
const char * (*const get)(struct tcb *, int fd, int family,
|
||||
int protocol, unsigned long inode,
|
||||
const char *proto_name);
|
||||
int family;
|
||||
int proto;
|
||||
} protocols[] = {
|
||||
[SOCK_PROTO_UNIX] = { "UNIX", unix_get },
|
||||
[SOCK_PROTO_TCP] = { "TCP", tcp_v4_get },
|
||||
[SOCK_PROTO_UDP] = { "UDP", udp_v4_get },
|
||||
[SOCK_PROTO_TCPv6] = { "TCPv6", tcp_v6_get },
|
||||
[SOCK_PROTO_UDPv6] = { "UDPv6", udp_v6_get },
|
||||
[SOCK_PROTO_NETLINK] = { "NETLINK", netlink_get }
|
||||
[SOCK_PROTO_UNIX] = { "UNIX", unix_get, AF_UNIX},
|
||||
/*
|
||||
* inet_diag handlers are currently implemented only for TCP,
|
||||
* UDP(lite), SCTP, RAW, and DCCP, but we try to resolve it for all
|
||||
* protocols anyway, just in case.
|
||||
*/
|
||||
[SOCK_PROTO_TCP] =
|
||||
{ "TCP", inet_get, AF_INET, IPPROTO_TCP },
|
||||
[SOCK_PROTO_UDP] =
|
||||
{ "UDP", inet_get, AF_INET, IPPROTO_UDP },
|
||||
[SOCK_PROTO_UDPLITE] =
|
||||
{ "UDPLITE", inet_get, AF_INET, IPPROTO_UDPLITE },
|
||||
[SOCK_PROTO_DCCP] =
|
||||
{ "DCCP", inet_get, AF_INET, IPPROTO_DCCP },
|
||||
[SOCK_PROTO_SCTP] =
|
||||
{ "SCTP", inet_get, AF_INET, IPPROTO_SCTP },
|
||||
[SOCK_PROTO_L2TP_IP] =
|
||||
{ "L2TP/IP", inet_get, AF_INET, IPPROTO_L2TP },
|
||||
[SOCK_PROTO_PING] =
|
||||
{ "PING", inet_get, AF_INET, IPPROTO_ICMP },
|
||||
[SOCK_PROTO_RAW] =
|
||||
{ "RAW", inet_get, AF_INET, IPPROTO_RAW },
|
||||
[SOCK_PROTO_TCPv6] =
|
||||
{ "TCPv6", inet_get, AF_INET6, IPPROTO_TCP },
|
||||
[SOCK_PROTO_UDPv6] =
|
||||
{ "UDPv6", inet_get, AF_INET6, IPPROTO_UDP },
|
||||
[SOCK_PROTO_UDPLITEv6] =
|
||||
{ "UDPLITEv6", inet_get, AF_INET6, IPPROTO_UDPLITE },
|
||||
[SOCK_PROTO_DCCPv6] =
|
||||
{ "DCCPv6", inet_get, AF_INET6, IPPROTO_DCCP },
|
||||
[SOCK_PROTO_SCTPv6] =
|
||||
{ "SCTPv6", inet_get, AF_INET6, IPPROTO_SCTP },
|
||||
[SOCK_PROTO_L2TP_IPv6] =
|
||||
{ "L2TP/IPv6", inet_get, AF_INET6, IPPROTO_L2TP },
|
||||
[SOCK_PROTO_PINGv6] =
|
||||
{ "PINGv6", inet_get, AF_INET6, IPPROTO_ICMP },
|
||||
[SOCK_PROTO_RAWv6] =
|
||||
{ "RAWv6", inet_get, AF_INET6, IPPROTO_RAW },
|
||||
[SOCK_PROTO_NETLINK] = { "NETLINK", netlink_get, AF_NETLINK },
|
||||
};
|
||||
|
||||
enum sock_proto
|
||||
@ -487,6 +507,15 @@ get_proto_by_name(const char *const name)
|
||||
return SOCK_PROTO_UNKNOWN;
|
||||
}
|
||||
|
||||
int
|
||||
get_family_by_proto(enum sock_proto proto)
|
||||
{
|
||||
if ((size_t) proto < ARRAY_SIZE(protocols))
|
||||
return protocols[proto].family;
|
||||
|
||||
return AF_UNSPEC;
|
||||
}
|
||||
|
||||
static const char *
|
||||
get_sockaddr_by_inode_uncached(struct tcb *tcp, const unsigned long inode,
|
||||
const enum sock_proto proto)
|
||||
@ -501,14 +530,20 @@ get_sockaddr_by_inode_uncached(struct tcb *tcp, const unsigned long inode,
|
||||
const char *details = NULL;
|
||||
|
||||
if (proto != SOCK_PROTO_UNKNOWN) {
|
||||
details = protocols[proto].get(tcp, fd, inode);
|
||||
details = protocols[proto].get(tcp, fd, protocols[proto].family,
|
||||
protocols[proto].proto, inode,
|
||||
protocols[proto].name);
|
||||
} else {
|
||||
unsigned int i;
|
||||
for (i = (unsigned int) SOCK_PROTO_UNKNOWN + 1;
|
||||
i < ARRAY_SIZE(protocols); ++i) {
|
||||
if (!protocols[i].get)
|
||||
continue;
|
||||
details = protocols[i].get(tcp, fd, inode);
|
||||
details = protocols[i].get(tcp, fd,
|
||||
protocols[proto].family,
|
||||
protocols[proto].proto,
|
||||
inode,
|
||||
protocols[proto].name);
|
||||
if (details)
|
||||
break;
|
||||
}
|
||||
|
153
strace.c
153
strace.c
@ -51,7 +51,6 @@
|
||||
#endif
|
||||
#include <asm/unistd.h>
|
||||
|
||||
#include "filter_seccomp.h"
|
||||
#include "largefile_wrappers.h"
|
||||
#include "mmap_cache.h"
|
||||
#include "number_set.h"
|
||||
@ -159,6 +158,12 @@ static bool open_append;
|
||||
struct tcb *printing_tcp;
|
||||
static struct tcb *current_tcp;
|
||||
|
||||
struct tcb_wait_data {
|
||||
enum trace_event te; /**< Event passed to dispatch_event() */
|
||||
int status; /**< status, returned by wait4() */
|
||||
siginfo_t si; /**< siginfo, returned by PTRACE_GETSIGINFO */
|
||||
};
|
||||
|
||||
static struct tcb **tcbtab;
|
||||
static unsigned int nprocs;
|
||||
static size_t tcbtabsize;
|
||||
@ -303,8 +308,6 @@ Startup:\n\
|
||||
\n\
|
||||
Miscellaneous:\n\
|
||||
-d enable debug output to stderr\n\
|
||||
-n enable enable seccomp filtering\n\
|
||||
disable disable seccomp filtering\n\
|
||||
-v verbose mode: print unabbreviated argv, stat, termios, etc. args\n\
|
||||
-h print help message\n\
|
||||
-V print version\n\
|
||||
@ -1225,8 +1228,6 @@ exec_or_die(void)
|
||||
if (params_for_tracee.child_sa.sa_handler != SIG_DFL)
|
||||
sigaction(SIGCHLD, ¶ms_for_tracee.child_sa, NULL);
|
||||
|
||||
if (enable_seccomp_filter)
|
||||
init_seccomp_filter();
|
||||
execv(params->pathname, params->argv);
|
||||
perror_msg_and_die("exec");
|
||||
}
|
||||
@ -1607,7 +1608,7 @@ init(int argc, char *argv[])
|
||||
#ifdef ENABLE_STACKTRACE
|
||||
"k"
|
||||
#endif
|
||||
"a:Ab:cCdDe:E:fFhiI:no:O:p:P:qrs:S:tTu:vVwxX:yz")) != EOF) {
|
||||
"a:Ab:cCdDe:E:fFhiI:o:O:p:P:qrs:S:tTu:vVwxX:yz")) != EOF) {
|
||||
switch (c) {
|
||||
case 'a':
|
||||
acolumn = string_to_uint(optarg);
|
||||
@ -1709,9 +1710,6 @@ init(int argc, char *argv[])
|
||||
case 'u':
|
||||
username = optarg;
|
||||
break;
|
||||
case 'n':
|
||||
enable_seccomp_filter = true;
|
||||
break;
|
||||
case 'v':
|
||||
qualify("abbrev=none");
|
||||
break;
|
||||
@ -1822,12 +1820,7 @@ init(int argc, char *argv[])
|
||||
run_gid = getgid();
|
||||
}
|
||||
|
||||
if (enable_seccomp_filter) {
|
||||
check_seccomp_filter();
|
||||
ptrace_setoptions |= PTRACE_O_TRACESECCOMP;
|
||||
}
|
||||
|
||||
if (followfork || enable_seccomp_filter)
|
||||
if (followfork)
|
||||
ptrace_setoptions |= PTRACE_O_TRACECLONE |
|
||||
PTRACE_O_TRACEFORK |
|
||||
PTRACE_O_TRACEVFORK;
|
||||
@ -2175,6 +2168,11 @@ print_stopped(struct tcb *tcp, const siginfo_t *si, const unsigned int sig)
|
||||
} else
|
||||
tprintf("--- stopped by %s ---\n", signame(sig));
|
||||
line_ended();
|
||||
|
||||
#ifdef ENABLE_STACKTRACE
|
||||
if (stack_trace_enabled)
|
||||
unwind_tcb_print(tcp);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -2239,16 +2237,19 @@ print_event_exit(struct tcb *tcp)
|
||||
line_ended();
|
||||
}
|
||||
|
||||
static enum trace_event
|
||||
next_event(int *pstatus, siginfo_t *si)
|
||||
static const struct tcb_wait_data *
|
||||
next_event(void)
|
||||
{
|
||||
static struct tcb_wait_data wait_data;
|
||||
|
||||
int pid;
|
||||
int status;
|
||||
struct tcb *tcp;
|
||||
struct tcb_wait_data *wd = &wait_data;
|
||||
struct rusage ru;
|
||||
|
||||
if (interrupted)
|
||||
return TE_BREAK;
|
||||
return NULL;
|
||||
|
||||
/*
|
||||
* Used to exit simply when nprocs hits zero, but in this testcase:
|
||||
@ -2268,7 +2269,7 @@ next_event(int *pstatus, siginfo_t *si)
|
||||
* on exit. Oh well...
|
||||
*/
|
||||
if (nprocs == 0)
|
||||
return TE_BREAK;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const bool unblock_delay_timer = is_delay_timer_armed();
|
||||
@ -2291,7 +2292,7 @@ next_event(int *pstatus, siginfo_t *si)
|
||||
* then the system call will be interrupted and
|
||||
* the expiration will be handled by the signal handler.
|
||||
*/
|
||||
pid = wait4(-1, pstatus, __WALL, (cflag ? &ru : NULL));
|
||||
pid = wait4(-1, &status, __WALL, (cflag ? &ru : NULL));
|
||||
const int wait_errno = errno;
|
||||
|
||||
/*
|
||||
@ -2305,14 +2306,16 @@ next_event(int *pstatus, siginfo_t *si)
|
||||
sigprocmask(SIG_BLOCK, &timer_set, NULL);
|
||||
|
||||
if (restart_failed)
|
||||
return TE_BREAK;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (pid < 0) {
|
||||
if (wait_errno == EINTR)
|
||||
return TE_NEXT;
|
||||
if (wait_errno == EINTR) {
|
||||
wd->te = TE_NEXT;
|
||||
return wd;
|
||||
}
|
||||
if (nprocs == 0 && wait_errno == ECHILD)
|
||||
return TE_BREAK;
|
||||
return NULL;
|
||||
/*
|
||||
* If nprocs > 0, ECHILD is not expected,
|
||||
* treat it as any other error here:
|
||||
@ -2321,17 +2324,13 @@ next_event(int *pstatus, siginfo_t *si)
|
||||
perror_msg_and_die("wait4(__WALL)");
|
||||
}
|
||||
|
||||
status = *pstatus;
|
||||
wd->status = status;
|
||||
|
||||
if (pid == popen_pid) {
|
||||
if (!WIFSTOPPED(status))
|
||||
popen_pid = 0;
|
||||
return TE_NEXT;
|
||||
}
|
||||
|
||||
if (!followfork && enable_seccomp_filter && pid != strace_child) {
|
||||
ptrace(PTRACE_CONT, pid, 0, WSTOPSIG(*pstatus));
|
||||
return TE_NEXT;
|
||||
wd->te = TE_NEXT;
|
||||
return wd;
|
||||
}
|
||||
|
||||
if (debug_flag)
|
||||
@ -2342,8 +2341,10 @@ next_event(int *pstatus, siginfo_t *si)
|
||||
|
||||
if (!tcp) {
|
||||
tcp = maybe_allocate_tcb(pid, status);
|
||||
if (!tcp)
|
||||
return TE_NEXT;
|
||||
if (!tcp) {
|
||||
wd->te = TE_NEXT;
|
||||
return wd;
|
||||
}
|
||||
}
|
||||
|
||||
clear_regs(tcp);
|
||||
@ -2360,11 +2361,15 @@ next_event(int *pstatus, siginfo_t *si)
|
||||
tcp->stime = stime;
|
||||
}
|
||||
|
||||
if (WIFSIGNALED(status))
|
||||
return TE_SIGNALLED;
|
||||
if (WIFSIGNALED(status)) {
|
||||
wd->te = TE_SIGNALLED;
|
||||
return wd;
|
||||
}
|
||||
|
||||
if (WIFEXITED(status))
|
||||
return TE_EXITED;
|
||||
if (WIFEXITED(status)) {
|
||||
wd->te = TE_EXITED;
|
||||
return wd;
|
||||
}
|
||||
|
||||
/*
|
||||
* As WCONTINUED flag has not been specified to wait4,
|
||||
@ -2391,19 +2396,19 @@ next_event(int *pstatus, siginfo_t *si)
|
||||
if (sig == SIGSTOP && (tcp->flags & TCB_IGNORE_ONE_SIGSTOP)) {
|
||||
debug_func_msg("ignored SIGSTOP on pid %d", tcp->pid);
|
||||
tcp->flags &= ~TCB_IGNORE_ONE_SIGSTOP;
|
||||
return TE_RESTART;
|
||||
wd->te = TE_RESTART;
|
||||
} else if (sig == syscall_trap_sig) {
|
||||
return TE_SYSCALL_STOP;
|
||||
wd->te = TE_SYSCALL_STOP;
|
||||
} else {
|
||||
*si = (siginfo_t) {};
|
||||
memset(&wd->si, 0, sizeof(wd->si));
|
||||
/*
|
||||
* True if tracee is stopped by signal
|
||||
* (as opposed to "tracee received signal").
|
||||
* TODO: shouldn't we check for errno == EINVAL too?
|
||||
* We can get ESRCH instead, you know...
|
||||
*/
|
||||
bool stopped = ptrace(PTRACE_GETSIGINFO, pid, 0, si) < 0;
|
||||
return stopped ? TE_GROUP_STOP : TE_SIGNAL_DELIVERY_STOP;
|
||||
bool stopped = ptrace(PTRACE_GETSIGINFO, pid, 0, &wd->si) < 0;
|
||||
wd->te = stopped ? TE_GROUP_STOP : TE_SIGNAL_DELIVERY_STOP;
|
||||
}
|
||||
break;
|
||||
case PTRACE_EVENT_STOP:
|
||||
@ -2416,18 +2421,23 @@ next_event(int *pstatus, siginfo_t *si)
|
||||
case SIGTSTP:
|
||||
case SIGTTIN:
|
||||
case SIGTTOU:
|
||||
return TE_GROUP_STOP;
|
||||
wd->te = TE_GROUP_STOP;
|
||||
break;
|
||||
default:
|
||||
wd->te = TE_RESTART;
|
||||
}
|
||||
return TE_RESTART;
|
||||
break;
|
||||
case PTRACE_EVENT_EXEC:
|
||||
return TE_STOP_BEFORE_EXECVE;
|
||||
wd->te = TE_STOP_BEFORE_EXECVE;
|
||||
break;
|
||||
case PTRACE_EVENT_EXIT:
|
||||
return TE_STOP_BEFORE_EXIT;
|
||||
case PTRACE_EVENT_SECCOMP:
|
||||
return TE_SECCOMP;
|
||||
wd->te = TE_STOP_BEFORE_EXIT;
|
||||
break;
|
||||
default:
|
||||
return TE_RESTART;
|
||||
wd->te = TE_RESTART;
|
||||
}
|
||||
|
||||
return wd;
|
||||
}
|
||||
|
||||
static int
|
||||
@ -2456,17 +2466,18 @@ trace_syscall(struct tcb *tcp, unsigned int *sig)
|
||||
|
||||
/* Returns true iff the main trace loop has to continue. */
|
||||
static bool
|
||||
dispatch_event(enum trace_event ret, int *pstatus, siginfo_t *si)
|
||||
dispatch_event(const struct tcb_wait_data *wd)
|
||||
{
|
||||
unsigned int restart_op = PTRACE_SYSCALL;
|
||||
unsigned int restart_sig = 0;
|
||||
unsigned int restart_op;
|
||||
enum trace_event te = wd ? wd->te : TE_BREAK;
|
||||
/*
|
||||
* Copy wd->status to a non-const variable to workaround glibc bugs
|
||||
* around union wait fixed by glibc commit glibc-2.24~391
|
||||
*/
|
||||
int status = wd ? wd->status : 0;
|
||||
|
||||
if (enable_seccomp_filter)
|
||||
restart_op = seccomp_filter_restart_operator(current_tcp);
|
||||
else
|
||||
restart_op = PTRACE_SYSCALL;
|
||||
|
||||
switch (ret) {
|
||||
switch (te) {
|
||||
case TE_BREAK:
|
||||
return false;
|
||||
|
||||
@ -2476,13 +2487,6 @@ dispatch_event(enum trace_event ret, int *pstatus, siginfo_t *si)
|
||||
case TE_RESTART:
|
||||
break;
|
||||
|
||||
case TE_SECCOMP:
|
||||
if (seccomp_before_ptrace) {
|
||||
restart_op = PTRACE_SYSCALL;
|
||||
break;
|
||||
}
|
||||
ATTRIBUTE_FALLTHROUGH;
|
||||
|
||||
case TE_SYSCALL_STOP:
|
||||
if (trace_syscall(current_tcp, &restart_sig) < 0) {
|
||||
/*
|
||||
@ -2498,23 +2502,20 @@ dispatch_event(enum trace_event ret, int *pstatus, siginfo_t *si)
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
if (enable_seccomp_filter)
|
||||
restart_op = (current_tcp->flags & TCB_INSYSCALL)
|
||||
? PTRACE_SYSCALL : PTRACE_CONT;
|
||||
break;
|
||||
|
||||
case TE_SIGNAL_DELIVERY_STOP:
|
||||
restart_sig = WSTOPSIG(*pstatus);
|
||||
print_stopped(current_tcp, si, restart_sig);
|
||||
restart_sig = WSTOPSIG(status);
|
||||
print_stopped(current_tcp, &wd->si, restart_sig);
|
||||
break;
|
||||
|
||||
case TE_SIGNALLED:
|
||||
print_signalled(current_tcp, current_tcp->pid, *pstatus);
|
||||
print_signalled(current_tcp, current_tcp->pid, status);
|
||||
droptcb(current_tcp);
|
||||
return true;
|
||||
|
||||
case TE_GROUP_STOP:
|
||||
restart_sig = WSTOPSIG(*pstatus);
|
||||
restart_sig = WSTOPSIG(status);
|
||||
print_stopped(current_tcp, NULL, restart_sig);
|
||||
if (use_seize) {
|
||||
/*
|
||||
@ -2529,7 +2530,7 @@ dispatch_event(enum trace_event ret, int *pstatus, siginfo_t *si)
|
||||
break;
|
||||
|
||||
case TE_EXITED:
|
||||
print_exited(current_tcp, current_tcp->pid, *pstatus);
|
||||
print_exited(current_tcp, current_tcp->pid, status);
|
||||
droptcb(current_tcp);
|
||||
return true;
|
||||
|
||||
@ -2612,13 +2613,15 @@ dispatch_event(enum trace_event ret, int *pstatus, siginfo_t *si)
|
||||
static bool
|
||||
restart_delayed_tcb(struct tcb *const tcp)
|
||||
{
|
||||
const struct tcb_wait_data wd = { .te = TE_RESTART };
|
||||
|
||||
debug_func_msg("pid %d", tcp->pid);
|
||||
|
||||
tcp->flags &= ~TCB_DELAYED;
|
||||
|
||||
struct tcb *const prev_tcp = current_tcp;
|
||||
current_tcp = tcp;
|
||||
bool ret = dispatch_event(TE_RESTART, NULL, NULL);
|
||||
bool ret = dispatch_event(&wd);
|
||||
current_tcp = prev_tcp;
|
||||
|
||||
return ret;
|
||||
@ -2729,9 +2732,7 @@ main(int argc, char *argv[])
|
||||
|
||||
exit_code = !nprocs;
|
||||
|
||||
int status;
|
||||
siginfo_t si;
|
||||
while (dispatch_event(next_event(&status, &si), &status, &si))
|
||||
while (dispatch_event(next_event()))
|
||||
;
|
||||
terminate();
|
||||
}
|
||||
|
@ -91,6 +91,9 @@ echo 'END OF TEST SUITE INFORMATION'
|
||||
* @RPM_CHANGELOGTIME@ @PACKAGE_BUGREPORT@ - @PACKAGE_VERSION@-1
|
||||
- @PACKAGE_STRING@ snapshot.
|
||||
|
||||
* Tue Aug 14 2018 Dmitry V. Levin <ldv@altlinux.org> - 4.24-1
|
||||
- v4.23 -> v4.24.
|
||||
|
||||
* Thu Jun 14 2018 Dmitry V. Levin <ldv@altlinux.org> - 4.23-1
|
||||
- v4.22 -> v4.23.
|
||||
- Enabled libdw backend for -k option (#1568647).
|
||||
|
6
tests/.gitignore
vendored
6
tests/.gitignore
vendored
@ -143,6 +143,8 @@ ioctl_dm
|
||||
ioctl_dm-v
|
||||
ioctl_evdev
|
||||
ioctl_evdev-v
|
||||
ioctl_evdev-success
|
||||
ioctl_evdev-success-v
|
||||
ioctl_inotify
|
||||
ioctl_kvm_run
|
||||
ioctl_kvm_run-v
|
||||
@ -151,6 +153,7 @@ ioctl_loop
|
||||
ioctl_loop-nv
|
||||
ioctl_loop-v
|
||||
ioctl_mtd
|
||||
ioctl_nbd
|
||||
ioctl_nsfs
|
||||
ioctl_perf
|
||||
ioctl_perf-success
|
||||
@ -549,6 +552,9 @@ userfaultfd
|
||||
ustat
|
||||
utime
|
||||
utimensat
|
||||
utimensat-Xabbrev
|
||||
utimensat-Xraw
|
||||
utimensat-Xverbose
|
||||
utimes
|
||||
vfork-f
|
||||
vhangup
|
||||
|
@ -118,6 +118,8 @@ check_PROGRAMS = $(PURE_EXECUTABLES) \
|
||||
int_0x80 \
|
||||
ioctl_dm-v \
|
||||
ioctl_evdev-v \
|
||||
ioctl_evdev-success \
|
||||
ioctl_evdev-success-v \
|
||||
ioctl_loop-nv \
|
||||
ioctl_loop-v \
|
||||
ioctl_nsfs \
|
||||
@ -247,6 +249,8 @@ DECODER_TESTS = \
|
||||
futex.test \
|
||||
getuid.test \
|
||||
ioctl.test \
|
||||
ioctl_evdev-success.test \
|
||||
ioctl_evdev-success-v.test \
|
||||
ioctl_perf-success.test \
|
||||
ipc_msgbuf.test \
|
||||
kern_features-fault.test \
|
||||
@ -386,7 +390,6 @@ EXTRA_DIST = \
|
||||
eventfd.expected \
|
||||
fadvise.h \
|
||||
fcntl-common.c \
|
||||
filter_seccomp.in \
|
||||
filter-unavailable.expected \
|
||||
fstatat.c \
|
||||
fstatx.c \
|
||||
|
16
tests/bpf.c
16
tests/bpf.c
@ -276,7 +276,7 @@ static struct bpf_attr_check BPF_MAP_CREATE_checks[] = {
|
||||
},
|
||||
{ /* 1 */
|
||||
.data = { .BPF_MAP_CREATE_data = {
|
||||
.map_type = 18,
|
||||
.map_type = 20,
|
||||
.key_size = 4,
|
||||
.value_size = 8,
|
||||
.max_entries = 256,
|
||||
@ -286,7 +286,7 @@ static struct bpf_attr_check BPF_MAP_CREATE_checks[] = {
|
||||
.map_name = "0123456789abcde",
|
||||
} },
|
||||
.size = offsetof(struct BPF_MAP_CREATE_struct, map_name) + 8,
|
||||
.str = "map_type=BPF_MAP_TYPE_SOCKHASH, key_size=4"
|
||||
.str = "map_type=BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, key_size=4"
|
||||
", value_size=8, max_entries=256"
|
||||
", map_flags=BPF_F_NO_PREALLOC|BPF_F_NO_COMMON_LRU"
|
||||
"|BPF_F_NUMA_NODE|BPF_F_RDONLY|BPF_F_WRONLY"
|
||||
@ -298,7 +298,7 @@ static struct bpf_attr_check BPF_MAP_CREATE_checks[] = {
|
||||
},
|
||||
{ /* 2 */
|
||||
.data = { .BPF_MAP_CREATE_data = {
|
||||
.map_type = 19,
|
||||
.map_type = 21,
|
||||
.key_size = 0xface1e55,
|
||||
.value_size = 0xbadc0ded,
|
||||
.max_entries = 0xbeefcafe,
|
||||
@ -309,7 +309,7 @@ static struct bpf_attr_check BPF_MAP_CREATE_checks[] = {
|
||||
.map_ifindex = 3141592653,
|
||||
} },
|
||||
.size = offsetofend(struct BPF_MAP_CREATE_struct, map_ifindex),
|
||||
.str = "map_type=0x13 /* BPF_MAP_TYPE_??? */"
|
||||
.str = "map_type=0x15 /* BPF_MAP_TYPE_??? */"
|
||||
", key_size=4207812181, value_size=3134983661"
|
||||
", max_entries=3203386110"
|
||||
", map_flags=0xffffffc0 /* BPF_F_??? */"
|
||||
@ -593,7 +593,7 @@ static struct bpf_attr_check BPF_PROG_LOAD_checks[] = {
|
||||
},
|
||||
{ /* 1 */
|
||||
.data = { .BPF_PROG_LOAD_data = {
|
||||
.prog_type = 20,
|
||||
.prog_type = 21,
|
||||
.insn_cnt = 0xbadc0ded,
|
||||
.insns = 0,
|
||||
.license = 0,
|
||||
@ -604,7 +604,7 @@ static struct bpf_attr_check BPF_PROG_LOAD_checks[] = {
|
||||
.prog_flags = 0,
|
||||
} },
|
||||
.size = offsetofend(struct BPF_PROG_LOAD_struct, prog_flags),
|
||||
.str = "prog_type=0x14 /* BPF_PROG_TYPE_??? */"
|
||||
.str = "prog_type=0x15 /* BPF_PROG_TYPE_??? */"
|
||||
", insn_cnt=3134983661, insns=NULL, license=NULL"
|
||||
", log_level=42, log_size=3141592653, log_buf=NULL"
|
||||
", kern_version=KERNEL_VERSION(51966, 240, 13)"
|
||||
@ -612,7 +612,7 @@ static struct bpf_attr_check BPF_PROG_LOAD_checks[] = {
|
||||
},
|
||||
{ /* 2 */
|
||||
.data = { .BPF_PROG_LOAD_data = {
|
||||
.prog_type = 19,
|
||||
.prog_type = 20,
|
||||
.insn_cnt = 0xbadc0ded,
|
||||
.insns = 0xffffffff00000000,
|
||||
.license = 0xffffffff00000000,
|
||||
@ -624,7 +624,7 @@ static struct bpf_attr_check BPF_PROG_LOAD_checks[] = {
|
||||
.prog_name = "fedcba987654321",
|
||||
} },
|
||||
.size = offsetofend(struct BPF_PROG_LOAD_struct, prog_name),
|
||||
.str = "prog_type=BPF_PROG_TYPE_LIRC_MODE2"
|
||||
.str = "prog_type=BPF_PROG_TYPE_SK_REUSEPORT"
|
||||
", insn_cnt=3134983661"
|
||||
", insns=" BIG_ADDR("0xffffffff00000000", "NULL")
|
||||
", license=" BIG_ADDR("0xffffffff00000000", "NULL")
|
||||
|
@ -78,6 +78,7 @@ main(void)
|
||||
|
||||
tail_argv[ARRAY_SIZE(q_argv)] = NULL;
|
||||
tail_envp[ARRAY_SIZE(q_envp)] = NULL;
|
||||
(void) q_envp; /* workaround for clang bug #33068 */
|
||||
|
||||
execve(FILENAME, tail_argv, tail_envp);
|
||||
printf("execve(\"%s\", [\"%s\", \"%s\", \"%s\"]"
|
||||
|
@ -83,6 +83,7 @@ main(void)
|
||||
|
||||
tail_argv[ARRAY_SIZE(q_argv)] = NULL;
|
||||
tail_envp[ARRAY_SIZE(q_envp)] = NULL;
|
||||
(void) q_envp; /* workaround for clang bug #33068 */
|
||||
|
||||
syscall(__NR_execveat, -100, FILENAME, tail_argv, tail_envp, 0x1100);
|
||||
printf("execveat(AT_FDCWD, \"%s\", [\"%s\", \"%s\", \"%s\"]"
|
||||
|
@ -1,3 +0,0 @@
|
||||
siginfo -etrace=none
|
||||
socketcall -esocketcall -a20
|
||||
wait4 -esignal=none -ewait4
|
@ -166,6 +166,9 @@ void invalid_op(int *val, int op, uint32_t argmask, ...)
|
||||
# define VAL3 ((unsigned long) 0xbadda7a09caffee1LLU)
|
||||
# define VAL3_PR ((unsigned) VAL3)
|
||||
|
||||
# define VAL3A ((unsigned long) 0xbadda7a0ffffffffLLU)
|
||||
# define VAL3A_PR "FUTEX_BITSET_MATCH_ANY"
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
@ -288,6 +291,14 @@ main(int argc, char *argv[])
|
||||
zero_extend_signed_to_ull(tmout->tv_nsec), VAL3_PR,
|
||||
sprintrc(rc));
|
||||
|
||||
CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1,
|
||||
VAL3A, (rc == -1) && (errno == EAGAIN));
|
||||
printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%lld, tv_nsec=%llu}"
|
||||
", %s) = %s\n",
|
||||
uaddr, VAL_PR, (long long) tmout->tv_sec,
|
||||
zero_extend_signed_to_ull(tmout->tv_nsec), VAL3A_PR,
|
||||
sprintrc(rc));
|
||||
|
||||
/* val3 of 0 is invalid */
|
||||
CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, 0,
|
||||
(rc == -1) && (errno == EINVAL));
|
||||
@ -375,6 +386,11 @@ main(int argc, char *argv[])
|
||||
printf("futex(%p, FUTEX_WAKE_BITSET, %u, %#x) = %s\n", uaddr, 10,
|
||||
VAL3_PR, sprintrc(rc));
|
||||
|
||||
CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAKE_BITSET, 10, NULL, NULL,
|
||||
VAL3A, (rc == 0));
|
||||
printf("futex(%p, FUTEX_WAKE_BITSET, %u, %s) = %s\n", uaddr, 10,
|
||||
VAL3A_PR, sprintrc(rc));
|
||||
|
||||
/* bitset 0 is invalid */
|
||||
CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAKE_BITSET, 10, NULL, NULL, 0,
|
||||
(rc == -1) && (errno == EINVAL));
|
||||
|
@ -85,7 +85,6 @@ fcntl64 -a8
|
||||
fdatasync -a14
|
||||
file_handle -e trace=name_to_handle_at,open_by_handle_at
|
||||
file_ioctl +ioctl.test
|
||||
filter_seccomp test_prog_set -n
|
||||
finit_module -a25
|
||||
flock -a19
|
||||
fork-f -a26 -qq -f -e signal=none -e trace=chdir
|
||||
@ -147,6 +146,7 @@ ioctl_loop +ioctl.test
|
||||
ioctl_loop-nv +ioctl.test -a22 -e verbose=none
|
||||
ioctl_loop-v +ioctl.test -v
|
||||
ioctl_mtd +ioctl.test
|
||||
ioctl_nbd +ioctl.test -y
|
||||
ioctl_nsfs +ioctl.test -esignal=none
|
||||
ioctl_perf +ioctl.test
|
||||
ioctl_ptp +ioctl.test
|
||||
@ -485,6 +485,9 @@ userfaultfd -a38
|
||||
ustat -a33
|
||||
utime -a16
|
||||
utimensat -a33
|
||||
utimensat-Xabbrev -a33 -Xabbrev -e trace=utimensat
|
||||
utimensat-Xraw -a29 -Xraw -e trace=utimensat
|
||||
utimensat-Xverbose -a44 -Xverbose -e trace=utimensat
|
||||
utimes -a17
|
||||
vfork-f -a26 -qq -f -e signal=none -e trace=chdir
|
||||
vhangup -a10
|
||||
|
@ -344,11 +344,6 @@ test_trace_expr()
|
||||
< negative.list
|
||||
}
|
||||
|
||||
test_prog_set()
|
||||
{
|
||||
test_pure_prog_set "$@" < "$srcdir/$NAME.in"
|
||||
}
|
||||
|
||||
check_prog cat
|
||||
check_prog rm
|
||||
|
||||
|
@ -52,8 +52,8 @@ main(void)
|
||||
static const char *bogus_mask_str = "IN_ACCESS|IN_ATTRIB|"
|
||||
"IN_CLOSE_WRITE|IN_OPEN|IN_MOVED_TO|IN_DELETE|IN_DELETE_SELF|"
|
||||
"IN_MOVE_SELF|IN_Q_OVERFLOW|IN_IGNORED|IN_ONLYDIR|"
|
||||
"IN_DONT_FOLLOW|IN_EXCL_UNLINK|IN_MASK_ADD|IN_ISDIR|IN_ONESHOT|"
|
||||
"0x18ff1000";
|
||||
"IN_DONT_FOLLOW|IN_EXCL_UNLINK|IN_MASK_CREATE|IN_MASK_ADD|"
|
||||
"IN_ISDIR|IN_ONESHOT|0x8ff1000";
|
||||
|
||||
long rc;
|
||||
char *bogus_path = tail_memdup(bogus_path_str.path,
|
||||
|
2
tests/ioctl_evdev-success-v.c
Normal file
2
tests/ioctl_evdev-success-v.c
Normal file
@ -0,0 +1,2 @@
|
||||
#define VERBOSE 1
|
||||
#include "ioctl_evdev-success.c"
|
13
tests/ioctl_evdev-success-v.test
Executable file
13
tests/ioctl_evdev-success-v.test
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh -efu
|
||||
|
||||
. "${srcdir=.}/scno_tampering.sh"
|
||||
|
||||
: ${IOCTL_INJECT_START=256}
|
||||
: ${IOCTL_INJECT_RETVAL=8}
|
||||
|
||||
run_prog
|
||||
run_strace -a16 -v -e trace=ioctl \
|
||||
-e inject=ioctl:retval="${IOCTL_INJECT_RETVAL}":when="${IOCTL_INJECT_START}+" \
|
||||
../ioctl_evdev-success-v "${IOCTL_INJECT_START}" "${IOCTL_INJECT_RETVAL}"> "$EXP"
|
||||
grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT"
|
||||
match_diff "$OUT" "$EXP"
|
232
tests/ioctl_evdev-success.c
Normal file
232
tests/ioctl_evdev-success.c
Normal file
@ -0,0 +1,232 @@
|
||||
#include "tests.h"
|
||||
|
||||
#ifdef HAVE_LINUX_INPUT_H
|
||||
|
||||
# include <inttypes.h>
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <sys/ioctl.h>
|
||||
# include <linux/input.h>
|
||||
# include "print_fields.h"
|
||||
|
||||
static const char *errstr;
|
||||
|
||||
struct evdev_check {
|
||||
unsigned long cmd;
|
||||
const char *cmd_str;
|
||||
void *arg_ptr;
|
||||
void (*print_arg)(long rc, void *ptr, void *arg);
|
||||
};
|
||||
|
||||
static long
|
||||
invoke_test_syscall(unsigned long cmd, void *p)
|
||||
{
|
||||
long rc = ioctl(-1, cmd, p);
|
||||
errstr = sprintrc(rc);
|
||||
static char inj_errstr[4096];
|
||||
|
||||
snprintf(inj_errstr, sizeof(inj_errstr), "%s (INJECTED)", errstr);
|
||||
errstr = inj_errstr;
|
||||
return rc;
|
||||
}
|
||||
|
||||
static void
|
||||
test_evdev(struct evdev_check *check, void *arg)
|
||||
{
|
||||
long rc = invoke_test_syscall(check->cmd, check->arg_ptr);
|
||||
printf("ioctl(-1, %s, ", check->cmd_str);
|
||||
if (check->print_arg)
|
||||
check->print_arg(rc, check->arg_ptr, arg);
|
||||
else
|
||||
printf("%p", check->arg_ptr);
|
||||
printf(") = %s\n", errstr);
|
||||
}
|
||||
|
||||
static void
|
||||
print_input_absinfo(long rc, void *ptr, void *arg)
|
||||
{
|
||||
struct input_absinfo *absinfo = ptr;
|
||||
|
||||
if (rc < 0) {
|
||||
printf("%p", absinfo);
|
||||
return;
|
||||
}
|
||||
PRINT_FIELD_U("{", *absinfo, value);
|
||||
PRINT_FIELD_U(", ", *absinfo, minimum);
|
||||
# if VERBOSE
|
||||
PRINT_FIELD_U(", ", *absinfo, maximum);
|
||||
PRINT_FIELD_U(", ", *absinfo, fuzz);
|
||||
PRINT_FIELD_U(", ", *absinfo, flat);
|
||||
# ifdef HAVE_STRUCT_INPUT_ABSINFO_RESOLUTION
|
||||
PRINT_FIELD_U(", ", *absinfo, resolution);
|
||||
# endif
|
||||
# else
|
||||
printf(", ...");
|
||||
# endif
|
||||
printf("}");
|
||||
}
|
||||
|
||||
static void
|
||||
print_input_id(long rc, void *ptr, void *arg)
|
||||
{
|
||||
struct input_id *id = ptr;
|
||||
|
||||
if (rc < 0) {
|
||||
printf("%p", id);
|
||||
return;
|
||||
}
|
||||
printf("{ID_BUS=%" PRIu16
|
||||
", ID_VENDOR=%" PRIu16
|
||||
", ID_PRODUCT=%" PRIu16
|
||||
", ID_VERSION=%" PRIu16 "}",
|
||||
id->bustype, id->vendor, id->product, id->version);
|
||||
}
|
||||
|
||||
# ifdef EVIOCGMTSLOTS
|
||||
static void
|
||||
print_mtslots(long rc, void *ptr, void *arg)
|
||||
{
|
||||
int *buffer = ptr;
|
||||
const char **str = arg;
|
||||
int num = atoi(*(str + 1));
|
||||
|
||||
if (rc < 0) {
|
||||
printf("%p", buffer);
|
||||
return;
|
||||
}
|
||||
|
||||
printf("{code=%s", *str);
|
||||
printf(", values=[");
|
||||
for (unsigned int i = 1; i <= (unsigned) num; i++)
|
||||
printf("%s%s", i > 1 ? ", " : "", *(str + i + 1));
|
||||
printf("]}");
|
||||
}
|
||||
# endif
|
||||
|
||||
static void
|
||||
print_getbit(long rc, void *ptr, void *arg)
|
||||
{
|
||||
const char **str = arg;
|
||||
int num = atoi(*str);
|
||||
|
||||
if (rc < 0) {
|
||||
printf("%p", ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
printf("[");
|
||||
printf("%s", *(str + 1));
|
||||
for (unsigned int i = 2; i <= (unsigned) num; i++) {
|
||||
# if ! VERBOSE
|
||||
if (i > 4) {
|
||||
printf(", ...");
|
||||
break;
|
||||
}
|
||||
# endif
|
||||
printf(", ");
|
||||
printf("%s", *(str + i));
|
||||
}
|
||||
printf("]");
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
unsigned long num_skip;
|
||||
long inject_retval;
|
||||
bool locked = false;
|
||||
|
||||
if (argc == 1)
|
||||
return 0;
|
||||
|
||||
if (argc < 3)
|
||||
error_msg_and_fail("Usage: %s NUM_SKIP INJECT_RETVAL", argv[0]);
|
||||
|
||||
num_skip = strtoul(argv[1], NULL, 0);
|
||||
inject_retval = strtol(argv[2], NULL, 0);
|
||||
|
||||
if (inject_retval < 0)
|
||||
error_msg_and_fail("Expected non-negative INJECT_RETVAL, "
|
||||
"but got %ld", inject_retval);
|
||||
|
||||
for (unsigned int i = 0; i < num_skip; i++) {
|
||||
long rc = ioctl(-1, EVIOCGID, NULL);
|
||||
printf("ioctl(-1, EVIOCGID, NULL) = %s%s\n",
|
||||
sprintrc(rc),
|
||||
rc == inject_retval ? " (INJECTED)" : "");
|
||||
|
||||
if (rc != inject_retval)
|
||||
continue;
|
||||
|
||||
locked = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!locked)
|
||||
error_msg_and_fail("Hasn't locked on ioctl(-1"
|
||||
", EVIOCGID, NULL) returning %lu",
|
||||
inject_retval);
|
||||
|
||||
TAIL_ALLOC_OBJECT_CONST_PTR(struct input_id, id);
|
||||
TAIL_ALLOC_OBJECT_CONST_PTR(struct input_absinfo, absinfo);
|
||||
TAIL_ALLOC_OBJECT_CONST_PTR(int, bad_addr_slot);
|
||||
# ifdef EVIOCGMTSLOTS
|
||||
int mtslots[] = { ABS_MT_SLOT, 1, 3 };
|
||||
/* we use the second element to indicate the number of values */
|
||||
/* mtslots_str[1] is "2" so the number of values is 2 */
|
||||
const char *mtslots_str[] = { "ABS_MT_SLOT", "2", "1", "3" };
|
||||
|
||||
/* invalid flag */
|
||||
int invalid_mtslot[] = { -1, 1 };
|
||||
char invalid_str[4096];
|
||||
snprintf(invalid_str, sizeof(invalid_str), "%#x /* ABS_MT_??? */", invalid_mtslot[0]);
|
||||
const char *invalid_mtslot_str[] = { invalid_str, "1", "1" };
|
||||
# endif
|
||||
|
||||
/* set more than 4 bits */
|
||||
unsigned long ev_more[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED | 1 << EV_SND | 1 << EV_PWR };
|
||||
/* we use the first element to indicate the number of set bits */
|
||||
/* ev_more_str[0] is "5" so the number of set bits is 5 */
|
||||
const char *ev_more_str[] = { "5", "EV_ABS", "EV_MSC", "EV_LED", "EV_SND", "EV_PWR" };
|
||||
|
||||
/* set less than 4 bits */
|
||||
unsigned long ev_less[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED };
|
||||
const char *ev_less_str[] = { "3", "EV_ABS", "EV_MSC", "EV_LED" };
|
||||
|
||||
/* set zero bit */
|
||||
unsigned long ev_zero[] = { 0x0 };
|
||||
const char *ev_zero_str[] = { "0", " 0 " };
|
||||
|
||||
/* KEY_MAX is 0x2ff which is greater than retval * 8 */
|
||||
unsigned long key[] = { 1 << KEY_1 | 1 << KEY_2, 0 };
|
||||
const char *key_str[] = { "2", "KEY_1", "KEY_2" };
|
||||
|
||||
struct {
|
||||
struct evdev_check check;
|
||||
void *ptr;
|
||||
} a[] = {
|
||||
{ { ARG_STR(EVIOCGID), id, print_input_id }, NULL },
|
||||
{ { ARG_STR(EVIOCGABS(ABS_X)), absinfo, print_input_absinfo }, NULL },
|
||||
{ { ARG_STR(EVIOCGABS(ABS_Y)), absinfo, print_input_absinfo }, NULL },
|
||||
{ { ARG_STR(EVIOCGABS(ABS_Y)), absinfo, print_input_absinfo }, NULL },
|
||||
{ { ARG_STR(EVIOCGBIT(0, 0)), ev_more, print_getbit }, &ev_more_str },
|
||||
{ { ARG_STR(EVIOCGBIT(0, 0)), ev_less, print_getbit }, &ev_less_str },
|
||||
{ { ARG_STR(EVIOCGBIT(0, 0)), ev_zero, print_getbit }, &ev_zero_str },
|
||||
{ { ARG_STR(EVIOCGBIT(EV_KEY, 0)), key, print_getbit }, &key_str},
|
||||
# ifdef EVIOCGMTSLOTS
|
||||
{ { ARG_STR(EVIOCGMTSLOTS(12)), mtslots, print_mtslots }, &mtslots_str },
|
||||
{ { ARG_STR(EVIOCGMTSLOTS(8)), invalid_mtslot, print_mtslots }, &invalid_mtslot_str }
|
||||
# endif
|
||||
};
|
||||
for (unsigned int i = 0; i < ARRAY_SIZE(a); i++) {
|
||||
test_evdev(&a[i].check, a[i].ptr);
|
||||
}
|
||||
|
||||
puts("+++ exited with 0 +++");
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
|
||||
SKIP_MAIN_UNDEFINED("HAVE_LINUX_INPUT_H")
|
||||
|
||||
#endif
|
13
tests/ioctl_evdev-success.test
Executable file
13
tests/ioctl_evdev-success.test
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh -efu
|
||||
|
||||
. "${srcdir=.}/scno_tampering.sh"
|
||||
|
||||
: ${IOCTL_INJECT_START=256}
|
||||
: ${IOCTL_INJECT_RETVAL=8}
|
||||
|
||||
run_prog
|
||||
run_strace -a16 -e trace=ioctl \
|
||||
-e inject=ioctl:retval="${IOCTL_INJECT_RETVAL}":when="${IOCTL_INJECT_START}+" \
|
||||
../ioctl_evdev-success "${IOCTL_INJECT_START}" "${IOCTL_INJECT_RETVAL}"> "$EXP"
|
||||
grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT"
|
||||
match_diff "$OUT" "$EXP"
|
@ -114,6 +114,7 @@ main(void)
|
||||
TEST_NULL_ARG(EVIOCGLED(0));
|
||||
# ifdef EVIOCGMTSLOTS
|
||||
TEST_NULL_ARG(EVIOCGMTSLOTS(0));
|
||||
TEST_NULL_ARG(EVIOCGMTSLOTS(8));
|
||||
# endif
|
||||
# ifdef EVIOCGPROP
|
||||
TEST_NULL_ARG(EVIOCGPROP(0));
|
||||
@ -138,7 +139,7 @@ main(void)
|
||||
TEST_NULL_ARG_EX(EVIOCGABS(0x3f), "EVIOCGABS(0x3f /* ABS_??? */)");
|
||||
TEST_NULL_ARG_EX(EVIOCSABS(0x3f), "EVIOCSABS(0x3f /* ABS_??? */)");
|
||||
|
||||
TEST_NULL_ARG(EVIOCGBIT(EV_SYN, 0));
|
||||
TEST_NULL_ARG(EVIOCGBIT(0, 0));
|
||||
TEST_NULL_ARG(EVIOCGBIT(EV_KEY, 1));
|
||||
TEST_NULL_ARG(EVIOCGBIT(EV_REL, 2));
|
||||
TEST_NULL_ARG(EVIOCGBIT(EV_ABS, 3));
|
||||
|
@ -56,10 +56,10 @@ main(void)
|
||||
|
||||
/* Unknown inotify commands */
|
||||
sys_ioctl(-1, unknown_inotify_cmd, magic);
|
||||
printf("ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE%s, 0x49, %#x, %#x), "
|
||||
printf("ioctl(-1, _IOC(%s_IOC_READ|_IOC_WRITE, 0x49, %#x, %#x), "
|
||||
"%#lx) = -1 EBADF (%m)\n",
|
||||
_IOC_DIR((unsigned int) unknown_inotify_cmd) & _IOC_NONE ?
|
||||
"|_IOC_NONE" : "",
|
||||
"_IOC_NONE|" : "",
|
||||
_IOC_NR((unsigned int) unknown_inotify_cmd),
|
||||
_IOC_SIZE((unsigned int) unknown_inotify_cmd),
|
||||
(unsigned long) magic);
|
||||
|
@ -306,6 +306,11 @@ main(void)
|
||||
printf("ioctl(%d<%s>, KVM_GET_API_VERSION, 0) = %d\n",
|
||||
kvm, dev, ret);
|
||||
|
||||
ret = KVM_IOCTL(kvm, KVM_CHECK_EXTENSION,
|
||||
(void *) (uintptr_t) KVM_CAP_USER_MEMORY);
|
||||
printf("ioctl(%d<%s>, KVM_CHECK_EXTENSION, KVM_CAP_USER_MEMORY) = %d\n",
|
||||
kvm, dev, ret);
|
||||
|
||||
int vm_fd = KVM_IOCTL(kvm, KVM_CREATE_VM, 0);
|
||||
printf("ioctl(%d<%s>, KVM_CREATE_VM, 0) = %d<%s>\n",
|
||||
kvm, dev, vm_fd, vm_dev);
|
||||
|
@ -187,24 +187,26 @@ main(void)
|
||||
|
||||
/* Unknown loop commands */
|
||||
sys_ioctl(-1, unknown_loop_cmd, magic);
|
||||
printf("ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE%s, 0x4c, %#x, %#x), "
|
||||
printf("ioctl(-1, _IOC(%s_IOC_READ|_IOC_WRITE, 0x4c, %#x, %#x), "
|
||||
"%#lx) = -1 EBADF (%m)\n",
|
||||
_IOC_DIR((unsigned int) unknown_loop_cmd) & _IOC_NONE ?
|
||||
"|_IOC_NONE" : "",
|
||||
"_IOC_NONE|" : "",
|
||||
_IOC_NR((unsigned int) unknown_loop_cmd),
|
||||
_IOC_SIZE((unsigned int) unknown_loop_cmd),
|
||||
(unsigned long) magic);
|
||||
|
||||
sys_ioctl(-1, LOOP_SET_BLOCK_SIZE + 1, magic);
|
||||
printf("ioctl(-1, _IOC(0, 0x4c, %#x, %#x), %#lx) = "
|
||||
printf("ioctl(-1, _IOC(%s, 0x4c, %#x, %#x), %#lx) = "
|
||||
"-1 EBADF (%m)\n",
|
||||
_IOC_NONE ? "0" : "_IOC_NONE",
|
||||
_IOC_NR(LOOP_SET_BLOCK_SIZE + 1),
|
||||
_IOC_SIZE(LOOP_SET_BLOCK_SIZE + 1),
|
||||
(unsigned long) magic);
|
||||
|
||||
sys_ioctl(-1, LOOP_CTL_GET_FREE + 1, magic);
|
||||
printf("ioctl(-1, _IOC(0, 0x4c, %#x, %#x), %#lx) = "
|
||||
printf("ioctl(-1, _IOC(%s, 0x4c, %#x, %#x), %#lx) = "
|
||||
"-1 EBADF (%m)\n",
|
||||
_IOC_NONE ? "0" : "_IOC_NONE",
|
||||
_IOC_NR(LOOP_CTL_GET_FREE + 1),
|
||||
_IOC_SIZE(LOOP_CTL_GET_FREE + 1),
|
||||
(unsigned long) magic);
|
||||
|
112
tests/ioctl_nbd.c
Normal file
112
tests/ioctl_nbd.c
Normal file
@ -0,0 +1,112 @@
|
||||
/*
|
||||
* Copyright (c) 2018 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "tests.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/nbd.h>
|
||||
|
||||
#define XLAT_MACROS_ONLY
|
||||
# include "xlat/nbd_ioctl_cmds.h"
|
||||
# include "xlat/nbd_ioctl_flags.h"
|
||||
#undef XLAT_MACROS_ONLY
|
||||
|
||||
#define RVAL_EBADF " = -1 EBADF (%m)\n"
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
static const unsigned long ubeef = (unsigned long) 0xcafef00ddeadbeefULL;
|
||||
static const char null_path[] = "/dev/null";
|
||||
|
||||
int fd = open(null_path, O_RDONLY);
|
||||
if (fd < 0)
|
||||
perror_msg_and_fail("open(\"%s\")", null_path);
|
||||
|
||||
skip_if_unavailable("/proc/self/fd/");
|
||||
|
||||
ioctl(-1, NBD_DISCONNECT, NULL);
|
||||
printf("ioctl(-1, NBD_DISCONNECT)" RVAL_EBADF);
|
||||
ioctl(-1, NBD_CLEAR_SOCK, NULL);
|
||||
printf("ioctl(-1, NBD_CLEAR_SOCK)" RVAL_EBADF);
|
||||
ioctl(-1, NBD_DO_IT, NULL);
|
||||
printf("ioctl(-1, NBD_DO_IT)" RVAL_EBADF);
|
||||
ioctl(-1, NBD_CLEAR_QUE, NULL);
|
||||
printf("ioctl(-1, NBD_CLEAR_QUE)" RVAL_EBADF);
|
||||
ioctl(-1, NBD_PRINT_DEBUG, NULL);
|
||||
printf("ioctl(-1, NBD_PRINT_DEBUG)" RVAL_EBADF);
|
||||
ioctl(-1, NBD_SET_SOCK, fd);
|
||||
printf("ioctl(-1, NBD_SET_SOCK, %d</dev/null>)" RVAL_EBADF, fd);
|
||||
|
||||
ioctl(-1, NBD_SET_BLKSIZE, ubeef);
|
||||
printf("ioctl(-1, NBD_SET_BLKSIZE, %lu)" RVAL_EBADF, ubeef);
|
||||
ioctl(-1, NBD_SET_SIZE, ubeef);
|
||||
printf("ioctl(-1, NBD_SET_SIZE, %lu)" RVAL_EBADF, ubeef);
|
||||
ioctl(-1, NBD_SET_SIZE_BLOCKS, ubeef);
|
||||
printf("ioctl(-1, NBD_SET_SIZE_BLOCKS, %lu)" RVAL_EBADF, ubeef);
|
||||
|
||||
ioctl(-1, NBD_SET_TIMEOUT, ubeef);
|
||||
printf("ioctl(-1, NBD_SET_TIMEOUT, %lu)" RVAL_EBADF, ubeef);
|
||||
|
||||
ioctl(-1, NBD_SET_FLAGS, 0);
|
||||
printf("ioctl(-1, NBD_SET_FLAGS, 0)" RVAL_EBADF);
|
||||
ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_HAS_FLAGS);
|
||||
printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_HAS_FLAGS)" RVAL_EBADF);
|
||||
ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_READ_ONLY);
|
||||
printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_READ_ONLY)" RVAL_EBADF);
|
||||
ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_FLUSH);
|
||||
printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_FLUSH)" RVAL_EBADF);
|
||||
ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_FUA);
|
||||
printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_FUA)" RVAL_EBADF);
|
||||
ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_TRIM);
|
||||
printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_TRIM)" RVAL_EBADF);
|
||||
ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_WRITE_ZEROES);
|
||||
printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_WRITE_ZEROES)" RVAL_EBADF);
|
||||
ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_DF);
|
||||
printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_DF)" RVAL_EBADF);
|
||||
ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_CAN_MULTI_CONN);
|
||||
printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_CAN_MULTI_CONN)" RVAL_EBADF);
|
||||
ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_RESIZE);
|
||||
printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_RESIZE)" RVAL_EBADF);
|
||||
ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_CACHE);
|
||||
printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_CACHE)" RVAL_EBADF);
|
||||
|
||||
ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_HAS_FLAGS|NBD_FLAG_READ_ONLY|
|
||||
NBD_FLAG_SEND_FUA|NBD_FLAG_SEND_CACHE|
|
||||
(1 << 15)|(1<<31));
|
||||
printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_HAS_FLAGS|NBD_FLAG_READ_ONLY|"
|
||||
"NBD_FLAG_SEND_FUA|NBD_FLAG_SEND_CACHE|0x80008000)" RVAL_EBADF);
|
||||
|
||||
ioctl(-1, _IOC(_IOC_NONE, 0xab, 0xb, 0), NULL);
|
||||
printf("ioctl(-1, _IOC(_IOC_NONE, 0xab, 0xb, 0), 0)" RVAL_EBADF);
|
||||
|
||||
puts("+++ exited with 0 +++");
|
||||
return 0;
|
||||
}
|
@ -91,10 +91,10 @@ main(void)
|
||||
|
||||
/* Unknown perf commands */
|
||||
sys_ioctl(-1, unknown_perf_cmd, magic);
|
||||
printf("ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE%s, 0x24, %#x, %#x), "
|
||||
printf("ioctl(-1, _IOC(%s_IOC_READ|_IOC_WRITE, 0x24, %#x, %#x), "
|
||||
"%#lx) = -1 EBADF (%m)\n",
|
||||
_IOC_DIR((unsigned int) unknown_perf_cmd) & _IOC_NONE ?
|
||||
"|_IOC_NONE" : "",
|
||||
"_IOC_NONE|" : "",
|
||||
_IOC_NR((unsigned int) unknown_perf_cmd),
|
||||
_IOC_SIZE((unsigned int) unknown_perf_cmd),
|
||||
(unsigned long) magic);
|
||||
|
@ -137,13 +137,14 @@ main(void)
|
||||
"SG_SCSI_RESET");
|
||||
|
||||
ioctl(-1, 0x22ff, 0);
|
||||
printf("ioctl(-1, _IOC(0, 0x22, 0xff, 0), 0) = -1 EBADF (%m)\n");
|
||||
printf("ioctl(-1, _IOC(%s, 0x22, 0xff, 0), 0) = -1 EBADF (%m)\n",
|
||||
_IOC_NONE ? "0" : "_IOC_NONE");
|
||||
|
||||
static const unsigned long magic =
|
||||
(unsigned long) 0xdeadbeeffacefeedULL;
|
||||
ioctl(-1, 0x22ff, magic);
|
||||
printf("ioctl(-1, _IOC(0, 0x22, 0xff, 0), %#lx) = -1 EBADF (%m)\n",
|
||||
magic);
|
||||
printf("ioctl(-1, _IOC(%s, 0x22, 0xff, 0), %#lx) = -1 EBADF (%m)\n",
|
||||
_IOC_NONE ? "0" : "_IOC_NONE", magic);
|
||||
|
||||
puts("+++ exited with 0 +++");
|
||||
return 0;
|
||||
|
@ -379,6 +379,7 @@ main(void)
|
||||
{
|
||||
const unsigned int size = get_page_size();
|
||||
void *const page = tail_alloc(size);
|
||||
void *const page_end = page + size;
|
||||
fill_memory(page, size);
|
||||
|
||||
unsigned char cc[sizeof(int)] = { 'A', '\'', '\\', '\xfa' };
|
||||
@ -542,7 +543,7 @@ main(void)
|
||||
print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", V4L2_BUF_TYPE_SDR_OUTPUT);
|
||||
#endif
|
||||
struct v4l2_format *const p_v4l2_format =
|
||||
page + size - sizeof(*p_v4l2_format);
|
||||
page_end - sizeof(*p_v4l2_format);
|
||||
ioctl(-1, VIDIOC_TRY_FMT, p_v4l2_format);
|
||||
printf("ioctl(-1, VIDIOC_TRY_FMT, {type=%#x /* V4L2_BUF_TYPE_??? */})"
|
||||
" = -1 EBADF (%m)\n", p_v4l2_format->type);
|
||||
@ -552,7 +553,7 @@ main(void)
|
||||
printf("ioctl(-1, VIDIOC_REQBUFS, NULL) = -1 EBADF (%m)\n");
|
||||
|
||||
struct v4l2_requestbuffers *const p_v4l2_requestbuffers =
|
||||
page + size - sizeof(*p_v4l2_requestbuffers);
|
||||
page_end - sizeof(*p_v4l2_requestbuffers);
|
||||
ioctl(-1, VIDIOC_REQBUFS, p_v4l2_requestbuffers);
|
||||
printf("ioctl(-1, VIDIOC_REQBUFS, {type=%#x /* V4L2_BUF_TYPE_??? */, "
|
||||
"memory=%#x /* V4L2_MEMORY_??? */, count=%u})"
|
||||
@ -566,7 +567,7 @@ main(void)
|
||||
printf("ioctl(-1, VIDIOC_QUERYBUF, NULL) = -1 EBADF (%m)\n");
|
||||
|
||||
struct v4l2_buffer *const p_v4l2_buffer =
|
||||
page + size - sizeof(*p_v4l2_buffer);
|
||||
page_end - sizeof(*p_v4l2_buffer);
|
||||
ioctl(-1, VIDIOC_QUERYBUF, p_v4l2_buffer);
|
||||
printf("ioctl(-1, VIDIOC_QUERYBUF, {type=%#x /* V4L2_BUF_TYPE_??? */"
|
||||
", index=%u}) = -1 EBADF (%m)\n",
|
||||
@ -602,7 +603,7 @@ main(void)
|
||||
printf("ioctl(-1, VIDIOC_S_FBUF, NULL) = -1 EBADF (%m)\n");
|
||||
|
||||
struct v4l2_framebuffer *const p_v4l2_framebuffer =
|
||||
page + size - sizeof(*p_v4l2_framebuffer);
|
||||
page_end - sizeof(*p_v4l2_framebuffer);
|
||||
ioctl(-1, VIDIOC_S_FBUF, p_v4l2_framebuffer);
|
||||
printf("ioctl(-1, VIDIOC_S_FBUF, {capability=%#x"
|
||||
", flags=%#x, base=%p}) = -1 EBADF (%m)\n",
|
||||
@ -614,7 +615,7 @@ main(void)
|
||||
ioctl(-1, VIDIOC_STREAMON, 0);
|
||||
printf("ioctl(-1, VIDIOC_STREAMON, NULL) = -1 EBADF (%m)\n");
|
||||
|
||||
int *const p_int = page + size - sizeof(int);
|
||||
int *const p_int = page_end - sizeof(int);
|
||||
ioctl(-1, VIDIOC_STREAMON, p_int);
|
||||
printf("ioctl(-1, VIDIOC_STREAMON, [%#x /* V4L2_BUF_TYPE_??? */])"
|
||||
" = -1 EBADF (%m)\n", *p_int);
|
||||
@ -632,7 +633,7 @@ main(void)
|
||||
printf("ioctl(-1, VIDIOC_G_PARM, NULL) = -1 EBADF (%m)\n");
|
||||
|
||||
struct v4l2_streamparm *const p_v4l2_streamparm =
|
||||
page + size - sizeof(*p_v4l2_streamparm);
|
||||
page_end - sizeof(*p_v4l2_streamparm);
|
||||
ioctl(-1, VIDIOC_G_PARM, p_v4l2_streamparm);
|
||||
printf("ioctl(-1, VIDIOC_G_PARM, {type=%#x /* V4L2_BUF_TYPE_??? */})"
|
||||
" = -1 EBADF (%m)\n", p_v4l2_streamparm->type);
|
||||
@ -680,7 +681,7 @@ main(void)
|
||||
ioctl(-1, VIDIOC_S_STD, 0);
|
||||
printf("ioctl(-1, VIDIOC_S_STD, NULL) = -1 EBADF (%m)\n");
|
||||
|
||||
long long *const p_longlong = page + size - sizeof(*p_longlong);
|
||||
long long *const p_longlong = page_end - sizeof(*p_longlong);
|
||||
ioctl(-1, VIDIOC_S_STD, p_longlong);
|
||||
printf("ioctl(-1, VIDIOC_S_STD, [%#llx]) = -1 EBADF (%m)\n",
|
||||
*p_longlong);
|
||||
@ -690,7 +691,7 @@ main(void)
|
||||
printf("ioctl(-1, VIDIOC_ENUMSTD, NULL) = -1 EBADF (%m)\n");
|
||||
|
||||
struct v4l2_standard *const p_v4l2_standard =
|
||||
page + size - sizeof(*p_v4l2_standard);
|
||||
page_end - sizeof(*p_v4l2_standard);
|
||||
ioctl(-1, VIDIOC_ENUMSTD, p_v4l2_standard);
|
||||
printf("ioctl(-1, VIDIOC_ENUMSTD, {index=%u}) = -1 EBADF (%m)\n",
|
||||
p_v4l2_standard->index);
|
||||
@ -700,7 +701,7 @@ main(void)
|
||||
printf("ioctl(-1, VIDIOC_ENUMINPUT, NULL) = -1 EBADF (%m)\n");
|
||||
|
||||
struct v4l2_input *const p_v4l2_input =
|
||||
page + size - sizeof(*p_v4l2_input);
|
||||
page_end - sizeof(*p_v4l2_input);
|
||||
ioctl(-1, VIDIOC_ENUMINPUT, p_v4l2_input);
|
||||
printf("ioctl(-1, VIDIOC_ENUMINPUT, {index=%u}) = -1 EBADF (%m)\n",
|
||||
p_v4l2_input->index);
|
||||
@ -710,7 +711,7 @@ main(void)
|
||||
printf("ioctl(-1, VIDIOC_G_CTRL, NULL) = -1 EBADF (%m)\n");
|
||||
|
||||
struct v4l2_control *const p_v4l2_control =
|
||||
page + size - sizeof(*p_v4l2_control);
|
||||
page_end - sizeof(*p_v4l2_control);
|
||||
ioctl(-1, VIDIOC_G_CTRL, p_v4l2_control);
|
||||
printf("ioctl(-1, VIDIOC_G_CTRL, {id=%#x /* V4L2_CID_??? */})"
|
||||
" = -1 EBADF (%m)\n", p_v4l2_control->id);
|
||||
@ -729,7 +730,7 @@ main(void)
|
||||
printf("ioctl(-1, VIDIOC_G_TUNER, NULL) = -1 EBADF (%m)\n");
|
||||
|
||||
struct v4l2_tuner *const p_v4l2_tuner =
|
||||
page + size - sizeof(*p_v4l2_tuner);
|
||||
page_end - sizeof(*p_v4l2_tuner);
|
||||
ioctl(-1, VIDIOC_G_TUNER, p_v4l2_tuner);
|
||||
printf("ioctl(-1, VIDIOC_G_TUNER, {index=%u})"
|
||||
" = -1 EBADF (%m)\n", p_v4l2_tuner->index);
|
||||
@ -765,7 +766,7 @@ main(void)
|
||||
printf("ioctl(-1, VIDIOC_QUERYCTRL, NULL) = -1 EBADF (%m)\n");
|
||||
|
||||
struct v4l2_queryctrl *const p_v4l2_queryctrl =
|
||||
page + size - sizeof(*p_v4l2_queryctrl);
|
||||
page_end - sizeof(*p_v4l2_queryctrl);
|
||||
ioctl(-1, VIDIOC_QUERYCTRL, p_v4l2_queryctrl);
|
||||
# ifdef V4L2_CTRL_FLAG_NEXT_CTRL
|
||||
printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=V4L2_CTRL_FLAG_NEXT_CTRL"
|
||||
@ -801,7 +802,7 @@ main(void)
|
||||
printf("ioctl(-1, VIDIOC_CROPCAP, NULL) = -1 EBADF (%m)\n");
|
||||
|
||||
struct v4l2_cropcap *const p_v4l2_cropcap =
|
||||
page + size - sizeof(*p_v4l2_cropcap);
|
||||
page_end - sizeof(*p_v4l2_cropcap);
|
||||
ioctl(-1, VIDIOC_CROPCAP, p_v4l2_cropcap);
|
||||
printf("ioctl(-1, VIDIOC_CROPCAP, {type=%#x /* V4L2_BUF_TYPE_??? */})"
|
||||
" = -1 EBADF (%m)\n", p_v4l2_cropcap->type);
|
||||
@ -811,7 +812,7 @@ main(void)
|
||||
printf("ioctl(-1, VIDIOC_G_CROP, NULL) = -1 EBADF (%m)\n");
|
||||
|
||||
struct v4l2_crop *const p_v4l2_crop =
|
||||
page + size - sizeof(*p_v4l2_crop);
|
||||
page_end - sizeof(*p_v4l2_crop);
|
||||
ioctl(-1, VIDIOC_G_CROP, p_v4l2_crop);
|
||||
printf("ioctl(-1, VIDIOC_G_CROP, {type=%#x /* V4L2_BUF_TYPE_??? */})"
|
||||
" = -1 EBADF (%m)\n", p_v4l2_crop->type);
|
||||
@ -950,7 +951,7 @@ main(void)
|
||||
printf("ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, NULL) = -1 EBADF (%m)\n");
|
||||
|
||||
struct v4l2_frmivalenum *const p_v4l2_frmivalenum =
|
||||
page + size - sizeof(*p_v4l2_frmivalenum);
|
||||
page_end - sizeof(*p_v4l2_frmivalenum);
|
||||
ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, p_v4l2_frmivalenum);
|
||||
printf("ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, {index=%u"
|
||||
", pixel_format=v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')"
|
||||
@ -969,7 +970,7 @@ main(void)
|
||||
printf("ioctl(-1, VIDIOC_CREATE_BUFS, NULL) = -1 EBADF (%m)\n");
|
||||
|
||||
struct v4l2_create_buffers *const p_v4l2_create_buffers =
|
||||
page + size - sizeof(*p_v4l2_create_buffers);
|
||||
page_end - sizeof(*p_v4l2_create_buffers);
|
||||
ioctl(-1, VIDIOC_CREATE_BUFS, p_v4l2_create_buffers);
|
||||
printf("ioctl(-1, VIDIOC_CREATE_BUFS, {count=%u, memory=%#x"
|
||||
" /* V4L2_MEMORY_??? */, format={type=%#x"
|
||||
|
@ -312,7 +312,10 @@ main(void)
|
||||
static const char *bogus_key3_str = "-557785390";
|
||||
|
||||
static const struct keyctl_dh_params kcdhp_data = {
|
||||
KEY_SPEC_GROUP_KEYRING, 1234567890, 3141592653U };
|
||||
.private = KEY_SPEC_GROUP_KEYRING,
|
||||
.prime = 1234567890,
|
||||
.base = 3141592653U
|
||||
};
|
||||
static const char *kcdhp_str = "{private="
|
||||
#if XLAT_RAW || XLAT_VERBOSE
|
||||
"-6"
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sed -rnf
|
||||
|
||||
# should not have been exported at all
|
||||
/#define[[:space:]]+__NR_(sys_epoll_|arch_specific_syscall|syscalls|syscall_count|syscall_max|available|reserved|unused)/d
|
||||
/#define[[:space:]]+__NR_(sys_epoll_|arch_specific_syscall|arm_sync_file_range|syscalls|syscall_count|syscall_max|available|reserved|unused)/d
|
||||
|
||||
# should not have been named this way
|
||||
# should not have been named this way
|
||||
s/__NR_(arm|xtensa)_fadvise64_64/__NR_fadvise64_64/
|
||||
|
||||
# legacy names
|
||||
|
10
tests/mmap.c
10
tests/mmap.c
@ -140,15 +140,15 @@ main(int ac, char **av)
|
||||
perror_msg_and_fail("munmap");
|
||||
printf("munmap(%p, %lu) = 0\n", p, length3);
|
||||
|
||||
if (mlockall(MCL_FUTURE))
|
||||
perror_msg_and_fail("mlockall");
|
||||
printf("mlockall(");
|
||||
#if XLAT_RAW
|
||||
printf("mlockall(%#x) = 0\n", MCL_FUTURE);
|
||||
printf("%#x", MCL_FUTURE);
|
||||
#elif XLAT_VERBOSE
|
||||
printf("mlockall(%#x /* MCL_FUTURE */) = 0\n", MCL_FUTURE);
|
||||
printf("%#x /* MCL_FUTURE */", MCL_FUTURE);
|
||||
#else
|
||||
puts("mlockall(MCL_FUTURE) = 0");
|
||||
printf("MCL_FUTURE");
|
||||
#endif
|
||||
printf(") = %s\n", sprintrc(mlockall(MCL_FUTURE)));
|
||||
|
||||
puts("+++ exited with 0 +++");
|
||||
return 0;
|
||||
|
@ -6,7 +6,7 @@
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
printf("munlockall() = %d\n", munlockall());
|
||||
printf("munlockall() = %s\n", sprintrc(munlockall()));
|
||||
|
||||
puts("+++ exited with 0 +++");
|
||||
return 0;
|
||||
|
@ -38,9 +38,11 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/in.h>
|
||||
#include "netlink.h"
|
||||
#include <linux/ax25.h>
|
||||
#include <linux/if_arp.h>
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/if_packet.h>
|
||||
#include <linux/x25.h>
|
||||
#include <linux/ipx.h>
|
||||
#ifdef HAVE_BLUETOOTH_BLUETOOTH_H
|
||||
# include <bluetooth/bluetooth.h>
|
||||
@ -289,6 +291,181 @@ check_ipx(void)
|
||||
c_ipx.sipx_type, len, ret);
|
||||
}
|
||||
|
||||
/* for a bit more compact AX.25 address definitions */
|
||||
#define AX25_ADDR(c_, s_) \
|
||||
{ { (c_)[0] << 1, (c_)[1] << 1, (c_)[2] << 1, \
|
||||
(c_)[3] << 1, (c_)[4] << 1, (c_)[5] << 1, (s_) << 1 } } \
|
||||
/* End of AX25_ADDR definition */
|
||||
|
||||
static void
|
||||
check_ax25(void)
|
||||
{
|
||||
const struct full_sockaddr_ax25 ax25 = {
|
||||
.fsa_ax25 = {
|
||||
.sax25_family = AF_AX25,
|
||||
.sax25_call = AX25_ADDR("VALID ", 13),
|
||||
.sax25_ndigis = 8,
|
||||
},
|
||||
.fsa_digipeater = {
|
||||
AX25_ADDR("SPA CE", 0),
|
||||
AX25_ADDR("SSID ", 16),
|
||||
AX25_ADDR(" ", 0),
|
||||
AX25_ADDR("NULL\0", 3),
|
||||
AX25_ADDR("A-B-C", 4),
|
||||
AX25_ADDR(",}]\"\\'", 5),
|
||||
AX25_ADDR("DASH-0", 6),
|
||||
AX25_ADDR("\n\tABCD", 7),
|
||||
},
|
||||
};
|
||||
const ax25_address aux_addrs[] = {
|
||||
AX25_ADDR("VALID2", 7),
|
||||
AX25_ADDR("OK ", 15),
|
||||
AX25_ADDR("FINE ", 2),
|
||||
AX25_ADDR("smalls", 9),
|
||||
};
|
||||
|
||||
enum { AX25_ALIGN = ALIGNOF(struct full_sockaddr_ax25), };
|
||||
size_t size = sizeof(ax25);
|
||||
size_t surplus = ROUNDUP(sizeof(ax25_address), AX25_ALIGN);
|
||||
void *sax_void = midtail_alloc(size, surplus);
|
||||
struct full_sockaddr_ax25 *sax = sax_void;
|
||||
long rc;
|
||||
|
||||
fill_memory(sax, size);
|
||||
sax->fsa_ax25.sax25_family = AF_AX25;
|
||||
rc = connect(-1, sax_void, sizeof(struct sockaddr_ax25) - 1);
|
||||
printf("connect(-1, {sa_family=AF_AX25, sa_data=\"\\202\\203\\204\\205"
|
||||
"\\206\\207\\210\\211\\212\\213\\214\\215\\216\"}, %zu) = %s\n",
|
||||
sizeof(struct sockaddr_ax25) - 1, sprintrc(rc));
|
||||
|
||||
memcpy(sax, &ax25, sizeof(ax25));
|
||||
rc = connect(-1, sax_void, sizeof(struct sockaddr_ax25));
|
||||
printf("connect(-1, {sa_family=AF_AX25, fsa_ax25={sax25_call=VALID-13"
|
||||
", sax25_ndigis=8}, fsa_digipeater=[/* ??? */]}, %zu) = %s\n",
|
||||
sizeof(struct sockaddr_ax25), sprintrc(rc));
|
||||
|
||||
sax->fsa_ax25.sax25_ndigis = 0;
|
||||
rc = connect(-1, sax_void, sizeof(struct sockaddr_ax25));
|
||||
printf("connect(-1, {sa_family=AF_AX25, sax25_call=VALID-13"
|
||||
", sax25_ndigis=0}, %zu) = %s\n",
|
||||
sizeof(struct sockaddr_ax25), sprintrc(rc));
|
||||
|
||||
sax->fsa_ax25.sax25_ndigis = 8;
|
||||
size = sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 3 + 1;
|
||||
rc = connect(-1, sax_void, size);
|
||||
printf("connect(-1, {sa_family=AF_AX25, fsa_ax25={sax25_call=VALID-13"
|
||||
", sax25_ndigis=8}, fsa_digipeater"
|
||||
"=[{ax25_call=\"\\xa6\\xa0\\x82\\x40\\x86\\x8a\\x00\""
|
||||
"} /* SPA CE-0 */"
|
||||
", {ax25_call=\"\\xa6\\xa6\\x92\\x88\\x40\\x40\\x20\""
|
||||
"} /* SSID-0 */"
|
||||
", *"
|
||||
", /* ??? */], ...}, %zu) = %s\n",
|
||||
size, sprintrc(rc));
|
||||
|
||||
sax->fsa_digipeater[2].ax25_call[6] = 0x4;
|
||||
size = sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 4;
|
||||
rc = connect(-1, sax_void, size);
|
||||
printf("connect(-1, {sa_family=AF_AX25, fsa_ax25={sax25_call=VALID-13"
|
||||
", sax25_ndigis=8}, fsa_digipeater"
|
||||
"=[{ax25_call=\"\\xa6\\xa0\\x82\\x40\\x86\\x8a\\x00\""
|
||||
"} /* SPA CE-0 */"
|
||||
", {ax25_call=\"\\xa6\\xa6\\x92\\x88\\x40\\x40\\x20\""
|
||||
"} /* SSID-0 */"
|
||||
", {ax25_call=\"\\x40\\x40\\x40\\x40\\x40\\x40\\x04\"} /* -2 */"
|
||||
", {ax25_call=\"\\x9c\\xaa\\x98\\x98\\x00\\x00\\x06\"}"
|
||||
", /* ??? */]}, %zu) = %s\n",
|
||||
size, sprintrc(rc));
|
||||
|
||||
memcpy(sax->fsa_digipeater, aux_addrs, sizeof(aux_addrs));
|
||||
sax->fsa_digipeater[2].ax25_call[6] = 0xa5;
|
||||
sax->fsa_digipeater[4].ax25_call[5] = 0x40;
|
||||
for (size_t i = 0; i < 3; i++) {
|
||||
size = sizeof(ax25) + sizeof(ax25_address) * (i / 2);
|
||||
rc = connect(-1, sax_void, size);
|
||||
printf("connect(-1, {sa_family=AF_AX25"
|
||||
", fsa_ax25={sax25_call=VALID-13, sax25_ndigis=%d}"
|
||||
", fsa_digipeater=[VALID2-7, OK-15, %s /* FINE-2 */"
|
||||
", {ax25_call=\"\\xe6\\xda\\xc2\\xd8\\xd8\\xe6\\x12\""
|
||||
"} /* smalls-9 */"
|
||||
", {ax25_call=\"\\x%s\\x%s\\x84\\x5a\\x86\\x40\\x08\""
|
||||
"} /* %sB-C-4 */"
|
||||
", {ax25_call=\"\\x58\\xfa\\xba\\x44\\x%s\\x%s\\x0a\""
|
||||
"}%s"
|
||||
", {ax25_call=\"\\x88\\x82\\xa6\\x90\\x5a\\x%s\\x0c\""
|
||||
"}%s"
|
||||
"%s]%s}, %zu) = %s\n"
|
||||
, sax->fsa_ax25.sax25_ndigis
|
||||
, i
|
||||
? "{ax25_call=\"\\x8c\\x92\\x9c\\x8a\\x40\\x41\\x04\"}"
|
||||
: "{ax25_call=\"\\x8c\\x92\\x9c\\x8a\\x40\\x40\\xa5\"}"
|
||||
, i ? "40" : "82"
|
||||
, i ? "40" : "5a"
|
||||
, i ? " " : "A-"
|
||||
, i ? "54" : "b8"
|
||||
, i ? "5e" : "4e"
|
||||
, i ? "" : " /* ,}]\"\\'-5 */"
|
||||
, i ? "fe" : "60"
|
||||
, i ? "" : " /* DASH-0-6 */"
|
||||
, i == 1
|
||||
? ""
|
||||
: ", {ax25_call=\"\\x14\\x12\\x82\\x84\\x86\\x88\\x0e\"}"
|
||||
, i > 1 ? ", ..." : ""
|
||||
, size, sprintrc(rc));
|
||||
|
||||
if (i == 1) {
|
||||
sax_void = (char *) sax_void - surplus;
|
||||
memmove(sax_void, sax, sizeof(ax25));
|
||||
sax = sax_void;
|
||||
}
|
||||
|
||||
sax->fsa_ax25.sax25_ndigis = 7 + 2 * i;
|
||||
|
||||
sax->fsa_digipeater[2].ax25_call[5] = 0x41;
|
||||
sax->fsa_digipeater[2].ax25_call[6] = 0x4;
|
||||
|
||||
sax->fsa_digipeater[4].ax25_call[0] = 0x40;
|
||||
sax->fsa_digipeater[4].ax25_call[1] = 0x40;
|
||||
|
||||
sax->fsa_digipeater[5].ax25_call[4] = '*' << 1;
|
||||
sax->fsa_digipeater[5].ax25_call[5] = '/' << 1;
|
||||
|
||||
sax->fsa_digipeater[6].ax25_call[5] = 0xfe;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
check_x25(void)
|
||||
{
|
||||
static const struct sockaddr_x25 c_x25 = {
|
||||
.sx25_family = AF_X25,
|
||||
.sx25_addr = { "0123456789abcdef" },
|
||||
};
|
||||
void *x25_void = tail_memdup(&c_x25, sizeof(c_x25) + 1);
|
||||
struct sockaddr_x25 *x25 = x25_void;
|
||||
long rc;
|
||||
|
||||
rc = connect(-1, x25, sizeof(c_x25) - 1);
|
||||
printf("connect(-1, {sa_family=AF_X25"
|
||||
", sa_data=\"0123456789abcde\"}, %zu) = %s\n",
|
||||
sizeof(c_x25) - 1, sprintrc(rc));
|
||||
|
||||
for (size_t i = 0; i < 2; i++) {
|
||||
rc = connect(-1, x25, sizeof(c_x25) + i);
|
||||
printf("connect(-1, {sa_family=AF_X25"
|
||||
", sx25_addr={x25_addr=\"0123456789abcde\"...}"
|
||||
"}, %zu) = %s\n",
|
||||
sizeof(c_x25) + i, sprintrc(rc));
|
||||
}
|
||||
|
||||
x25->sx25_addr.x25_addr[10] = '\0';
|
||||
rc = connect(-1, x25, sizeof(c_x25));
|
||||
printf("connect(-1, {sa_family=AF_X25"
|
||||
", sx25_addr={x25_addr=\"0123456789\"}"
|
||||
"}, %zu) = %s\n",
|
||||
sizeof(c_x25), sprintrc(rc));
|
||||
}
|
||||
|
||||
static void
|
||||
check_nl(void)
|
||||
{
|
||||
@ -554,6 +731,8 @@ main(void)
|
||||
check_in();
|
||||
check_in6();
|
||||
check_ipx();
|
||||
check_ax25();
|
||||
check_x25();
|
||||
check_nl();
|
||||
check_ll();
|
||||
#ifdef HAVE_BLUETOOTH_BLUETOOTH_H
|
||||
|
@ -100,8 +100,8 @@ check_responses(const int fd)
|
||||
perror_msg_and_skip("recvmsg");
|
||||
|
||||
struct nlmsghdr *h = &hdr_buf.hdr;
|
||||
if (!NLMSG_OK(h, ret))
|
||||
error_msg_and_skip("!NLMSG_OK");
|
||||
if (!is_nlmsg_ok(h, ret))
|
||||
error_msg_and_skip("!is_nlmsg_ok");
|
||||
if (h->nlmsg_type == NLMSG_ERROR) {
|
||||
const struct nlmsgerr *err = NLMSG_DATA(h);
|
||||
if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err)))
|
||||
|
@ -100,8 +100,8 @@ check_responses(const int fd)
|
||||
perror_msg_and_skip("recvmsg");
|
||||
|
||||
struct nlmsghdr *h = &hdr_buf.hdr;
|
||||
if (!NLMSG_OK(h, ret))
|
||||
error_msg_and_skip("!NLMSG_OK");
|
||||
if (!is_nlmsg_ok(h, ret))
|
||||
error_msg_and_skip("!is_nlmsg_ok");
|
||||
if (h->nlmsg_type == NLMSG_ERROR) {
|
||||
const struct nlmsgerr *err = NLMSG_DATA(h);
|
||||
if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err)))
|
||||
|
@ -338,7 +338,7 @@ test_packet_diag_req(const int fd)
|
||||
TEST_SOCK_DIAG(fd, nlh0, AF_PACKET,
|
||||
SOCK_DIAG_BY_FAMILY, NLM_F_REQUEST, req,
|
||||
printf("{sdiag_family=AF_PACKET"),
|
||||
printf(", sdiag_protocol=ETH_P_LOOP");
|
||||
printf(", sdiag_protocol=%#x", req.sdiag_protocol);
|
||||
PRINT_FIELD_U(", ", req, pdiag_ino);
|
||||
printf(", pdiag_show=PACKET_SHOW_INFO");
|
||||
PRINT_FIELD_COOKIE(", ", req, pdiag_cookie);
|
||||
@ -351,7 +351,7 @@ test_packet_diag_msg(const int fd)
|
||||
static const struct packet_diag_msg msg = {
|
||||
.pdiag_family = AF_PACKET,
|
||||
.pdiag_type = SOCK_STREAM,
|
||||
.pdiag_num = 0xbadc,
|
||||
.pdiag_num = 0x9100,
|
||||
.pdiag_ino = 0xfacefeed,
|
||||
.pdiag_cookie = { 0xdeadbeef, 0xbadc0ded }
|
||||
};
|
||||
@ -360,7 +360,7 @@ test_packet_diag_msg(const int fd)
|
||||
SOCK_DIAG_BY_FAMILY, NLM_F_DUMP, msg,
|
||||
printf("{pdiag_family=AF_PACKET"),
|
||||
printf(", pdiag_type=SOCK_STREAM");
|
||||
PRINT_FIELD_U(", ", msg, pdiag_num);
|
||||
printf(", pdiag_num=ETH_P_QINQ1");
|
||||
PRINT_FIELD_U(", ", msg, pdiag_ino);
|
||||
PRINT_FIELD_COOKIE(", ", msg, pdiag_cookie);
|
||||
printf("}"));
|
||||
@ -609,7 +609,7 @@ test_smc_diag_msg(const int fd)
|
||||
struct smc_diag_msg msg = {
|
||||
.diag_family = AF_SMC,
|
||||
.diag_state = SMC_ACTIVE,
|
||||
.diag_fallback = 0xde,
|
||||
.diag_fallback = 0x1,
|
||||
.diag_shutdown = 0xba,
|
||||
.id = {
|
||||
.idiag_sport = 0xdead,
|
||||
@ -630,7 +630,7 @@ test_smc_diag_msg(const int fd)
|
||||
SOCK_DIAG_BY_FAMILY, NLM_F_DUMP, msg,
|
||||
printf("{diag_family=AF_SMC"),
|
||||
printf(", diag_state=SMC_ACTIVE");
|
||||
PRINT_FIELD_U(", ", msg, diag_fallback);
|
||||
printf(", diag_fallback=SMC_DIAG_MODE_FALLBACK_TCP");
|
||||
PRINT_FIELD_U(", ", msg, diag_shutdown);
|
||||
printf(", id={idiag_sport=htons(%u)"
|
||||
", idiag_dport=htons(%u)"
|
||||
|
@ -104,8 +104,8 @@ check_responses(const int fd)
|
||||
perror_msg_and_skip("recvmsg");
|
||||
|
||||
struct nlmsghdr *h = &hdr_buf.hdr;
|
||||
if (!NLMSG_OK(h, ret))
|
||||
error_msg_and_skip("!NLMSG_OK");
|
||||
if (!is_nlmsg_ok(h, ret))
|
||||
error_msg_and_skip("!is_nlmsg_ok");
|
||||
if (h->nlmsg_type == NLMSG_ERROR) {
|
||||
const struct nlmsgerr *err = NLMSG_DATA(h);
|
||||
if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err)))
|
||||
|
@ -44,6 +44,34 @@ enum { IFLA_XDP = 43 };
|
||||
# define IFLA_XDP_FD 1
|
||||
#endif
|
||||
|
||||
#ifndef IFLA_XDP_ATTACHED
|
||||
# define IFLA_XDP_ATTACHED 2
|
||||
#endif
|
||||
|
||||
#ifndef IFLA_XDP_PROG_ID
|
||||
# define IFLA_XDP_PROG_ID 4
|
||||
#endif
|
||||
|
||||
#ifndef IFLA_XDP_DRV_PROG_ID
|
||||
# define IFLA_XDP_DRV_PROG_ID 5
|
||||
#endif
|
||||
|
||||
#ifndef IFLA_XDP_SKB_PROG_ID
|
||||
# define IFLA_XDP_SKB_PROG_ID 6
|
||||
#endif
|
||||
|
||||
#ifndef IFLA_XDP_HW_PROG_ID
|
||||
# define IFLA_XDP_HW_PROG_ID 7
|
||||
#endif
|
||||
|
||||
#ifndef XDP_ATTACHED_NONE
|
||||
# define XDP_ATTACHED_NONE 0
|
||||
#endif
|
||||
|
||||
#ifndef XDP_ATTACHED_MULTI
|
||||
# define XDP_ATTACHED_MULTI 4
|
||||
#endif
|
||||
|
||||
#define IFLA_ATTR IFLA_XDP
|
||||
#include "nlattr_ifla.h"
|
||||
|
||||
@ -65,6 +93,24 @@ main(void)
|
||||
IFLA_XDP_FD, pattern, num,
|
||||
printf("%d", num));
|
||||
|
||||
static const struct {
|
||||
uint8_t val;
|
||||
const char *str;
|
||||
} attach_types[] = {
|
||||
{ ARG_STR(XDP_ATTACHED_NONE) },
|
||||
{ ARG_STR(XDP_ATTACHED_MULTI) },
|
||||
{ ARG_STR(0x5) " /* XDP_ATTACHED_??? */" },
|
||||
{ ARG_STR(0xfe) " /* XDP_ATTACHED_??? */" },
|
||||
};
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(attach_types); i++) {
|
||||
TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen,
|
||||
init_ifinfomsg, print_ifinfomsg,
|
||||
IFLA_XDP_ATTACHED, pattern,
|
||||
attach_types[i].val,
|
||||
printf("%s", attach_types[i].str));
|
||||
}
|
||||
|
||||
#ifdef XDP_FLAGS_UPDATE_IF_NOEXIST
|
||||
const uint32_t flags = XDP_FLAGS_UPDATE_IF_NOEXIST;
|
||||
TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen,
|
||||
@ -73,6 +119,25 @@ main(void)
|
||||
printf("XDP_FLAGS_UPDATE_IF_NOEXIST"));
|
||||
#endif
|
||||
|
||||
static const struct {
|
||||
uint32_t val;
|
||||
const char *str;
|
||||
} attrs[] = {
|
||||
{ ARG_STR(IFLA_XDP_PROG_ID) },
|
||||
{ ARG_STR(IFLA_XDP_DRV_PROG_ID) },
|
||||
{ ARG_STR(IFLA_XDP_SKB_PROG_ID) },
|
||||
{ ARG_STR(IFLA_XDP_HW_PROG_ID) },
|
||||
};
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(attrs); i++) {
|
||||
TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen,
|
||||
init_ifinfomsg, print_ifinfomsg,
|
||||
attrs[i].val, attrs[i].str,
|
||||
pattern, num,
|
||||
print_quoted_hex, 1,
|
||||
printf("%u", num));
|
||||
}
|
||||
|
||||
puts("+++ exited with 0 +++");
|
||||
return 0;
|
||||
}
|
||||
|
@ -51,7 +51,8 @@ init_packet_diag_msg(struct nlmsghdr *const nlh, const unsigned int msg_len)
|
||||
struct packet_diag_msg *const msg = NLMSG_DATA(nlh);
|
||||
SET_STRUCT(struct packet_diag_msg, msg,
|
||||
.pdiag_family = AF_PACKET,
|
||||
.pdiag_type = SOCK_STREAM
|
||||
.pdiag_type = SOCK_STREAM,
|
||||
.pdiag_num = 3,
|
||||
);
|
||||
}
|
||||
|
||||
@ -61,7 +62,7 @@ print_packet_diag_msg(const unsigned int msg_len)
|
||||
printf("{len=%u, type=SOCK_DIAG_BY_FAMILY"
|
||||
", flags=NLM_F_DUMP, seq=0, pid=0}"
|
||||
", {pdiag_family=AF_PACKET"
|
||||
", pdiag_type=SOCK_STREAM, pdiag_num=0"
|
||||
", pdiag_type=SOCK_STREAM, pdiag_num=ETH_P_ALL"
|
||||
", pdiag_ino=0, pdiag_cookie=[0, 0]}",
|
||||
msg_len);
|
||||
}
|
||||
@ -98,9 +99,9 @@ main(void)
|
||||
{
|
||||
skip_if_unavailable("/proc/self/fd/");
|
||||
|
||||
static const struct packet_diag_info pinfo = {
|
||||
.pdi_index = 0xabcddafa,
|
||||
.pdi_version = 0xbabcdafb,
|
||||
struct packet_diag_info pinfo = {
|
||||
.pdi_index = ifindex_lo(),
|
||||
.pdi_version = 2,
|
||||
.pdi_reserve = 0xcfaacdaf,
|
||||
.pdi_copy_thresh = 0xdabacdaf,
|
||||
.pdi_tstamp = 0xeafbaadf,
|
||||
@ -143,8 +144,8 @@ main(void)
|
||||
TEST_NLATTR_OBJECT(fd, nlh0, hdrlen,
|
||||
init_packet_diag_msg, print_packet_diag_msg,
|
||||
PACKET_DIAG_INFO, pattern, pinfo,
|
||||
PRINT_FIELD_U("{", pinfo, pdi_index);
|
||||
PRINT_FIELD_U(", ", pinfo, pdi_version);
|
||||
printf("{pdi_index=%s", IFINDEX_LO_STR);
|
||||
printf(", pdi_version=TPACKET_V3");
|
||||
PRINT_FIELD_U(", ", pinfo, pdi_reserve);
|
||||
PRINT_FIELD_U(", ", pinfo, pdi_copy_thresh);
|
||||
PRINT_FIELD_U(", ", pinfo, pdi_tstamp);
|
||||
|
@ -29,23 +29,25 @@
|
||||
#include "tests.h"
|
||||
#include <sys/socket.h>
|
||||
|
||||
#ifdef AF_SMC
|
||||
#ifndef AF_SMC
|
||||
# define AF_SMC 43
|
||||
#endif
|
||||
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
# include <stdint.h>
|
||||
# include <arpa/inet.h>
|
||||
# include "test_nlattr.h"
|
||||
# include <linux/rtnetlink.h>
|
||||
# include <linux/smc_diag.h>
|
||||
# include <linux/sock_diag.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <arpa/inet.h>
|
||||
#include "test_nlattr.h"
|
||||
#include <linux/rtnetlink.h>
|
||||
#include <linux/smc_diag.h>
|
||||
#include <linux/sock_diag.h>
|
||||
|
||||
# ifndef SMC_CLNT
|
||||
# define SMC_CLNT 0
|
||||
# endif
|
||||
# ifndef SMC_ACTIVE
|
||||
# define SMC_ACTIVE 1
|
||||
# endif
|
||||
#ifndef SMC_CLNT
|
||||
# define SMC_CLNT 0
|
||||
#endif
|
||||
#ifndef SMC_ACTIVE
|
||||
# define SMC_ACTIVE 1
|
||||
#endif
|
||||
|
||||
static const char address[] = "12.34.56.78";
|
||||
|
||||
@ -75,7 +77,7 @@ print_smc_diag_msg(const unsigned int msg_len)
|
||||
printf("{len=%u, type=SOCK_DIAG_BY_FAMILY"
|
||||
", flags=NLM_F_DUMP, seq=0, pid=0}"
|
||||
", {diag_family=AF_SMC, diag_state=SMC_ACTIVE"
|
||||
", diag_fallback=0, diag_shutdown=0"
|
||||
", diag_fallback=SMC_DIAG_MODE_SMCR, diag_shutdown=0"
|
||||
", id={idiag_sport=htons(0), idiag_dport=htons(0)"
|
||||
", idiag_src=inet_addr(\"%s\")"
|
||||
", idiag_dst=inet_addr(\"%s\")"
|
||||
@ -152,6 +154,23 @@ int main(void)
|
||||
},
|
||||
.role = SMC_CLNT
|
||||
};
|
||||
static const struct smcd_diag_dmbinfo dinfo = {
|
||||
.linkid = 0xdeadc0de,
|
||||
.peer_gid = 0xbefeededbadc0dedULL,
|
||||
.my_gid = 0xdeec0dedfacebeefULL,
|
||||
.token = 0xcafedecaffeedeedULL,
|
||||
.peer_token = 0xfeedfacebeeff00dULL,
|
||||
};
|
||||
static const struct smc_diag_fallback fb1 = {
|
||||
.reason = 0,
|
||||
.peer_diagnosis = 0x03020000,
|
||||
};
|
||||
static const struct smc_diag_fallback fb2 = {
|
||||
.reason = 0x03060000,
|
||||
.peer_diagnosis = 0x99999999,
|
||||
};
|
||||
static uint8_t sd1 = 0x23;
|
||||
static uint8_t sd2 = 0x40;
|
||||
|
||||
int fd = create_nl_socket(NETLINK_SOCK_DIAG);
|
||||
const unsigned int hdrlen = sizeof(struct smc_diag_msg);
|
||||
@ -162,6 +181,16 @@ int main(void)
|
||||
static char pattern[4096];
|
||||
fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1);
|
||||
|
||||
TEST_NLATTR_OBJECT(fd, nlh0, hdrlen,
|
||||
init_smc_diag_msg, print_smc_diag_msg,
|
||||
SMC_DIAG_SHUTDOWN, pattern, sd1,
|
||||
printf("RCV_SHUTDOWN|SEND_SHUTDOWN|0x20"));
|
||||
|
||||
TEST_NLATTR_OBJECT(fd, nlh0, hdrlen,
|
||||
init_smc_diag_msg, print_smc_diag_msg,
|
||||
SMC_DIAG_SHUTDOWN, pattern, sd2,
|
||||
printf("0x40 /* ???_SHUTDOWN */"));
|
||||
|
||||
TEST_NLATTR_OBJECT(fd, nlh0, hdrlen,
|
||||
init_smc_diag_msg, print_smc_diag_msg,
|
||||
SMC_DIAG_CONNINFO, pattern, cinfo,
|
||||
@ -192,12 +221,31 @@ int main(void)
|
||||
printf(", peer_gid=\"%s\"}", linfo.lnk[0].peer_gid);
|
||||
printf(", role=SMC_CLNT}"));
|
||||
|
||||
TEST_NLATTR_OBJECT(fd, nlh0, hdrlen,
|
||||
init_smc_diag_msg, print_smc_diag_msg,
|
||||
SMC_DIAG_DMBINFO, pattern, dinfo,
|
||||
PRINT_FIELD_U("{", dinfo, linkid);
|
||||
PRINT_FIELD_X(", ", dinfo, peer_gid);
|
||||
PRINT_FIELD_X(", ", dinfo, my_gid);
|
||||
PRINT_FIELD_X(", ", dinfo, token);
|
||||
PRINT_FIELD_X(", ", dinfo, peer_token);
|
||||
printf("}"));
|
||||
|
||||
TEST_NLATTR_OBJECT(fd, nlh0, hdrlen,
|
||||
init_smc_diag_msg, print_smc_diag_msg,
|
||||
SMC_DIAG_FALLBACK, pattern, fb1,
|
||||
printf("{reason=0 /* SMC_CLC_DECL_??? */");
|
||||
printf(", peer_diagnosis=0x3020000"
|
||||
" /* SMC_CLC_DECL_IPSEC */}"));
|
||||
|
||||
TEST_NLATTR_OBJECT(fd, nlh0, hdrlen,
|
||||
init_smc_diag_msg, print_smc_diag_msg,
|
||||
SMC_DIAG_FALLBACK, pattern, fb2,
|
||||
printf("{reason=0x3060000"
|
||||
" /* SMC_CLC_DECL_OPTUNSUPP */");
|
||||
printf(", peer_diagnosis=0x99999999"
|
||||
" /* SMC_CLC_DECL_??? */}"));
|
||||
|
||||
printf("+++ exited with 0 +++\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
SKIP_MAIN_UNDEFINED("AF_SMC")
|
||||
|
||||
#endif
|
||||
|
@ -82,18 +82,18 @@ test_syscall(const unsigned long nr)
|
||||
|
||||
#ifdef LINUX_MIPSO32
|
||||
printf("syscall(%#lx, %#lx, %#lx, %#lx, %#lx, %#lx, %#lx)"
|
||||
" = %ld ENOSYS (%m)\n", nr | SYSCALL_BIT,
|
||||
a[0], a[1], a[2], a[3], a[4], a[5], rc);
|
||||
" = %s\n", nr | SYSCALL_BIT,
|
||||
a[0], a[1], a[2], a[3], a[4], a[5], sprintrc(rc));
|
||||
#else
|
||||
printf("syscall_%#lx(%#llx, %#llx, %#llx, %#llx, %#llx, %#llx)"
|
||||
" = %ld ENOSYS (%m)\n", nr | SYSCALL_BIT,
|
||||
" = %s\n", nr | SYSCALL_BIT,
|
||||
(unsigned long long) a[0],
|
||||
(unsigned long long) a[1],
|
||||
(unsigned long long) a[2],
|
||||
(unsigned long long) a[3],
|
||||
(unsigned long long) a[4],
|
||||
(unsigned long long) a[5],
|
||||
rc);
|
||||
sprintrc(rc));
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -119,6 +119,7 @@ main(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
test_syscall(ARRAY_SIZE(syscallent));
|
||||
(void) syscallent; /* workaround for clang bug #33068 */
|
||||
|
||||
#ifdef SYS_socket_subcall
|
||||
test_syscall(SYS_socket_subcall + 1);
|
||||
|
@ -118,6 +118,7 @@ ioctl_kvm_run-v
|
||||
ioctl_kvm_run_auxstr_vcpu
|
||||
ioctl_loop
|
||||
ioctl_mtd
|
||||
ioctl_nbd
|
||||
ioctl_perf
|
||||
ioctl_ptp
|
||||
ioctl_rtc
|
||||
@ -455,6 +456,9 @@ userfaultfd
|
||||
ustat
|
||||
utime
|
||||
utimensat
|
||||
utimensat-Xabbrev
|
||||
utimensat-Xraw
|
||||
utimensat-Xverbose
|
||||
utimes
|
||||
vhangup
|
||||
vmsplice
|
||||
|
@ -54,9 +54,6 @@ sprintrc_ex(long rc, enum sprintrc_fmt fmt)
|
||||
};
|
||||
static char buf[4096];
|
||||
|
||||
if (fmt >= ARRAY_SIZE(formats))
|
||||
perror_msg_and_fail("sprintrc_ex: incorrect format provided");
|
||||
|
||||
if (rc == 0)
|
||||
return "0";
|
||||
|
||||
|
@ -1,7 +1,18 @@
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "stack-fcall.h"
|
||||
|
||||
int f3(int i)
|
||||
{
|
||||
return getpid() + i;
|
||||
static int pid;
|
||||
|
||||
switch (i) {
|
||||
case 1:
|
||||
return kill(pid, SIGURG);
|
||||
|
||||
default:
|
||||
return (pid = getpid()) + i;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
#include "stack-fcall.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int main(void)
|
||||
{
|
||||
f0(argc);
|
||||
f0(0);
|
||||
f0(1);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1 +1,2 @@
|
||||
(__kernel_vsyscall )?(__)?getpid ns::f3\(int\) ns::f2\(int\) ns::f1\(int\) ns::f0\(int\) main
|
||||
^getpid .*(__kernel_vsyscall )?(__)?getpid ns::f3\(int\) ns::f2\(int\) ns::f1\(int\) ns::f0\(int\) main
|
||||
^SIGURG .*(__kernel_vsyscall )?(__)?kill ns::f3\(int\) ns::f2\(int\) ns::f1\(int\) ns::f0\(int\) main
|
||||
|
@ -1 +1,2 @@
|
||||
(__kernel_vsyscall )?(__)?getpid f3 f2 f1 f0 main
|
||||
^getpid .*(__kernel_vsyscaln )?(__)?getpid f3 f2 f1 f0 main
|
||||
^SIGURG .*(__kernel_vsyscaln )?(__)?kill f3 f2 f1 f0 main
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user