bpf, sockmap: Restrict iter-context sockmap updates to sockmap iterators
Status from this message: This series was applied to bpf/bpf.git (master)
Get series with b4
b4 am [email protected] change-id 20261008-sockmap-update-limit-iter-d03ea25f9775Versions newest first
- v3 Latest8 patches 6 repliesApplied 8/8
- v2 RFC4 patches 1 replySuperseded
- v13 patches 9 repliesSuperseded
Changes in v3 from the cover letter
- Drop RFC prefix
- Update bpf_iter_reg::feature docs
- Fix tcp_request_sock BTF build error
- Restrict allowed callers of bpf_sock_destroy() to iter/{tcp,udp} (Alexei)
- Link to v2: https://patch.msgid.link/[email protected]
Patches in v3 All 8 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | selftests/bpf: Remove sockmap update from bpf_iter_unixtools/ | +0 | 1 reply | Applied |
| 2/8 | bpf, sockmap: Restrict iter-context sockmap updates to iter/sockmapkernel/ | +3 | 1 reply | Applied |
| 3/8 | selftests/bpf: Add negative test for sockmap update from non-sockmap itertools/ | +14 | 0 replies | Applied |
| 4/8 | bpf, docs: Document BPF_ITER_NOSLEEPDocumentation/ | +9 | 0 replies | Applied |
| 5/8 | bpf: Restrict bpf_sock_destroy() to iter/{tcp,udp}net/ | +10 | 0 replies | Applied |
| 6/8 | bpf: Mark bpf_iter__sockmap::sk as PTR_TRUSTEDnet/ | +1 | 0 replies | Applied |
| 7/8 | selftests/bpf: Add iter/sockmap bpf_sock_destroy() negative testtools/ | +11 | 0 replies | Applied |
| 8/8 | bpf: Fix "unresolved symbol tcp_request_sock" build errornet/ | +4 | 1 reply | Applied |
Reviews trailers per patch
2 of 8 patches have a Reviewed-by or Acked-by.
| Patch | Jiayuan Chen |
|---|---|
| 1/8 | R-b |
| 2/8 | R-b |
| 3/8 | |
| 4/8 | |
| 5/8 | |
| 6/8 | |
| 7/8 | |
| 8/8 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH bpf-next v3 0/8] bpf, sockmap: Restrict iter-context sockmap updates to sockmap iterators
Follow-up to Sashiko's report [1] and the decision to restrict which iterator may perform sockmap updates [2]. Series started short: remove about-to-be-stale test, restrict updates, add a negative test. Then it
expanded: mark bpf_iter__sockmap::sk as PTR_TRUSTED, restrict bpf_sock_destroy() callers to iter/{tcp,udp}, few little tweaks.
[1]: https://msgid.link/[email protected]
[2]: https://msgid.link/[email protected]
---
Changes in v3:
- Drop RFC prefix
- Update bpf_iter_reg::feature docs
- Fix tcp_request_sock BTF build error
- Restrict allowed callers of bpf_sock_destroy() to iter/{tcp,udp} (Alexei)
- Link to v2: https://patch.msgid.link/[email protected]
Changes in v2:
- Commit 7cc639dc45c5 ("bpf: Don't take an extension for an iterator
program") and commit b83bacf2161d ("bpf: Don't take a program with a
target program for an iterator") landed. Drop the redundant
env->prog->type check.
- Mark bpf_iter__sockmap::sk as PTR_TRUSTED (Alexei)
- Link to v1: https://patch.msgid.link/[email protected]
To: Alexei Starovoitov <[email protected]>
To: Daniel Borkmann <[email protected]>
To: Andrii Nakryiko <[email protected]>
To: Eduard Zingerman <[email protected]>
To: Kumar Kartikeya Dwivedi <[email protected]>
To: Martin KaFai Lau <[email protected]>
To: Song Liu <[email protected]>
To: Yonghong Song <[email protected]>
To: Jiri Olsa <[email protected]>
To: Emil Tsalapatis <[email protected]>
To: Ihor Solodrai <[email protected]>
To: Shuah Khan <[email protected]>
To: John Fastabend <[email protected]>
To: Eric Dumazet <[email protected]>
To: Kuniyuki Iwashima <[email protected]>
To: Paolo Abeni <[email protected]>
To: Willem de Bruijn <[email protected]>
To: Jakub Sitnicki <[email protected]>
To: Jiayuan Chen <[email protected]>
To: "David S. Miller" <[email protected]>
To: Jakub Kicinski <[email protected]>
To: Simon Horman <[email protected]>
To: Jonathan Corbet <[email protected]>
To: Shuah Khan <[email protected]>
To: Randy Dunlap <[email protected]>
To: Stanislav Fomichev <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
Michal Luczaj (8):
selftests/bpf: Remove sockmap update from bpf_iter_unix
bpf, sockmap: Restrict iter-context sockmap updates to iter/sockmap selftests/bpf: Add negative test for sockmap update from non-sockmap iter bpf, docs: Document BPF_ITER_NOSLEEP
bpf: Restrict bpf_sock_destroy() to iter/{tcp,udp}
bpf: Mark bpf_iter__sockmap::sk as PTR_TRUSTED selftests/bpf: Add iter/sockmap bpf_sock_destroy() negative test
bpf: Fix "unresolved symbol tcp_request_sock" build error
Documentation/bpf/bpf_iterators.rst | 12 +++++++++--- kernel/bpf/verifier.c | 4 +++- net/core/filter.c | 15 ++++++++++++++- net/core/sock_map.c | 2 +- tools/testing/selftests/bpf/progs/bpf_iter_unix.c | 10 ---------- .../testing/selftests/bpf/progs/sock_destroy_prog_fail.c | 11 +++++++++++ .../testing/selftests/bpf/progs/verifier_sockmap_mutate.c | 14 ++++++++++++++ 7 files changed, 52 insertions(+), 16 deletions(-)
---
base-commit: 2d0b457611c06304138754a05e0873cc18acfb7e
change-id: 20261008-sockmap-update-limit-iter-d03ea25f9775
Best regards,
Signature · 1 line
Michal Luczaj <[email protected]>