]> www.infradead.org Git - users/dwmw2/linux.git/commit
bpf: Add bpf_task_from_vpid() kfunc
authorJuntong Deng <juntong.deng@outlook.com>
Mon, 14 Oct 2024 09:21:08 +0000 (10:21 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 16 Oct 2024 16:21:18 +0000 (09:21 -0700)
commit675c3596ff32c040d1dd2e28dd57e83e634b9f60
tree7e6e15f1c82074493a04863cde253fb509fdb71c
parent1477d31b1c9a661a253a644b950f5ce438e4821c
bpf: Add bpf_task_from_vpid() kfunc

bpf_task_from_pid() that currently exists looks up the
struct task_struct corresponding to the pid in the root pid
namespace (init_pid_ns).

This patch adds bpf_task_from_vpid() which looks up the
struct task_struct corresponding to vpid in the pid namespace
of the current process.

This is useful for getting information about other processes
in the same pid namespace.

Signed-off-by: Juntong Deng <juntong.deng@outlook.com>
Link: https://lore.kernel.org/r/AM6PR03MB5848E50DA58F79CDE65433C399442@AM6PR03MB5848.eurprd03.prod.outlook.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/helpers.c