Commit 675c3596 authored by Juntong Deng's avatar Juntong Deng Committed by Alexei Starovoitov
Browse files

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: default avatarJuntong Deng <juntong.deng@outlook.com>
Link: https://lore.kernel.org/r/AM6PR03MB5848E50DA58F79CDE65433C399442@AM6PR03MB5848.eurprd03.prod.outlook.com


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 1477d31b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment