linux/tools
Ian Rogers 5576008305 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-26 13:25:20 +02:00
..
accounting
arch x86/speculation: Add RSB VM Exit protections 2022-08-11 13:06:47 +02:00
bootconfig
bpf bpftool: Fix a wrong type cast in btf_dumper_int 2022-10-26 13:25:19 +02:00
build tools build: Switch to new openssl API for test-libcrypto 2022-08-25 11:38:01 +02:00
cgroup
debugging
edid
firewire
firmware
gpio
hv
iio
include tools/include/uapi: Fix <asm/errno.h> for parisc and xtensa 2022-09-23 14:16:58 +02:00
io_uring
kvm/kvm_stat tools/kvm_stat: fix display of error when multiple processes are found 2022-08-11 13:06:45 +02:00
laptop
leds
lib selftests/xsk: Avoid use-after-free on ctx 2022-10-26 13:25:20 +02:00
memory-model
objtool objtool: Preserve special st_shndx indexes in elf_update_symbol 2022-10-26 13:25:18 +02:00
pci
pcmcia
perf perf tools: Fixup get_current_dir_name() compilation 2022-10-15 07:55:50 +02:00
power tools/power turbostat: fix ICX DRAM power numbers 2022-06-09 10:20:51 +02:00
scripts
spi
testing selftests: Fix the if conditions of in test_extra_filter() 2022-10-05 10:38:42 +02:00
thermal/tmon tools/thermal: Fix possible path truncations 2022-08-21 15:16:12 +02:00
time
usb
virtio tools/virtio: compile with -pthread 2022-05-25 09:17:53 +02:00
vm tools/vm/slabinfo: use alphabetic order when two values are equal 2022-08-25 11:38:00 +02:00
wmi
Makefile