linux-stable/tools/lib
Ian Rogers a3db90398a selftests/xsk: Avoid use-after-free on ctx
[ Upstream commit af515a5587 ]

The put lowers the reference count to 0 and frees ctx, reading it
afterwards is invalid. Move the put after the uses and determine the
last use by the reference count being 1.

Fixes: 39e940d4ab ("selftests/xsk: Destroy BPF resources only when ctx refcount drops to 0")
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Magnus Karlsson <magnus.karlsson@intel.com>
Link: https://lore.kernel.org/bpf/20220901202645.1463552-1-irogers@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-24 09:57:08 +02:00
..
api Kbuild updates for v5.18 2022-03-31 11:59:03 -07:00
bpf selftests/xsk: Avoid use-after-free on ctx 2022-10-24 09:57:08 +02:00
perf libperf evlist: Fix polling of system-wide events 2022-09-28 11:32:04 +02:00
subcmd libsubcmd: Fix OPTION_GROUP sorting 2022-04-22 12:32:01 +02:00
symbol libsymbols kallsyms: Move hex2u64 out of header 2020-05-05 16:35:32 -03:00
thermal tools/lib/thermal: remove unneeded semicolon 2022-05-19 12:11:52 +02:00
traceevent libtraceevent: Add __rel_loc relative location attribute support 2021-12-06 15:37:22 -05:00
argv_split.c
bitmap.c bitmap: Fix return values to be unsigned 2022-06-03 06:52:58 -07:00
ctype.c
find_bit.c tools: sync tools/bitmap with mother linux 2022-01-15 08:47:31 -08:00
hweight.c
list_sort.c tools lib: Adopt list_sort() from the kernel sources 2021-10-20 10:30:59 -03:00
rbtree.c tools/: replace HTTP links with HTTPS ones 2020-08-07 11:33:21 -07:00
slab.c tools: Move gfp.h and slab.h from radix-tree to lib 2022-02-20 08:44:37 +02:00
str_error_r.c
string.c tools lib: Adopt memchr_inv() from kernel 2020-11-27 08:34:52 -03:00
vsprintf.c
zalloc.c