]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/bpf: test_xsk: fix memory leak in testapp_xdp_shared_umem()
authorBastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>
Fri, 31 Oct 2025 08:04:41 +0000 (09:04 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 31 Oct 2025 16:24:38 +0000 (09:24 -0700)
commitbea4f03897c03013ace2f1257dfb3b1ec832ba07
tree5627a9fdde6cd1e245507e7def941b932409f3b8
parentd66e49ffa020ff60565d80451a19f36a510f2aea
selftests/bpf: test_xsk: fix memory leak in testapp_xdp_shared_umem()

testapp_xdp_shared_umem() generates pkt_stream on each xsk from xsk_arr,
where normally xsk_arr[0] gets pkt_streams and xsk_arr[1] have them NULLed.
At the end of the test pkt_stream_restore_default() only releases
xsk_arr[0] which leads to memory leaks.

Release the missing pkt_stream at the end of testapp_xdp_shared_umem()

Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Bastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>
Link: https://lore.kernel.org/r/20251031-xsk-v7-5-39fe486593a3@bootlin.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/test_xsk.c