summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJakub Sitnicki <jakub@cloudflare.com>2020-05-21 10:34:35 +0200
committerAlexei Starovoitov <ast@kernel.org>2020-05-21 17:52:45 -0700
commit5cf65922bb15279402e1e19b5ee8c51d618fa51f (patch)
tree1e1ec83eaedcf0e2e973f9cf32d37de8fb8e3264 /drivers
parentdfeb376dd4cb2c5004aeb625e2475f58a5ff2ea7 (diff)
downloadlinux-5cf65922bb15279402e1e19b5ee8c51d618fa51f.tar.bz2
flow_dissector: Drop BPF flow dissector prog ref on netns cleanup
When attaching a flow dissector program to a network namespace with bpf(BPF_PROG_ATTACH, ...) we grab a reference to bpf_prog. If netns gets destroyed while a flow dissector is still attached, and there are no other references to the prog, we leak the reference and the program remains loaded. Leak can be reproduced by running flow dissector tests from selftests/bpf: # bpftool prog list # ./test_flow_dissector.sh ... selftests: test_flow_dissector [PASS] # bpftool prog list 4: flow_dissector name _dissect tag e314084d332a5338 gpl loaded_at 2020-05-20T18:50:53+0200 uid 0 xlated 552B jited 355B memlock 4096B map_ids 3,4 btf_id 4 # Fix it by detaching the flow dissector program when netns is going away. Fixes: d58e468b1112 ("flow_dissector: implements flow dissector BPF hook") Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Reviewed-by: Stanislav Fomichev <sdf@google.com> Link: https://lore.kernel.org/bpf/20200521083435.560256-1-jakub@cloudflare.com
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions