linux-stable/tools/lib
lic121 adc4a1ed13 libbpf: Unmap rings when umem deleted
[ Upstream commit 9c6e6a80ee ]

xsk_umem__create() does mmap for fill/comp rings, but xsk_umem__delete()
doesn't do the unmap. This works fine for regular cases, because
xsk_socket__delete() does unmap for the rings. But for the case that
xsk_socket__create_shared() fails, umem rings are not unmapped.

fill_save/comp_save are checked to determine if rings have already be
unmapped by xsk. If fill_save and comp_save are NULL, it means that the
rings have already been used by xsk. Then they are supposed to be
unmapped by xsk_socket__delete(). Otherwise, xsk_umem__delete() does the
unmap.

Fixes: 2f6324a393 ("libbpf: Support shared umems between queues and devices")
Signed-off-by: Cheng Li <lic121@chinatelecom.cn>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220301132623.GA19995@vscode.7~
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-08 14:23:38 +02:00
..
api
bpf libbpf: Unmap rings when umem deleted 2022-04-08 14:23:38 +02:00
lockdep
perf libperf tests: Fix test_stat_cpu 2021-10-14 15:41:35 -03:00
subcmd libsubcmd: Fix use-after-free for realloc(..., 0) 2022-02-23 12:03:12 +01:00
symbol
traceevent
argv_split.c
bitmap.c
ctype.c
find_bit.c
hweight.c
rbtree.c
str_error_r.c
string.c
vsprintf.c
zalloc.c