linux_old1/arch
Alexei Starovoitov 89aa075832 net: sock: allow eBPF programs to be attached to sockets
introduce new setsockopt() command:

setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, &prog_fd, sizeof(prog_fd))

where prog_fd was received from syscall bpf(BPF_PROG_LOAD, attr, ...)
and attr->prog_type == BPF_PROG_TYPE_SOCKET_FILTER

setsockopt() calls bpf_prog_get() which increments refcnt of the program,
so it doesn't get unloaded while socket is using the program.

The same eBPF program can be attached to multiple sockets.

User task exit automatically closes socket which calls sk_filter_uncharge()
which decrements refcnt of eBPF program

Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-12-05 21:47:32 -08:00
..
alpha net: sock: allow eBPF programs to be attached to sockets 2014-12-05 21:47:32 -08:00
arc The "weak" attribute is commonly used for the default version of a 2014-10-23 15:04:27 -07:00
arm netpoll: delete defconfig references to obsolete NETPOLL_TRAP 2014-11-29 21:13:48 -08:00
arm64 arm64: KVM: Handle traps of ICC_SRE_EL1 as RAZ/WI 2014-11-26 14:40:43 +01:00
avr32 net: sock: allow eBPF programs to be attached to sockets 2014-12-05 21:47:32 -08:00
blackfin Merge branch 'for-3.18-consistent-ops' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2014-10-15 07:48:18 +02:00
c6x irq_work: Introduce arch_irq_work_has_interrupt() 2014-09-13 18:38:07 +02:00
cris net: sock: allow eBPF programs to be attached to sockets 2014-12-05 21:47:32 -08:00
frv net: sock: allow eBPF programs to be attached to sockets 2014-12-05 21:47:32 -08:00
hexagon Merge branch 'locking-arch-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-10-13 15:48:00 +02:00
ia64 net: sock: allow eBPF programs to be attached to sockets 2014-12-05 21:47:32 -08:00
m32r net: sock: allow eBPF programs to be attached to sockets 2014-12-05 21:47:32 -08:00
m68k m68k: Wire up bpf 2014-10-27 11:02:19 +01:00
metag Merge branch 'for-3.18-consistent-ops' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2014-10-15 07:48:18 +02:00
microblaze microblaze: Wire up bpf syscall 2014-10-27 09:25:34 +01:00
mips net: sock: allow eBPF programs to be attached to sockets 2014-12-05 21:47:32 -08:00
mn10300 net: sock: allow eBPF programs to be attached to sockets 2014-12-05 21:47:32 -08:00
openrisc Merge git://git.infradead.org/users/eparis/audit 2014-10-19 16:25:56 -07:00
parisc net: sock: allow eBPF programs to be attached to sockets 2014-12-05 21:47:32 -08:00
powerpc net: sock: allow eBPF programs to be attached to sockets 2014-12-05 21:47:32 -08:00
s390 net: sock: allow eBPF programs to be attached to sockets 2014-12-05 21:47:32 -08:00
score score: use Kbuild logic to include <asm-generic/sections.h> 2014-10-09 22:25:46 -04:00
sh sh: fix sh770x SCIF memory regions 2014-10-29 16:33:15 -07:00
sparc net: sock: allow eBPF programs to be attached to sockets 2014-12-05 21:47:32 -08:00
tile netpoll: delete defconfig references to obsolete NETPOLL_TRAP 2014-11-29 21:13:48 -08:00
um Merge git://git.infradead.org/users/eparis/audit 2014-10-19 16:25:56 -07:00
unicore32 nosave: consolidate __nosave_{begin,end} in <asm/sections.h> 2014-10-09 22:26:04 -04:00
x86 kvm: fix kvm_is_mmio_pfn() and rename to kvm_is_reserved_pfn() 2014-11-26 14:40:45 +01:00
xtensa net: sock: allow eBPF programs to be attached to sockets 2014-12-05 21:47:32 -08:00
.gitignore
Kconfig seccomp: Document two-phase seccomp and arch-provided seccomp_data 2014-09-03 14:58:17 -07:00