linux/kernel/bpf
Andrea Righi 23579010cf bpf: Fix bpf_get_smp_processor_id() on !CONFIG_SMP
On x86-64 calling bpf_get_smp_processor_id() in a kernel with CONFIG_SMP
disabled can trigger the following bug, as pcpu_hot is unavailable:

 [    8.471774] BUG: unable to handle page fault for address: 00000000936a290c
 [    8.471849] #PF: supervisor read access in kernel mode
 [    8.471881] #PF: error_code(0x0000) - not-present page

Fix by inlining a return 0 in the !CONFIG_SMP case.

Fixes: 1ae6921009 ("bpf: inline bpf_get_smp_processor_id() helper")
Signed-off-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20241217195813.622568-1-arighi@nvidia.com
2024-12-17 16:09:24 -08:00
..
preload
Kconfig
Makefile bpf: Avoid deadlock caused by nested kprobe and fentry bpf programs 2024-12-14 09:49:27 -08:00
arena.c bpf: Do not alloc arena on unsupported arches 2024-11-15 08:10:13 -08:00
arraymap.c
bloom_filter.c
bpf_cgrp_storage.c
bpf_inode_storage.c bpf-next-bpf-next-6.13 2024-11-21 08:11:04 -08:00
bpf_iter.c
bpf_local_storage.c
bpf_lru_list.c
bpf_lru_list.h
bpf_lsm.c bpf, lsm: Remove getlsmprop hooks BTF IDs 2024-11-25 14:14:17 -08:00
bpf_struct_ops.c bpf: Add kernel symbol for struct_ops trampoline 2024-11-12 17:13:46 -08:00
bpf_task_storage.c bpf-next-bpf-next-6.13 2024-11-21 08:11:04 -08:00
btf.c bpf: Augment raw_tp arguments with PTR_MAYBE_NULL 2024-12-13 16:24:53 -08:00
btf_iter.c
btf_relocate.c
cgroup.c Summary 2024-11-22 20:36:11 -08:00
cgroup_iter.c
core.c bpf: fix potential error return 2024-12-10 11:17:53 -08:00
cpumap.c
cpumask.c
crypto.c
devmap.c bpf: fix OOB devmap writes when deleting elements 2024-11-25 14:25:48 -08:00
disasm.c
disasm.h
dispatcher.c bpf: Add kernel symbol for struct_ops trampoline 2024-11-12 17:13:46 -08:00
hashtab.c bpf: Call free_htab_elem() after htab_unlock_bucket() 2024-11-11 08:18:30 -08:00
helpers.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf 2024-11-13 12:52:51 -08:00
inode.c
kmem_cache_iter.c bpf: Add open coded version of kmem_cache iterator 2024-11-01 11:08:32 -07:00
link_iter.c
local_storage.c
log.c
lpm_trie.c bpf: Use raw_spinlock_t for LPM trie 2024-12-06 09:14:26 -08:00
map_in_map.c
map_in_map.h
map_iter.c
memalloc.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf 2024-11-13 12:52:51 -08:00
mmap_unlock_work.h
mprog.c
net_namespace.c
offload.c
percpu_freelist.c
percpu_freelist.h
prog_iter.c
queue_stack_maps.c
range_tree.c bpf: Add necessary migrate_disable to range_tree. 2024-11-15 08:11:53 -08:00
range_tree.h bpf: Introduce range_tree data structure and use it in bpf arena 2024-11-13 13:52:45 -08:00
relo_core.c
reuseport_array.c
ringbuf.c
stackmap.c
syscall.c tracing updates for v6.13: 2024-11-22 13:27:01 -08:00
sysfs_btf.c
task_iter.c vfs-6.13.file 2024-11-18 10:30:29 -08:00
tcx.c
tnum.c
token.c
trampoline.c bpf: Add kernel symbol for struct_ops trampoline 2024-11-12 17:13:46 -08:00
verifier.c bpf: Fix bpf_get_smp_processor_id() on !CONFIG_SMP 2024-12-17 16:09:24 -08:00