]> Gentwo Git Trees - linux/.git/commit
selftests/bpf: Fix count write in testapp_xdp_metadata_copy()
authorRicardo B. Marlière <rbm@suse.com>
Fri, 29 Aug 2025 19:33:49 +0000 (16:33 -0300)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 3 Sep 2025 23:46:36 +0000 (16:46 -0700)
commitc9110e6f7237f4a314e2b87b75a8a158b9877a7b
treeb5ada3d6fc0d8cd7c66bdd3909edd4440780c1a3
parent2a912258c90e895363c0ffc0be8a47f112ab67b7
selftests/bpf: Fix count write in testapp_xdp_metadata_copy()

Commit 4b302092553c ("selftests/xsk: Add tail adjustment tests and support
check") added a new global to xsk_xdp_progs.c, but left out the access in
the testapp_xdp_metadata_copy() function. Since bpf_map_update_elem() will
write to the whole bss section, it gets truncated. Fix by writing to
skel_rx->bss->count directly.

Fixes: 4b302092553c ("selftests/xsk: Add tail adjustment tests and support check")
Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250829-selftests-bpf-xsk_regression_fix-v1-1-5f5acdb9fe6b@suse.com
tools/testing/selftests/bpf/xskxceiver.c