diff options
author | Carlos Neira <cneirabustos@gmail.com> | 2020-03-04 17:41:56 -0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-03-12 17:33:11 -0700 |
commit | b4490c5c4e023f09b7d27c9a9d3e7ad7d09ea6bf (patch) | |
tree | 2a1bcba2ff5a85b3fb0e0013b01ac25eef4cc6fa /kernel/bpf/core.c | |
parent | 1e2328e762548c7d17b7ba8ded9f409d05710dd1 (diff) | |
download | linux-b4490c5c4e023f09b7d27c9a9d3e7ad7d09ea6bf.tar.bz2 |
bpf: Added new helper bpf_get_ns_current_pid_tgid
New bpf helper bpf_get_ns_current_pid_tgid,
This helper will return pid and tgid from current task
which namespace matches dev_t and inode number provided,
this will allows us to instrument a process inside a container.
Signed-off-by: Carlos Neira <cneirabustos@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20200304204157.58695-3-cneirabustos@gmail.com
Diffstat (limited to 'kernel/bpf/core.c')
-rw-r--r-- | kernel/bpf/core.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index 973a20d49749..0f9ca46e1978 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -2149,6 +2149,7 @@ const struct bpf_func_proto bpf_get_current_uid_gid_proto __weak; const struct bpf_func_proto bpf_get_current_comm_proto __weak; const struct bpf_func_proto bpf_get_current_cgroup_id_proto __weak; const struct bpf_func_proto bpf_get_local_storage_proto __weak; +const struct bpf_func_proto bpf_get_ns_current_pid_tgid_proto __weak; const struct bpf_func_proto * __weak bpf_get_trace_printk_proto(void) { |