History

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.

John Fastabend committed 9 years ago

Commit b005fd11 parent db5980d3 files · +38 −0Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/bpf.h+1−0
@@ -127,6 +127,7 @@ enum bpf_prog_type { · 126 unmodified lines
127127 BPF_PROG_TYPE_LWT_OUT,
128128 BPF_PROG_TYPE_LWT_XMIT,
129129 BPF_PROG_TYPE_SOCK_OPS,
130+ BPF_PROG_TYPE_SK_SKB,
130131 };
131132
132133 enum bpf_attach_type {