kernel_samsung_a53x/kernel/bpf
Rik van Riel 2a2e1902e3 bpf: use kvzmalloc to allocate BPF verifier environment
[ Upstream commit 434247637c66e1be2bc71a9987d4c3f0d8672387 ]

The kzmalloc call in bpf_check can fail when memory is very fragmented,
which in turn can lead to an OOM kill.

Use kvzmalloc to fall back to vmalloc when memory is too fragmented to
allocate an order 3 sized bpf verifier environment.

Admittedly this is not a very common case, and only happens on systems
where memory has already been squeezed close to the limit, but this does
not seem like much of a hot path, and it's a simple enough fix.

Signed-off-by: Rik van Riel <riel@surriel.com>
Reviewed-by: Shakeel Butt <shakeel.butt@linux.dev>
Link: https://lore.kernel.org/r/20241008170735.16766766@imladris.surriel.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-30 02:33:27 +01:00
..
preload
arraymap.c Revert "bpf: Check percpu map value size first" 2024-11-24 00:22:59 +01:00
bpf_inode_storage.c
bpf_iter.c
bpf_local_storage.c
bpf_lru_list.c
bpf_lru_list.h
bpf_lsm.c
bpf_struct_ops.c
bpf_struct_ops_types.h
btf.c bpf: Eliminate remaining "make W=1" warnings in kernel/bpf/btf.o 2024-11-23 23:20:08 +01:00
cgroup.c
core.c
cpumap.c bpf: report RCU QS in cpumap kthread 2024-11-19 08:45:00 +01:00
devmap.c Reapply "bpf: Fix DEVMAP_HASH overflow check on 32-bit arches" 2024-11-24 00:23:17 +01:00
disasm.c
disasm.h
dispatcher.c
hashtab.c Revert "bpf: Check percpu map value size first" 2024-11-24 00:22:59 +01:00
helpers.c Revert "bpf: Fix bpf_strtol and bpf_strtoul helpers for 32bit" 2024-11-24 00:23:22 +01:00
inode.c Revert "fs: add file and path permissions helpers" 2024-11-19 13:30:21 +01:00
local_storage.c
lpm_trie.c bpf: Fix out-of-bounds write in trie_get_next_key() 2024-11-23 23:22:03 +01:00
Makefile
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
net_namespace.c
offload.c
percpu_freelist.c
percpu_freelist.h
prog_iter.c
queue_stack_maps.c
reuseport_array.c
ringbuf.c bpf: Fix overrunning reservations in ringbuf 2024-11-19 14:19:51 +01:00
stackmap.c bpf: Fix stackmap overflow check on 32-bit arches 2024-11-19 08:44:49 +01:00
syscall.c bpf: In bpf_task_fd_query use fget_task 2024-11-19 12:27:27 +01:00
sysfs_btf.c
task_iter.c file: Replace fcheck_files with files_lookup_fd_rcu 2024-11-19 12:27:27 +01:00
tnum.c
trampoline.c Revert "x86/ibt,ftrace: Search for __fentry__ location" 2024-11-24 00:23:31 +01:00
verifier.c bpf: use kvzmalloc to allocate BPF verifier environment 2024-11-30 02:33:27 +01:00