BACKPORT: 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.

Change-Id: I77f95343f8252baf6b26b16ccfc0179e9b81f159
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
This commit is contained in:
Carlos Neira 2020-03-04 17:41:56 -03:00 • committed by basamaryan
commit 08bceb2e5a
No known key found for this signature in database
GPG key ID: 210D5384FB2A5885
7 changed files with 84 additions and 0 deletions

View file

@ -437,6 +437,7 @@ class PrinterHelpers(Printer):
'struct bpf_fib_lookup',
'struct bpf_perf_event_data',
'struct bpf_perf_event_value',
'struct bpf_pidns_info',
'struct bpf_sock',
'struct bpf_sock_addr',
'struct bpf_sock_ops',