linux/tools
Ian Rogers 37005a9486 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 12:34:41 +02:00
..
accounting
arch
bootconfig
bpf bpftool: Fix a wrong type cast in btf_dumper_int 2022-10-26 12:34:39 +02:00
build
cgroup
debugging
edid
firewire
firmware
gpio
hv
iio
include
io_uring
kvm/kvm_stat
laptop
leds
lib selftests/xsk: Avoid use-after-free on ctx 2022-10-26 12:34:41 +02:00
memory-model
objtool
pci
pcmcia
perf
power
rcu
scripts
spi
testing
thermal/tmon
time
tracing
usb
virtio
vm
wmi
Makefile