Skip to content

double-fix bpf_test_run + XDP_PASS recycling

Alexander Lobakin bpf lkml netdev 1 version Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 6 repliesApplied 2/2

Patches in v1 All 2 applied

#Subject and filesSizeRepliesApplied
1/2bpf, test_run: fix crashes due to XDP frame overwriting/corruptionnet/bpf/test_run.c+11 -12 repliesApplied
2/2selftests/bpf: fix "metadata marker" getting overwritten by the netstacktools/testing/selftests/bpf/prog_tests/xdp_do_redirect.c tools/testing/selftests/bpf/progs/test_xdp_do_redirect.c+5 -44 repliesApplied

Reviews trailers per patch

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

PatchToke Høiland-JørgensenIlya Leoshkevich
1/2A-b T-b
2/2A-b T-b

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

Read the v1 thread

Cover letter [PATCH bpf-next 0/2] double-fix bpf_test_run + XDP_PASS recycling

Enabling skb PP recycling revealed a couple issues in the bpf_test_run code. Recycling broke the assumption that the headroom won't ever be touched during the test_run execution: xdp_scrub_frame() invalidates the XDP frame at the headroom start, while neigh xmit code overwrites 2 bytes to the left of the Ethernet header. The first makes the kernel panic in certain cases, while the second breaks xdp_do_redirect selftest on BE. test_run is a limited-scope entity, so let's hope no more corner cases will happen here or at least they will be as easy and pleasant to fix as those two.

Alexander Lobakin (2):
bpf, test_run: fix crashes due to XDP frame overwriting/corruption selftests/bpf: fix "metadata marker" getting overwritten by the
netstack

 net/bpf/test_run.c                                   | 12 +++++++++++-
 .../selftests/bpf/prog_tests/xdp_do_redirect.c       |  7 ++++---
 .../selftests/bpf/progs/test_xdp_do_redirect.c       |  2 +-
 3 files changed, 16 insertions(+), 5 deletions(-)
Signature · 1 line
2.39.2