kernel_samsung_a53x/kernel/bpf
Toke Høiland-Jørgensen c46be22c95 cpumap: Zero-initialise xdp_rxq_info struct before running XDP program
[ Upstream commit 2487007aa3b9fafbd2cb14068f49791ce1d7ede5 ]

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: 9216477449f3 ("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-11-18 23:19:34 +01:00
..
preload Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
arraymap.c bpf: Add map and need_defer parameters to .map_fd_put_ptr() 2024-11-18 12:13:12 +01:00
bpf_inode_storage.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bpf_iter.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bpf_local_storage.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bpf_lru_list.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bpf_lru_list.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bpf_lsm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bpf_struct_ops.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bpf_struct_ops_types.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cgroup.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
core.c bpf: Detect IP == ksym.end as part of BPF program 2024-11-18 11:43:12 +01:00
cpumap.c cpumap: Zero-initialise xdp_rxq_info struct before running XDP program 2024-11-18 23:19:34 +01:00
devmap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
disasm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
disasm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dispatcher.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hashtab.c bpf: Add map and need_defer parameters to .map_fd_put_ptr() 2024-11-18 12:13:12 +01:00
helpers.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
inode.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
local_storage.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lpm_trie.c bpf, lpm: Fix check prefixlen before walking trie 2024-11-18 12:12:28 +01:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
map_in_map.c bpf: Add map and need_defer parameters to .map_fd_put_ptr() 2024-11-18 12:13:12 +01:00
map_in_map.h bpf: Add map and need_defer parameters to .map_fd_put_ptr() 2024-11-18 12:13:12 +01:00
map_iter.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
net_namespace.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
offload.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
percpu_freelist.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
percpu_freelist.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
prog_iter.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
queue_stack_maps.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
reuseport_array.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ringbuf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stackmap.c bpf: Add crosstask check to __bpf_get_stack 2024-11-18 12:12:28 +01:00
syscall.c bpf: Set uattr->batch.count as zero before batched update or deletion 2024-11-18 12:13:12 +01:00
sysfs_btf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
task_iter.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tnum.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trampoline.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
verifier.c bpf: Fix verification of indirect var-off stack access 2024-11-18 12:12:36 +01:00