linux-stable/kernel/bpf
Toke Høiland-Jørgensen 5f4e51abfb cpumap: Zero-initialise xdp_rxq_info struct before running XDP program
[ Upstream commit 2487007aa3 ]

When running an XDP program that is attached to a cpumap entry, we don't
initialise the xdp_rxq_info data structure being used in the xdp_buff
that backs the XDP program invocation. Tobias noticed that this leads to
random values being returned as the xdp_md->rx_queue_index value for XDP
programs running in a cpumap.

This means we're basically returning the contents of the uninitialised
memory, which is bad. Fix this by zero-initialising the rxq data
structure before running the XDP program.

Fixes: 9216477449 ("bpf: cpumap: Add the possibility to attach an eBPF program to cpumap")
Reported-by: Tobias Böhm <tobias@aibor.de>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/r/20240305213132.11955-1-toke@redhat.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-15 10:48:15 -04:00
..
preload
arraymap.c bpf: Add map and need_defer parameters to .map_fd_put_ptr() 2024-02-23 08:42:07 +01:00
bpf_inode_storage.c
bpf_iter.c
bpf_local_storage.c bpf: Annotate data races in bpf_local_storage 2023-05-30 12:57:48 +01:00
bpf_lru_list.c bpf: Address KCSAN report on bpf_lru_list 2023-07-27 08:44:38 +02:00
bpf_lru_list.h bpf: Address KCSAN report on bpf_lru_list 2023-07-27 08:44:38 +02:00
bpf_lsm.c
bpf_struct_ops.c
bpf_struct_ops_types.h
btf.c bpf/btf: Accept function names that contain dots 2023-06-28 10:28:16 +02:00
cgroup.c bpf: Remove extra lock_sock for TCP_ZEROCOPY_RECEIVE 2023-07-27 08:43:37 +02:00
core.c bpf: Detect IP == ksym.end as part of BPF program 2023-11-28 16:54:49 +00:00
cpumap.c cpumap: Zero-initialise xdp_rxq_info struct before running XDP program 2024-03-15 10:48:15 -04:00
devmap.c
disasm.c
disasm.h
dispatcher.c
hashtab.c bpf: Add map and need_defer parameters to .map_fd_put_ptr() 2024-02-23 08:42:07 +01:00
helpers.c
inode.c
local_storage.c
lpm_trie.c bpf, lpm: Fix check prefixlen before walking trie 2024-01-25 14:37:43 -08:00
Makefile
map_in_map.c bpf: Add map and need_defer parameters to .map_fd_put_ptr() 2024-02-23 08:42:07 +01:00
map_in_map.h bpf: Add map and need_defer parameters to .map_fd_put_ptr() 2024-02-23 08:42:07 +01:00
map_iter.c
net_namespace.c
offload.c
percpu_freelist.c bpf: Initialize same number of free nodes for each pcpu_freelist 2022-11-25 17:45:45 +01:00
percpu_freelist.h
prog_iter.c
queue_stack_maps.c bpf: Avoid deadlock when using queue and stack maps from NMI 2023-10-10 21:53:26 +02:00
reuseport_array.c
ringbuf.c
stackmap.c bpf: Add crosstask check to __bpf_get_stack 2024-01-25 14:37:43 -08:00
syscall.c bpf: Set uattr->batch.count as zero before batched update or deletion 2024-02-23 08:42:07 +01:00
sysfs_btf.c
task_iter.c
tnum.c
trampoline.c bpf: Fix potential array overflow in bpf_trampoline_get_progs() 2022-06-06 08:42:45 +02:00
verifier.c bpf: Fix verification of indirect var-off stack access 2024-01-25 14:37:44 -08:00