bpf/flow_dissector: add mode to enforce global BPF flow dissector
authorStanislav Fomichev <sdf@google.com>
Mon, 7 Oct 2019 16:21:02 +0000 (09:21 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 8 Oct 2019 03:16:33 +0000 (20:16 -0700)
commita11c397c43d5b27491aa2f36276713cf151a4735
tree476fdf9ca012d3b72a41e2d0904282ce1801df18
parent4564a8bb57e4240c08ce2db5194bfa2e71f57730
bpf/flow_dissector: add mode to enforce global BPF flow dissector

Always use init_net flow dissector BPF program if it's attached and fall
back to the per-net namespace one. Also, deny installing new programs if
there is already one attached to the root namespace.
Users can still detach their BPF programs, but can't attach any
new ones (-EEXIST).

Cc: Petar Penkov <ppenkov@google.com>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Documentation/bpf/prog_flow_dissector.rst
net/core/flow_dissector.c