android_kernel_xiaomi_sm7250/kernel/bpf
Lee Jones e4b17b461c bpf: Ensure correct locking around vulnerable function find_vpid()
[ Upstream commit 83c10cc362d91c0d8d25e60779ee52fdbbf3894d ]

The documentation for find_vpid() clearly states:

  "Must be called with the tasklist_lock or rcu_read_lock() held."

Presently we do neither for find_vpid() instance in bpf_task_fd_query().
Add proper rcu_read_lock/unlock() to fix the issue.

Fixes: 41bdc4b40e ("bpf: introduce bpf subcommand BPF_TASK_FD_QUERY")
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20220912133855.1218900-1-lee@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-26 13:19:25 +02:00
..
arraymap.c
bpf_lru_list.c
bpf_lru_list.h
btf.c bpf: btf: fix truncated last_member_type_id in btf_struct_resolve 2022-10-26 13:19:25 +02:00
cgroup.c
core.c bpf: Make sure mac_header was set before using it 2022-07-29 17:10:34 +02:00
cpumap.c
devmap.c
disasm.c bpf: Introduce BPF nospec instruction for mitigating Spectre v4 2021-09-22 11:47:58 +02:00
disasm.h
hashtab.c
helpers.c
inode.c
local_storage.c
lpm_trie.c
Makefile
map_in_map.c
map_in_map.h
offload.c
percpu_freelist.c
percpu_freelist.h
reuseport_array.c
sockmap.c
stackmap.c bpf: Fix integer overflow in prealloc_elems_and_freelist() 2021-10-13 10:10:51 +02:00
syscall.c bpf: Ensure correct locking around vulnerable function find_vpid() 2022-10-26 13:19:25 +02:00
tnum.c
verifier.c bpf: Verifer, adjust_scalar_min_max_vals to always call update_reg_bounds() 2022-08-25 11:14:55 +02:00
xskmap.c