Skip to content

bpf: guard sock_ops rtt_min against non-locked tcp_sock

Werner Kasselman bpf linux-kselftest lkml netdev stable 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest2 patches 2 repliesIn review
  2. v42 patches 0 repliesSuperseded

Changes in v5 from the cover letter

- rebase onto current origin/master to address CI conflict
- no functional changes beyond the rebase

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2bpf: guard sock_ops rtt_min against non-locked tcp_socknet/core/filter.c+18 -181 reply
2/2selftests/bpf: cover same-reg sock_ops rtt_min request_sock accesstools/testing/selftests/bpf/prog_tests/tcpbpf_user.c tools/testing/selftests/bpf/progs/test_tcpbpf_kern.c tools/testing/selftests/bpf/test_tcpbpf.h+20 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH bpf v5 0/2] bpf: guard sock_ops rtt_min against non-locked tcp_sock

sock_ops ctx rewriting guards the direct tcp_sock field loads with is_locked_tcp_sock, but rtt_min still used a raw load sequence. On request_sock-backed sock_ops callbacks, that can read past the end of a tcp_request_sock allocation.

This series switches rtt_min over to the shared guarded tcp_sock field load helper and adds a tcpbpf runtime test that exercises the same-register request_sock path.

v4 -> v5:
- rebase onto current origin/master to address CI conflict
- no functional changes beyond the rebase

Werner Kasselman (2):
bpf: guard sock_ops rtt_min against non-locked tcp_sock selftests/bpf: cover same-reg sock_ops rtt_min request_sock access

 net/core/filter.c                             | 36 +++++++++----------
 .../selftests/bpf/prog_tests/tcpbpf_user.c    |  4 +++
 .../selftests/bpf/progs/test_tcpbpf_kern.c    | 14 ++++++++
 tools/testing/selftests/bpf/test_tcpbpf.h     |  2 ++
 4 files changed, 38 insertions(+), 18 deletions(-)
Signature · 1 line
2.43.0