Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpf: Drop unprotected find_vpid() in favour of find_get_pid() #3461

Closed
wants to merge 2 commits into from

Conversation

kernel-patches-bot
Copy link

Pull request for series with
subject: bpf: Drop unprotected find_vpid() in favour of find_get_pid()
version: 3
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=666297

Kernel Patches Daemon and others added 2 commits August 9, 2022 06:55
The documentation for find_vpid() clearly states:

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

Presently we do neither.

Let's use find_get_pid() which searches for the vpid, then takes a
reference to it preventing early free, all within the safety of
rcu_read_lock().  Once we have our reference we can safely make use of
it up until the point it is put.

Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Martin KaFai Lau <martin.lau@linux.dev>
Cc: Song Liu <song@kernel.org>
Cc: Yonghong Song <yhs@fb.com>
Cc: KP Singh <kpsingh@kernel.org>
Cc: Stanislav Fomichev <sdf@google.com>
Cc: Hao Luo <haoluo@google.com>
Cc: bpf@vger.kernel.org
Fixes: 41bdc4b ("bpf: introduce bpf subcommand BPF_TASK_FD_QUERY")
Acked-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Lee Jones <lee@kernel.org>
@kernel-patches-bot
Copy link
Author

Master branch: ca34ce2
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=666297
version: 3

@kernel-patches-bot
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=666297 expired. Closing PR.

@kernel-patches-bot kernel-patches-bot deleted the series/661803=>bpf-next branch August 11, 2022 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants