]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: introduce new program type for skbs on sockets
authorJohn Fastabend <john.fastabend@gmail.com>
Wed, 16 Aug 2017 05:31:58 +0000 (22:31 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Aug 2017 18:27:53 +0000 (11:27 -0700)
commit77baef5e0caf3b6c05278074c580cd32c1217492
treee0b7da0870e0d683955f4d999aafdb71ac63afdb
parent678b69b229b221b470a156f549e650a4e148dd16
bpf: introduce new program type for skbs on sockets

A class of programs, run from strparser and soon from a new map type
called sock map, are used with skb as the context but on established
sockets. By creating a specific program type for these we can use
bpf helpers that expect full sockets and get the verifier to ensure
these helpers are not used out of context.

The new type is BPF_PROG_TYPE_SK_SKB. This patch introduces the
infrastructure and type.

Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/bpf_types.h
include/uapi/linux/bpf.h
net/core/filter.c