]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests: drv-net: Reload pkt pointer after calling filter_udphdr
authorAmery Hung <ameryhung@gmail.com>
Thu, 25 Sep 2025 16:14:52 +0000 (09:14 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 26 Sep 2025 20:54:46 +0000 (13:54 -0700)
commit11ae737efea10a8cc1c48b6288bde93180946b8c
tree061883d74a50ed85b3a16a2a7ad4bb81ae9a689e
parentdd5629a67c5f3b4d9783dcdf06c844f8b7c88fae
selftests: drv-net: Reload pkt pointer after calling filter_udphdr

Fix a verification failure. filter_udphdr() calls bpf_xdp_pull_data(),
which will invalidate all pkt pointers. Therefore, all ctx->data loaded
before filter_udphdr() cannot be used. Reload it to prevent verification
errors.

The error may not appear on some compiler versions if they decide to
load ctx->data after filter_udphdr() when it is first used.

Fixes: efec2e55bdef ("selftests: drv-net: Pull data before parsing headers")
Signed-off-by: Amery Hung <ameryhung@gmail.com>
Acked-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/20250925161452.1290694-1-ameryhung@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/lib/xdp_native.bpf.c