kernel-fxtec-pro1x/include/uapi/linux
Tycho Andersen f8e529ed94 seccomp, ptrace: add support for dumping seccomp filters
This patch adds support for dumping a process' (classic BPF) seccomp
filters via ptrace.

PTRACE_SECCOMP_GET_FILTER allows the tracer to dump the user's classic BPF
seccomp filters. addr should be an integer which represents the ith seccomp
filter (0 is the most recently installed filter). data should be a struct
sock_filter * with enough room for the ith filter, or NULL, in which case
the filter is not saved. The return value for this command is the number of
BPF instructions the program represents, or negative in the case of errors.
Command specific errors are ENOENT: which indicates that there is no ith
filter in this seccomp tree, and EMEDIUMTYPE, which indicates that the ith
filter was not installed as a classic BPF filter.

A caveat with this approach is that there is no way to get explicitly at
the heirarchy of seccomp filters, and users need to memcmp() filters to
decide which are inherited. This means that a task which installs two of
the same filter can potentially confuse users of this interface.

v2: * make save_orig const
    * check that the orig_prog exists (not necessary right now, but when
       grows eBPF support it will be)
    * s/n/filter_off and make it an unsigned long to match ptrace
    * count "down" the tree instead of "up" when passing a filter offset

v3: * don't take the current task's lock for inspecting its seccomp mode
    * use a 0x42** constant for the ptrace command value

v4: * don't copy to userspace while holding spinlocks

v5: * add another condition to WARN_ON

v6: * rebase on net-next

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Kees Cook <keescook@chromium.org>
CC: Will Drewry <wad@chromium.org>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
CC: Andy Lutomirski <luto@amacapital.net>
CC: Pavel Emelyanov <xemul@parallels.com>
CC: Serge E. Hallyn <serge.hallyn@ubuntu.com>
CC: Alexei Starovoitov <ast@kernel.org>
CC: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-10-27 19:55:13 -07:00
..
android
byteorder
caif
can can: avoid using timeval for uapi 2015-10-13 17:42:34 +02:00
cifs
dvb
genwqe
hdlc
hsi
iio
isdn
mmc
netfilter netfilter: nfnetlink_log: allow to attach conntrack 2015-10-05 17:32:14 +02:00
netfilter_arp
netfilter_bridge
netfilter_ipv4
netfilter_ipv6 netfilter: ip6t_REJECT: added missing icmpv6 codes 2015-08-26 20:32:35 +02:00
nfsd
raid
spi
sunrpc
tc_act
tc_ematch
usb cdc: add header guards 2015-09-15 21:53:24 -07:00
wimax
a.out.h
acct.h
adb.h
adfs_fs.h
affs_hardblocks.h
agpgart.h
aio_abi.h
am437x-vpfe.h
apm_bios.h
arcfb.h
atalk.h
atm.h
atm_eni.h
atm_he.h
atm_idt77105.h
atm_nicstar.h
atm_tcp.h
atm_zatm.h atm: remove 'struct zatm_t_hist' 2015-10-05 03:16:46 -07:00
atmapi.h
atmarp.h
atmbr2684.h
atmclip.h
atmdev.h
atmioc.h
atmlec.h
atmmpc.h
atmppp.h
atmsap.h
atmsvc.h
audit.h Merge branch 'upstream' of git://git.infradead.org/users/pcmoore/audit 2015-09-08 13:34:59 -07:00
auto_fs.h
auto_fs4.h
auxvec.h
ax25.h
b1lli.h
baycom.h
bcache.h
bcm933xx_hcs.h
bfs_fs.h
binfmts.h
blkpg.h
blktrace_api.h
bpf.h bpf: introduce bpf_perf_event_output() helper 2015-10-22 06:42:15 -07:00
bpf_common.h
bpqether.h
bsg.h
btrfs.h
can.h
capability.h
capi.h
cciss_defs.h
cciss_ioctl.h
cdrom.h
cgroupstats.h
chio.h
cm4000_cs.h
cn_proc.h
coda.h
coda_psdev.h
coff.h
connector.h
const.h
cramfs_fs.h
cryptouser.h
cuda.h
cyclades.h
cycx_cfm.h
dcbnl.h
dccp.h
dlm.h
dlm_device.h dlm: fix lvb copy for user locks 2015-08-25 14:41:50 -05:00
dlm_netlink.h
dlm_plock.h
dlmconstants.h
dm-ioctl.h dm stats: report precise_timestamps and histogram in @stats_list output 2015-08-18 17:20:03 -04:00
dm-log-userspace.h
dn.h
dqblk_xfs.h
edd.h
efs_fs_sb.h
elf-em.h elf-em.h: move EM_MICROBLAZE to the common header 2015-09-10 06:54:15 +02:00
elf-fdpic.h
elf.h
elfcore.h
errno.h
errqueue.h
ethtool.h
eventpoll.h
fadvise.h
falloc.h
fanotify.h
fb.h
fcntl.h
fd.h
fdreg.h
fib_rules.h
fiemap.h
filter.h
firewire-cdev.h
firewire-constants.h
flat.h
fou.h
fs.h
fsl_hypervisor.h
fuse.h
futex.h
gameport.h
gen_stats.h
genetlink.h
gfs2_ondisk.h
gigaset_dev.h
gsmmux.h tty: linux/gsmmux.h needs linux/types.h 2015-07-23 17:48:43 -07:00
hash_info.h
hdlc.h
hdlcdrv.h
hdreg.h
hid.h
hiddev.h
hidraw.h
hpet.h
hsr_netlink.h
hw_breakpoint.h
hyperv.h
hysdn_if.h
i2c-dev.h
i2c.h
i2o-dev.h
i8k.h
icmp.h
icmpv6.h
if.h
if_addr.h
if_addrlabel.h
if_alg.h
if_arcnet.h arcnet: fix indentation of if_arcnet.h 2015-09-23 08:44:22 +02:00
if_arp.h
if_bonding.h
if_bridge.h bridge: vlan: add per-vlan struct and move to rhashtables 2015-09-29 13:36:06 -07:00
if_cablemodem.h
if_eql.h
if_ether.h ether: add IEEE 1722 ethertype - TSN 2015-09-09 22:06:29 -07:00
if_fc.h
if_fddi.h
if_frad.h
if_hippi.h
if_infiniband.h
if_link.h if_link: Add control trust VF 2015-10-23 05:44:28 -07:00
if_ltalk.h
if_packet.h packet: add extended BPF fanout mode 2015-08-17 14:22:48 -07:00
if_phonet.h
if_plip.h
if_ppp.h
if_pppol2tp.h
if_pppox.h
if_slip.h
if_team.h
if_tun.h
if_tunnel.h ip_gre: Add support to collect tunnel metadata. 2015-08-10 14:03:54 -07:00
if_vlan.h
if_x25.h
igmp.h
ila.h net: Identifier Locator Addressing module 2015-08-17 21:33:06 -07:00
in.h
in6.h
in_route.h
inet_diag.h
inotify.h
input.h
ioctl.h
ip.h
ip6_tunnel.h
ip_vs.h ipvs: add more mcast parameters for the sync daemon 2015-08-21 09:10:11 -07:00
ipc.h
ipmi.h
ipmi_msgdefs.h
ipsec.h
ipv6.h net: ipv6 sysctl option to ignore routes when nexthop link is down 2015-08-13 21:27:19 -07:00
ipv6_route.h
ipx.h
irda.h
irqnr.h
isdn.h
isdn_divertif.h
isdn_ppp.h
isdnif.h
iso_fs.h
ivtv.h
ivtvfb.h
ixjuser.h
jffs2.h
joystick.h
Kbuild uapi: add mpls_iptunnel.h 2015-10-18 22:40:04 -07:00
kcmp.h
kd.h
kdev_t.h
kernel-page-flags.h proc: export idle flag via kpageflags 2015-09-10 13:29:01 -07:00
kernel.h
kernelcapi.h
kexec.h
keyboard.h
keyctl.h
kfd_ioctl.h
kvm.h Patch queue for ppc - 2015-08-22 2015-08-22 14:57:59 -07:00
kvm_para.h
l2tp.h
libc-compat.h
limits.h
llc.h
loop.h
lp.h
lwtunnel.h lwtunnel: remove source and destination UDP port config option 2015-09-24 14:31:37 -07:00
magic.h
major.h
map_to_7segment.h
matroxfb.h
mdio.h
media-bus-format.h
media.h
mei.h mei: add async event notification ioctls 2015-08-03 17:30:00 -07:00
membarrier.h sys_membarrier(): system-wide memory barrier (generic, x86) 2015-09-11 15:21:34 -07:00
memfd.h
mempolicy.h
meye.h
mic_common.h
mic_ioctl.h
mii.h
minix_fs.h
mman.h
mmtimer.h
module.h
mpls.h mpls: Use definition for reserved label checks 2015-08-03 22:35:00 -07:00
mpls_iptunnel.h
mqueue.h
mroute.h
mroute6.h
msdos_fs.h
msg.h
mtio.h
n_r3964.h
nbd.h
ncp.h
ncp_fs.h
ncp_mount.h
ncp_no.h
ndctl.h libnvdimm: Add DSM support for Address Range Scrub commands 2015-07-27 22:53:19 -04:00
neighbour.h net: add explicit logging and stat for neighbour table overflow 2015-08-10 13:46:21 -07:00
net.h
net_dropmon.h
net_namespace.h
net_tstamp.h
netconf.h
netdevice.h
netfilter.h
netfilter_arp.h
netfilter_bridge.h
netfilter_decnet.h
netfilter_ipv4.h
netfilter_ipv6.h
netlink.h net: Add support for filtering neigh dump by master device 2015-09-29 21:33:54 -07:00
netlink_diag.h
netrom.h
nfc.h
nfs.h
nfs2.h
nfs3.h
nfs4.h NFS: Update NFS4_BITMAP_SIZE 2015-08-27 19:44:53 -04:00
nfs4_mount.h
nfs_fs.h
nfs_idmap.h
nfs_mount.h
nfsacl.h
nl80211.h cfg80211: Add multiple scan plans for scheduled scan 2015-10-13 10:35:26 +02:00
nubus.h
nvme.h NVMe: Add nvme subsystem reset IOCTL 2015-08-18 11:56:13 -06:00
nvram.h
omap3isp.h
omapfb.h
oom.h
openvswitch.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-10-24 06:54:12 -07:00
packet_diag.h
param.h
parport.h
patchkey.h
pci.h
pci_regs.h
perf_event.h bpf: introduce bpf_perf_event_output() helper 2015-10-22 06:42:15 -07:00
personality.h
pfkeyv2.h
pg.h
phantom.h
phonet.h
pkt_cls.h bpf: add bpf_redirect() helper 2015-09-17 21:09:07 -07:00
pkt_sched.h
pktcdvd.h
pmu.h
poll.h
posix_types.h
ppdev.h
ppp-comp.h
ppp-ioctl.h
ppp_defs.h
pps.h
prctl.h capabilities: ambient capabilities 2015-09-04 16:54:41 -07:00
psci.h
ptp_clock.h
ptrace.h seccomp, ptrace: add support for dumping seccomp filters 2015-10-27 19:55:13 -07:00
qnx4_fs.h
qnxtypes.h
quota.h
radeonfb.h
random.h
raw.h
rds.h
reboot.h
reiserfs_fs.h
reiserfs_xattr.h
resource.h
rfkill.h
romfs_fs.h
rose.h
route.h
rtc.h
rtnetlink.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-10-20 06:08:27 -07:00
scc.h
sched.h
scif_ioctl.h
screen_info.h
sctp.h
sdla.h
seccomp.h
securebits.h capabilities: add a securebit to disable PR_CAP_AMBIENT_RAISE 2015-09-04 16:54:41 -07:00
selinux_netlink.h
sem.h
serial.h
serial_core.h
serial_reg.h
serio.h
shm.h
signal.h
signalfd.h
smiapp.h
snmp.h
sock_diag.h
socket.h
sockios.h
sonet.h
sonypi.h
sound.h
soundcard.h
stat.h
stddef.h
string.h
suspend_ioctls.h
swab.h
synclink.h
sysctl.h
sysinfo.h
target_core_user.h target: use stringify.h instead of own definition 2015-09-11 00:32:36 -07:00
taskstats.h
tcp.h
tcp_metrics.h
telephony.h
termios.h
thermal.h
time.h
times.h
timex.h
tiocl.h
tipc.h
tipc_config.h
tipc_netlink.h
toshiba.h toshiba_acpi: Add /dev/toshiba_acpi device 2015-07-24 14:15:10 -07:00
tty.h
tty_flags.h
types.h
udf_fs_i.h
udp.h
uhid.h
uinput.h
uio.h
ultrasound.h
un.h
unistd.h
unix_diag.h
usbdevice_fs.h
usbip.h
userfaultfd.h userfaultfd: remove kernel header include from uapi header 2015-10-01 21:42:35 -04:00
utime.h
utsname.h
uuid.h
uvcvideo.h
v4l2-common.h
v4l2-controls.h
v4l2-dv-timings.h
v4l2-mediabus.h
v4l2-subdev.h
veth.h
vfio.h
vhost.h
videodev2.h
virtio_9p.h
virtio_balloon.h
virtio_blk.h
virtio_config.h
virtio_console.h
virtio_gpu.h
virtio_ids.h
virtio_input.h
virtio_net.h
virtio_pci.h
virtio_ring.h
virtio_rng.h
virtio_scsi.h
virtio_types.h
vm_sockets.h
vsp1.h
vt.h
wait.h
wanrouter.h
watchdog.h
wil6210_uapi.h
wimax.h
wireless.h
x25.h
xattr.h
xfrm.h
xilinx-v4l2-controls.h
zorro.h
zorro_ids.h