Skip to content

bpf, sockmap: disallow sockmap mutation from tc, xdp, socket_filter and flow_dissector

Sechang Lim bpf linux-kselftest lkml netdev 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 4 repliesIn review 1 of 2 applied
  2. v32 patches 3 repliesSuperseded
  3. v21 patch 1 replySuperseded

Changes in v4 from the cover letter

- also drop BPF_PROG_TYPE_SOCKET_FILTER (John Fastabend)

Patches in v4 1 of 2 applied

#Subject and filesSizeRepliesApplied
1/2bpf, sockmap: disallow update and delete from tc, xdp, socket_filter and flow_dissectorkernel/bpf/verifier.c+0 -52 repliesApplied
2/2selftests/bpf: drop tc/xdp/flow_dissector/socket_filter sockmap mutation teststools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c tools/testing/selftests/bpf/prog_tests/sockmap_basic.c tools/testing/selftests/bpf/progs/freplace_cls_redirect.c +2 more+6 -1532 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchJohn FastabendEmil Tsalapatis
1/2R-b R-b
2/2R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH bpf-next v4 0/2] bpf, sockmap: disallow sockmap mutation from tc, xdp, socket_filter and flow_dissector

A tc, xdp, socket_filter or flow_dissector program updating or deleting a sockmap deadlocks on stab->lock vs sk_callback_lock and has no reason to. Patch 1 disallows it in may_update_sockmap(); patch 2 drops the selftests that exercised it.

v4:
- also drop BPF_PROG_TYPE_SOCKET_FILTER (John Fastabend)

v3:
- https://lore.kernel.org/all/[email protected]/

v2:
- https://lore.kernel.org/all/[email protected]/

v1:
- https://lore.kernel.org/all/[email protected]/

Sechang Lim (2):
bpf, sockmap: disallow update and delete from tc, xdp, socket_filter
and flow_dissector
selftests/bpf: drop tc/xdp/flow_dissector/socket_filter sockmap
mutation tests

 kernel/bpf/verifier.c                         |  5 --
 .../selftests/bpf/prog_tests/fexit_bpf2bpf.c  | 13 -----
 .../selftests/bpf/prog_tests/sockmap_basic.c  | 52 -------------------
 .../bpf/progs/freplace_cls_redirect.c         | 34 ------------
 .../selftests/bpf/progs/test_sockmap_update.c | 48 -----------------
 .../bpf/progs/verifier_sockmap_mutate.c       | 12 ++---
 6 files changed, 6 insertions(+), 158 deletions(-)
 delete mode 100644 tools/testing/selftests/bpf/progs/freplace_cls_redirect.c
 delete mode 100644 tools/testing/selftests/bpf/progs/test_sockmap_update.c
Signature · 1 line
2.43.0