Skip to content
Commit 83c10cc3 authored by Lee Jones's avatar Lee Jones Committed by Daniel Borkmann
Browse files

bpf: Ensure correct locking around vulnerable function find_vpid()

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: 41bdc4b4

 ("bpf: introduce bpf subcommand BPF_TASK_FD_QUERY")
Signed-off-by: default avatarLee Jones <lee@kernel.org>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarYonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20220912133855.1218900-1-lee@kernel.org
parent a37a3258
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment