kernel-hacking-2024-linux-s.../kernel/bpf
Eric Dumazet 75134f16e7 bpf: Add schedule points in batch ops
syzbot reported various soft lockups caused by bpf batch operations.

 INFO: task kworker/1:1:27 blocked for more than 140 seconds.
 INFO: task hung in rcu_barrier

Nothing prevents batch ops to process huge amount of data,
we need to add schedule points in them.

Note that maybe_wait_bpf_programs(map) calls from
generic_map_delete_batch() can be factorized by moving
the call after the loop.

This will be done later in -next tree once we get this fix merged,
unless there is strong opinion doing this optimization sooner.

Fixes: aa2e93b8e5 ("bpf: Add generic support for update and delete batch ops")
Fixes: cb4d03ab49 ("bpf: Add generic support for lookup batch op")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Stanislav Fomichev <sdf@google.com>
Acked-by: Brian Vazquez <brianvv@google.com>
Link: https://lore.kernel.org/bpf/20220217181902.808742-1-eric.dumazet@gmail.com
2022-02-17 10:48:26 -08:00
..
preload
arraymap.c
bloom_filter.c bpf: Add missing map_get_next_key method to bloom filter map. 2021-12-29 09:38:31 -08:00
bpf_inode_storage.c bpf: Allow bpf_local_storage to be used by sleepable programs 2021-12-29 17:54:40 -08:00
bpf_iter.c
bpf_local_storage.c bpf: Allow bpf_local_storage to be used by sleepable programs 2021-12-29 17:54:40 -08:00
bpf_lru_list.c
bpf_lru_list.h
bpf_lsm.c bpf: Fix renaming task_getsecid_subj->current_getsecid_subj. 2022-01-24 20:20:51 -08:00
bpf_struct_ops.c
bpf_struct_ops_types.h
bpf_task_storage.c bpf: Allow bpf_local_storage to be used by sleepable programs 2021-12-29 17:54:40 -08:00
btf.c bpf: Fix crash due to out of bounds access into reg2btf_ids. 2022-02-16 12:46:51 -08:00
cgroup.c bpf: Add MEM_RDONLY for helper args that are pointers to rdonly mem. 2021-12-18 13:27:41 -08:00
core.c
cpumap.c xdp: Move conversion to xdp_frame out of map functions 2022-01-05 19:46:32 -08:00
devmap.c xdp: Move conversion to xdp_frame out of map functions 2022-01-05 19:46:32 -08:00
disasm.c
disasm.h
dispatcher.c
hashtab.c
helpers.c bpf: Emit bpf_timer in vmlinux BTF 2022-02-11 13:21:47 -08:00
inode.c bpf: Fix mount source show for bpffs 2022-01-11 10:48:17 +01:00
Kconfig
local_storage.c bpf: Use struct_size() helper 2021-12-21 15:35:48 -08:00
lpm_trie.c bpf: Fix typo in a comment in bpf lpm_trie. 2021-12-30 18:42:34 -08:00
Makefile
map_in_map.c
map_in_map.h
map_iter.c bpf: Introduce MEM_RDONLY flag 2021-12-18 13:27:41 -08:00
mmap_unlock_work.h
net_namespace.c net: Add includes masked by netdevice.h including uapi/bpf.h 2021-12-29 20:03:05 -08:00
offload.c
percpu_freelist.c
percpu_freelist.h
prog_iter.c
queue_stack_maps.c
reuseport_array.c bpf: Use struct_size() helper 2021-12-21 15:35:48 -08:00
ringbuf.c bpf: Use VM_MAP instead of VM_ALLOC for ringbuf 2022-02-02 23:15:24 -08:00
stackmap.c bpf: Guard against accessing NULL pt_regs in bpf_get_task_stack() 2022-01-15 12:21:23 +11:00
syscall.c bpf: Add schedule points in batch ops 2022-02-17 10:48:26 -08:00
sysfs_btf.c
task_iter.c
tnum.c
trampoline.c bpf: Fix possible race in inc_misses_counter 2022-01-25 17:50:03 -08:00
verifier.c bpf: Fix ringbuf memory type confusion when passing to helpers 2022-01-19 01:21:46 +01:00