[PATCH bpf-next V9 2/3] samples/bpf: added sample code for bpf_get_current_pidns_info.

2019-08-13 Thread Carlos Neira
From: Carlos sample program to call new bpf helper bpf_get_current_pidns_info. Signed-off-by: Carlos Neira --- samples/bpf/Makefile | 3 +++ samples/bpf/trace_ns_info_user.c | 35 samples/bpf/trace_ns_info_user_kern.c | 44

[PATCH bpf-next V9 0/3] BPF: New helper to obtain namespace data from current task

2019-08-13 Thread Carlos Neira
turn 0; To find out the name PID namespace id of a process, you could use this command: $ ps -h -o pidns -p Or this other command: $ ls -Li /proc//ns/pid Signed-off-by: Carlos Neira Carlos Neira (3): bpf: new helper to obtain namespace data from current task samples/bpf: added sample co

[PATCH bpf-next V9 3/3] tools/testing/selftests/bpf: Add self-tests for new helper.

2019-08-13 Thread Carlos Neira
From: Carlos Added self-tests for new helper bpf_get_current_pidns_info. Signed-off-by: Carlos Neira --- tools/include/uapi/linux/bpf.h | 31 - tools/testing/selftests/bpf/Makefile | 2 +- tools/testing/selftests/bpf/bpf_helpers.h | 3

[PATCH bpf-next V9 1/3] bpf: new helper to obtain namespace data from current task

2019-08-13 Thread Carlos Neira
From: Carlos New bpf helper bpf_get_current_pidns_info. This helper obtains the active namespace from current and returns pid, tgid, device and namespace id as seen from that namespace, allowing to instrument a process inside a container. Signed-off-by: Carlos Neira --- fs/internal.h

[PATCH v12 bpf-next] bpf/selftests: fold test_current_pid_tgid_new_ns into test_progs.

2021-01-14 Thread Carlos Neira
Currently tests for bpf_get_ns_current_pid_tgid() are outside test_progs. This change folds test cases into test_progs. Changes from v11: - Fixed test failure is not detected. - Removed EXIT(3) call as it will stop test_progs execution. Signed-off-by: Carlos Neira --- tools/testing

[PATCH v8 bpf-next] bpf/selftests: fold test_current_pid_tgid_new_ns into test_progs.

2020-12-14 Thread Carlos Neira
Currently tests for bpf_get_ns_current_pid_tgid() are outside test_progs. This change folds test cases into test_progs. Changes from V7: - Rebased changes. - Changed function scope. Signed-off-by: Carlos Neira Acked-by: Andrii Nakryiko --- tools/testing/selftests/bpf/.gitignore| 1

[PATCH v9 bpf-next] bpf/selftests: fold test_current_pid_tgid_new_ns into test_progs.

2020-12-16 Thread Carlos Neira
Currently tests for bpf_get_ns_current_pid_tgid() are outside test_progs. This change folds test cases into test_progs. Changes from v8: - Fixed code style - Fixed CHECK macro usage - Removed root namespace sub-test - Split pid_tgid variable Signed-off-by: Carlos Neira --- tools/testing

[PATCH v10 bpf-next] bpf/selftests: fold test_current_pid_tgid_new_ns into test_progs.

2020-12-21 Thread Carlos Neira
namespaced test, the new process pid will be 1. - Used ASSERTEQ on pid/tgid validation. - Added comment on CLONE(2) call Signed-off-by: Carlos Neira --- tools/testing/selftests/bpf/.gitignore| 1 - tools/testing/selftests/bpf/Makefile | 3 +- .../bpf/prog_tests

[PATCH v11 bpf-next] bpf/selftests: fold test_current_pid_tgid_new_ns into test_progs.

2020-12-28 Thread Carlos Neira
Currently tests for bpf_get_ns_current_pid_tgid() are outside test_progs. This change folds test cases into test_progs. Changes from v10: - Code style fixes. - Remove redundant code. Signed-off-by: Carlos Neira --- tools/testing/selftests/bpf/.gitignore| 1 - tools/testing

[PATCH v5] bpf/selftests: fold test_current_pid_tgid_new_ns into test_progs.

2020-08-18 Thread Carlos Neira
: Carlos Neira Acked-by: Andrii Nakryiko --- tools/testing/selftests/bpf/.gitignore| 2 +- tools/testing/selftests/bpf/Makefile | 2 +- .../bpf/prog_tests/ns_current_pid_tgid.c | 85 -- .../bpf/prog_tests/ns_current_pidtgid.c | 55 ++ .../bpf/progs

[PATCH v6 bpf-next] bpf/selftests: fold test_current_pid_tgid_new_ns into test_progs.

2020-08-20 Thread Carlos Neira
Currently tests for bpf_get_ns_current_pid_tgid() are outside test_progs. This change folds both tests into test_progs. Changes from V5: - Fold both tests into test_progs. Signed-off-by: Carlos Neira --- tools/testing/selftests/bpf/.gitignore| 1 - tools/testing/selftests/bpf

[PATCH v7 bpf-next] bpf/selftests: fold test_current_pid_tgid_new_ns into test_progs.

2020-08-20 Thread Carlos Neira
Currently tests for bpf_get_ns_current_pid_tgid() are outside test_progs. This change folds test cases into test_progs. Changes from V6: - Rebased changes. Signed-off-by: Carlos Neira --- tools/testing/selftests/bpf/.gitignore| 1 - tools/testing/selftests/bpf/Makefile

[PATCH v3 bpf-next 1/3] BPF: helpers: New helper to obtain namespace data from current task

2019-03-19 Thread Carlos Neira
This is a series of patches to introduce a new helper called bpf_get_current_pidns_info, this change has been splitted into the following patches: 1- Feature introduction 2- Update tools/.../bpf.h 3- Self tests and samples >From 852a65906122b05b4d1a23af868b2c245d240402 Mon Sep 17 00:00:00 2001 Fr

[PATCH v3 bpf-next 2/3] BPF: helpers: New helper to obtain namespace data from current task

2019-03-19 Thread Carlos Neira
This is a series of patches to introduce a new helper called bpf_get_current_pidns_info, this change has been splitted into the following patches: 1- Feature introduction 2- Update tools/.../bpf.h 3- Self tests and samples >From b7f5af5c1513b6e89fc5b68ddb1ad65e4fbede02 Mon Sep 17 00:00:00 2001 Fr

Re: [PATCH v3 bpf-next 2/3] BPF: helpers: New helper to obtain namespace data from current task

2019-03-19 Thread Carlos Neira
>From b7f5af5c1513b6e89fc5b68ddb1ad65e4fbede02 Mon Sep 17 00:00:00 2001 From: Carlos Date: Mon, 18 Mar 2019 13:09:35 -0300 Subject: [PATCH] [PATCH bpf-next 2/3] BPF: New helper to obtain namespace data from current task This helper obtains the active namespace from current and returns pid, tgi

Re: [PATCH v3 bpf-next 3/3] BPF: helpers: New helper to obtain namespace data from current task

2019-03-19 Thread Carlos Neira
HOSTCFLAGS += -I$(srctree)/tools/lib/ diff --git a/samples/bpf/trace_ns_info_user.c b/samples/bpf/trace_ns_info_user.c new file mode 100644 index ..e06d08db6f30 --- /dev/null +++ b/samples/bpf/trace_ns_info_user.c @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright (c) 2018

[PATCH v13 0/4] BPF: New helper to obtain namespace data from current task

2019-10-09 Thread Carlos Neira
onghong in 2017 Linux plumbers conference. To address that situation the helper requires inum and dev_t from /proc/self/ns/pid. This helper has the same use cases as bpf_get_current_pid_tgid() as it can be used to do pid filtering even inside a container. Signed-off-by: Carlos Neira Carlos Neira

[PATCH v13 1/4] fs/nsfs.c: added ns_match

2019-10-09 Thread Carlos Neira
ns_match returns true if the namespace inode and dev_t matches the ones provided by the caller. Signed-off-by: Carlos Neira --- fs/nsfs.c | 8 include/linux/proc_ns.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/fs/nsfs.c b/fs/nsfs.c index a0431642c6b5

[PATCH v13 2/4] bpf: added new helper bpf_get_ns_current_pid_tgid

2019-10-09 Thread Carlos Neira
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 --- include/linux/bpf.h | 1 + include

[PATCH v13 3/4] tools: Added bpf_get_ns_current_pid_tgid helper

2019-10-09 Thread Carlos Neira
sync tools/include/uapi/linux/bpf.h to include new helper. Signed-off-by: Carlos Neira --- tools/include/uapi/linux/bpf.h | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 77c6be96d676

[PATCH v13 4/4] tools/testing/selftests/bpf: Add self-tests for new helper.

2019-10-09 Thread Carlos Neira
Self tests added for new helper Signed-off-by: Carlos Neira --- tools/testing/selftests/bpf/bpf_helpers.h | 4 + .../bpf/prog_tests/get_ns_current_pid_tgid.c | 85 +++ .../bpf/progs/get_ns_current_pid_tgid_kern.c | 53 3 files changed, 142 insertions

[PATCH v14 0/5] BPF: New helper to obtain namespace data from current task

2019-10-17 Thread Carlos Neira
selftests - refactored ebpf helper Signed-off-by: Carlos Neira Carlos Neira (5): fs/nsfs.c: added ns_match bpf: added new helper bpf_get_ns_current_pid_tgid tools: Added bpf_get_ns_current_pid_tgid helper tools/testing/selftests/bpf: Add self-tests for new helper. bpf_helpers_doc.py:

[PATCH v14 1/5] fs/nsfs.c: added ns_match

2019-10-17 Thread Carlos Neira
ns_match returns true if the namespace inode and dev_t matches the ones provided by the caller. Signed-off-by: Carlos Neira --- fs/nsfs.c | 8 include/linux/proc_ns.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/fs/nsfs.c b/fs/nsfs.c index a0431642c6b5

[PATCH v14 2/5] bpf: added new helper bpf_get_ns_current_pid_tgid

2019-10-17 Thread Carlos Neira
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 --- include/linux/bpf.h | 1 + include

[PATCH v14 3/5] tools: Added bpf_get_ns_current_pid_tgid helper

2019-10-17 Thread Carlos Neira
sync tools/include/uapi/linux/bpf.h to include new helper. Signed-off-by: Carlos Neira --- tools/include/uapi/linux/bpf.h | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index a65c3b0c6935

[PATCH v14 4/5] tools/testing/selftests/bpf: Add self-tests for new helper.

2019-10-17 Thread Carlos Neira
Self tests added for new helper Signed-off-by: Carlos Neira --- .../bpf/prog_tests/get_ns_current_pid_tgid.c | 96 +++ .../bpf/progs/get_ns_current_pid_tgid_kern.c | 53 ++ 2 files changed, 149 insertions(+) create mode 100644 tools/testing/selftests/bpf/prog_tests

[PATCH v14 5/5] bpf_helpers_doc.py: Add struct bpf_pidns_info to known types

2019-10-17 Thread Carlos Neira
Add struct bpf_pidns_info to known types Signed-off-by: Carlos Neira --- scripts/bpf_helpers_doc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/bpf_helpers_doc.py b/scripts/bpf_helpers_doc.py index 7df9ce598ff9..d42eb185810f 100755 --- a/scripts/bpf_helpers_doc.py +++ b/scripts

[PATCH v15 4/5] tools/testing/selftests/bpf: Add self-tests for new helper.

2019-10-22 Thread Carlos Neira
Self tests added for new helper Signed-off-by: Carlos Neira --- .../bpf/prog_tests/ns_current_pid_tgid.c | 87 +++ .../bpf/progs/test_ns_current_pid_tgid.c | 37 2 files changed, 124 insertions(+) create mode 100644 tools/testing/selftests/bpf/prog_tests

[PATCH v15 5/5] bpf_helpers_doc.py: Add struct bpf_pidns_info to known types

2019-10-22 Thread Carlos Neira
Add struct bpf_pidns_info to known types Signed-off-by: Carlos Neira --- scripts/bpf_helpers_doc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/bpf_helpers_doc.py b/scripts/bpf_helpers_doc.py index 7548569e8076..021cc387d414 100755 --- a/scripts/bpf_helpers_doc.py +++ b/scripts

[PATCH v15 2/5] bpf: added new helper bpf_get_ns_current_pid_tgid

2019-10-22 Thread Carlos Neira
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 --- include/linux/bpf.h | 1 + include

[PATCH v15 1/5] fs/nsfs.c: added ns_match

2019-10-22 Thread Carlos Neira
ns_match returns true if the namespace inode and dev_t matches the ones provided by the caller. Signed-off-by: Carlos Neira --- fs/nsfs.c | 14 ++ include/linux/proc_ns.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/fs/nsfs.c b/fs/nsfs.c index a0431642c6b5

[PATCH v15 0/5] BPF: New helper to obtain namespace data from current task

2019-10-22 Thread Carlos Neira
selftests - refactored ebpf helper Signed-off-by: Carlos Neira Carlos Neira (5): fs/nsfs.c: added ns_match bpf: added new helper bpf_get_ns_current_pid_tgid tools: Added bpf_get_ns_current_pid_tgid helper tools/testing/selftests/bpf: Add self-tests for new helper. bpf_helpers_doc.py:

[PATCH v15 3/5] tools: Added bpf_get_ns_current_pid_tgid helper

2019-10-22 Thread Carlos Neira
sync tools/include/uapi/linux/bpf.h to include new helper. Signed-off-by: Carlos Neira --- tools/include/uapi/linux/bpf.h | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 4af8b0819a32

[PATCH v3 bpf-next] bpf/selftests: fold test_current_pid_tgid_new_ns into test_progs.

2020-08-02 Thread Carlos Neira
a standalone test. Signed-off-by: Carlos Neira --- tools/testing/selftests/bpf/.gitignore| 2 +- tools/testing/selftests/bpf/Makefile | 3 +- .../bpf/prog_tests/ns_current_pid_tgid.c | 85 - .../bpf/prog_tests/ns_current_pidtgid.c | 59

[PATCH v4 bpf-next] bpf/selftests: fold test_current_pid_tgid_new_ns into test_progs.

2020-08-05 Thread Carlos Neira
. - Removed unnecessary dependency on Makefile Signed-off-by: Carlos Neira --- tools/testing/selftests/bpf/.gitignore| 2 +- tools/testing/selftests/bpf/Makefile | 4 +- .../bpf/prog_tests/ns_current_pid_tgid.c | 85 -- .../bpf/prog_tests/ns_current_pidtgid.c | 54

[PATCH v3 bpf-next] fold test_current_pid_tgid_new_ns into test_progs.

2020-07-22 Thread Carlos Neira
Changes from V2: - Test not creating a new namespace has been included in test_progs. - Test creating a new pid namespace has been added as a standalone test. Signed-off-by: Carlos Neira --- tools/testing/selftests/bpf/.gitignore| 2 +- tools/testing/selftests/bpf/Makefile

[PATCH v3] folds tests from test_current_pid_tgid_new_ns into test_progs.

2020-07-17 Thread Carlos Neira
Signed-off-by: Carlos Neira --- tools/testing/selftests/bpf/.gitignore| 2 +- tools/testing/selftests/bpf/Makefile | 3 +- .../bpf/prog_tests/ns_current_pid_tgid.c | 85 - .../bpf/prog_tests/ns_current_pidtgid.c | 59 .../bpf/progs

[PATCH v1 bpf-next] bpf: new helper bpf_get_current_pcomm

2020-08-26 Thread Carlos Neira
ned-off-by: Carlos Neira --- include/linux/bpf.h | 1 + include/uapi/linux/bpf.h | 15 - kernel/bpf/core.c | 1 + kernel/bpf/helpers.c | 28 + kernel/trace/bpf_trace.c

[PATCH v2 bpf-next] fold test_current_pid_tgid_new_ns into into test_progs

2020-06-23 Thread Carlos Neira
folds tests from test_current_pid_tgid_new_ns into test_progs. Signed-off-by: Carlos Neira --- tools/testing/selftests/bpf/Makefile | 3 +- .../bpf/prog_tests/ns_current_pid_tgid.c | 112 +++- .../bpf/test_current_pid_tgid_new_ns.c| 159 -- 3

[PATCH v2] [PATCH v2 bpf-next] fold test_current_pid_tgid_new_ns into into test_progs

2020-06-03 Thread Carlos Neira
folds tests from test_current_pid_tgid_new_ns into test_progs. Signed-off-by: Carlos Neira --- tools/testing/selftests/bpf/Makefile | 3 +- .../bpf/prog_tests/ns_current_pid_tgid.c | 112 +++- .../bpf/test_current_pid_tgid_new_ns.c| 159 -- 3

[PATCH v2 bpf-next] fold test_current_pid_tgid_new_ns into into test_progs

2020-06-03 Thread Carlos Neira
folds tests from test_current_pid_tgid_new_ns into test_progs. Signed-off-by: Carlos Neira --- tools/testing/selftests/bpf/Makefile | 3 +- .../bpf/prog_tests/ns_current_pid_tgid.c | 112 +++- .../bpf/test_current_pid_tgid_new_ns.c| 159 -- 3

[PATCH bpf-next v10 1/4] fs/namei.c: make available filename_lookup() for bpf helpers.

2019-09-06 Thread Carlos Neira
Signed-off-by: Carlos Neira --- fs/internal.h | 2 -- fs/namei.c| 1 - include/linux/namei.h | 4 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/internal.h b/fs/internal.h index 315fcd8d237c..6647e15dd419 100644 --- a/fs/internal.h +++ b/fs/internal.h

[PATCH bpf-next v10 2/4] bpf: new helper to obtain namespace data from current task New bpf helper bpf_get_current_pidns_info.

2019-09-06 Thread Carlos Neira
This helper(bpf_get_current_pidns_info) obtains the active namespace from current and returns pid, tgid, device and namespace id as seen from that namespace, allowing to instrument a process inside a container. Signed-off-by: Carlos Neira --- include/linux/bpf.h | 1 + include/uapi/linux

[PATCH bpf-next v10 4/4] tools/testing/selftests/bpf: Add self-tests for helper bpf_get_pidns_info.

2019-09-06 Thread Carlos Neira
Added 2 selftest: bpf_get_current_pidns_info helper is called in an interrupt context and also in a non interrupt context. Signed-off-by: Carlos Neira --- tools/testing/selftests/bpf/Makefile | 2 +- tools/testing/selftests/bpf/bpf_helpers.h | 3 + .../testing

[PATCH bpf-next v10 3/4] tools: Added bpf_get_current_pidns_info helper.

2019-09-06 Thread Carlos Neira
Signed-off-by: Carlos Neira --- tools/include/uapi/linux/bpf.h | 35 ++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index b5889257cc33..3ec9aa1438b7 100644 --- a/tools/include/uapi

[PATCH bpf-next v10 0/4] BPF: New helper to obtain namespace data from current task

2019-09-06 Thread Carlos Neira
ext. Code style fixes. Added more comments on bpf helper struct member. Signed-off-by: Carlos Neira Carlos Neira (4): fs/namei.c: make available filename_lookup() for bpf helpers. bpf: new helper to obtain namespace data from current task New bpf helper bpf_get_current_pidns_info. tools:

[PATCH V11 0/4] BPF: New helper to obtain namespace data from current task

2019-09-24 Thread Carlos Neira
onghong in 2017 Linux plumbers conference. To address that situation the helper requires inum and dev_t from /proc/self/ns/pid. This helper has the same use cases as bpf_get_current_pid_tgid() as it can be used to do pid filtering even inside a container. Signed-off-by: Carlos Neira Carlos Neira

[PATCH bpf-next v11 1/4] fs/nsfs.c: added ns_match

2019-09-24 Thread Carlos Neira
ns_match returns true if the namespace inode and dev_t matches the ones provided by the caller. Signed-off-by: Carlos Neira --- fs/nsfs.c | 8 include/linux/proc_ns.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/fs/nsfs.c b/fs/nsfs.c index a0431642c6b5

[PATCH bpf-next v11 3/4] tools: Added bpf_get_ns_current_pid_tgid helper

2019-09-24 Thread Carlos Neira
Signed-off-by: Carlos Neira --- tools/include/uapi/linux/bpf.h | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 77c6be96d676..9272dc8fb08c 100644 --- a/tools/include/uapi/linux/bpf.h +++ b

[PATCH bpf-next v11 2/4] bpf: added new helper bpf_get_ns_current_pid_tgid

2019-09-24 Thread Carlos Neira
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 --- include/linux/bpf.h | 1 + include

[PATCH bpf-next v11 4/4] tools/testing/selftests/bpf: Add self-tests for new helper.

2019-09-24 Thread Carlos Neira
Self tests added for new helper Signed-off-by: Carlos Neira --- tools/testing/selftests/bpf/Makefile | 2 +- tools/testing/selftests/bpf/bpf_helpers.h | 3 + .../selftests/bpf/progs/test_pidns_kern.c | 71 tools/testing/selftests/bpf/test_pidns.c | 152

[PATCH V12 1/4] fs/nsfs.c: added ns_match

2019-10-01 Thread Carlos Neira
ns_match returns true if the namespace inode and dev_t matches the ones provided by the caller. Signed-off-by: Carlos Neira --- fs/nsfs.c | 8 include/linux/proc_ns.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/fs/nsfs.c b/fs/nsfs.c index a0431642c6b5

[PATCH V12 4/4] tools/testing/selftests/bpf: Add self-tests for new helper.

2019-10-01 Thread Carlos Neira
Self tests added for new helper Signed-off-by: Carlos Neira --- tools/testing/selftests/bpf/bpf_helpers.h | 3 + .../bpf/prog_tests/get_ns_current_pid_tgid.c | 85 +++ .../bpf/progs/get_ns_current_pid_tgid_kern.c | 47 ++ 3 files changed, 135 insertions(+) create

[PATCH V12 2/4] bpf: added new helper bpf_get_ns_current_pid_tgid

2019-10-01 Thread Carlos Neira
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 --- include/linux/bpf.h | 1 + include

[PATCH V12 0/4] BPF: New helper to obtain namespace data from current task

2019-10-01 Thread Carlos Neira
d dev from u32 to u64. - Moved self-test to test_progs. - Remove unneeded maps in self-test. Signed-off-by: Carlos Neira Carlos Neira (4): fs/nsfs.c: added ns_match bpf: added new helper bpf_get_ns_current_pid_tgid tools: Added bpf_get_ns_current_pid_tgid helper tools/testing/selftests/bpf

[PATCH V12 3/4] tools: Added bpf_get_ns_current_pid_tgid helper

2019-10-01 Thread Carlos Neira
sync tools/include/uapi/linux/bpf.h to include new helper. Signed-off-by: Carlos Neira --- tools/include/uapi/linux/bpf.h | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 77c6be96d676

[PATCH bpf-next] BPF: helpers: New helper to obtain namespace data from current task

2018-08-09 Thread Carlos Neira
o_user.c b/samples/bpf/trace_ns_info_user.c new file mode 100644 index ..e06d08db6f30 --- /dev/null +++ b/samples/bpf/trace_ns_info_user.c @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright (c) 2018 Carlos Neira cneirabus...@gmail.com + * + * This program is free softwar

Re: [PATCH bpf-next] BPF: helpers: New helper to obtain namespace data from current task

2018-08-09 Thread Carlos Neira
Yes, you are right. I'll resubmit the patch with those corrections. Thanks a lot for catching this. Thu, Aug 09, 2018 at 03:46:53PM +0200, Jesper Dangaard Brouer wrote: > On Thu, 9 Aug 2018 09:18:00 -0400 > Carlos Neira wrote: > > > From: cneira > > > >

Re: [PATCH bpf-next] BPF: helpers: New helper to obtain namespace data from current task

2018-08-09 Thread Carlos Neira
Jesper, Here is the updated patch. >From 92633f6819423093932e8d04aa3dc99a5913f6fd Mon Sep 17 00:00:00 2001 From: Carlos Neira Date: Thu, 9 Aug 2018 09:55:32 -0400 Subject: [PATCH bpf-next] BPF: helpers: New helper to obtain namespace data from current task This helper obtains the act

[PATCH v2 bpf-next] BPF: helpers: New helper to obtain namespace data from current task

2018-08-10 Thread Carlos Neira
o_user.c b/samples/bpf/trace_ns_info_user.c new file mode 100644 index ..e06d08db6f30 --- /dev/null +++ b/samples/bpf/trace_ns_info_user.c @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright (c) 2018 Carlos Neira cneirabus...@gmail.com + * + * This program is free software; y

Re: [PATCH bpf-next] BPF: helpers: New helper to obtain namespace data from current task

2018-08-10 Thread Carlos Neira
Jesper, I'm sorry, thanks a lot for the pointers to the current process. I just submitted v2 of for this patch. Thanks again for checking this out. Bests On Fri, Aug 10, 2018 at 12:40:29PM +0200, Jesper Dangaard Brouer wrote: > On Thu, 9 Aug 2018 12:07:00 -0400 > Carlos N