Re: [PATCHv5 bpf-next 1/7] bpf: Allow trampoline re-attach for tracing and lsm programs

2021-04-19 Thread KP Singh
l > > Acked-by: Toke Høiland-Jørgensen > > Signed-off-by: Jiri Olsa > > --- > > Acked-by: Andrii Nakryiko Thanks! Acked-by: KP Singh

Re: [PATCH] bpf: avoid old-style declaration warnings

2021-03-22 Thread KP Singh
o = { > | ^ > > Fixes: 3f6719c7b62f ("bpf: Add bpf_bprm_opts_set helper") > Fixes: 27672f0d280a ("bpf: Add a BPF helper for getting the IMA hash of an > inode") > Signed-off-by: Arnd Bergmann Thanks for fixing! Acked-by: KP Singh

Re: [PATCH v3 bpf-next 1/4] bpf: enable task local storage for tracing programs

2021-01-31 Thread KP Singh
cing programs can attach to functions on the task free path, e.g. > exit_creds(). To avoid allocating task local storage after > bpf_task_storage_free(). bpf_task_storage_get() is updated to not allocate > new storage when the task is not refcounted (task->usage == 0). > > Signed

Re: [PATCH] bpf: put file handler if no storage found

2021-01-20 Thread KP Singh
tag when you resubmit) Fixes: 8ea636848aca ("bpf: Implement bpf_local_storage for inodes") Acked-by: KP Singh > > --- > > kernel/bpf/bpf_inode_storage.c | 6 +- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/kernel/bpf/bpf_i

Re: [PATCH bpf v2 2/2] selftests/bpf: add verifier test for PTR_TO_MEM spill

2021-01-13 Thread KP Singh
priv = ACCEPT part. I think it is correct > by checking code. > > Acked-by: Yonghong Song Thanks for the description! Acked-by: KP Singh

Re: [PATCH bpf v2 1/2] bpf: support PTR_TO_MEM{,_OR_NULL} register spilling

2021-01-13 Thread KP Singh
atch was partially contributed by CyberArk Software, Inc. > > Fixes: 457f44363a88 ("bpf: Implement BPF ring buffer and verifier support for > it") > Suggested-by: Yonghong Song > Signed-off-by: Gilad Reti Acked-by: KP Singh

Re: [PATCH bpf-next 1/4] bpf: enable task local storage for tracing programs

2021-01-12 Thread KP Singh
On Tue, Jan 12, 2021 at 5:32 PM Yonghong Song wrote: > > > > On 1/11/21 3:45 PM, Song Liu wrote: > > > > > >> On Jan 11, 2021, at 1:58 PM, Martin Lau wrote: > >> > >> On Mon, Jan 11, 2021 at 10:35:43PM +0100, KP Singh wrote: > >&

Re: [PATCH 2/2] selftests/bpf: add verifier test for PTR_TO_MEM spill

2021-01-12 Thread KP Singh
On Tue, Jan 12, 2021 at 4:43 PM Daniel Borkmann wrote: > > On 1/12/21 4:35 PM, Gilad Reti wrote: > > On Tue, Jan 12, 2021 at 4:56 PM KP Singh wrote: > >> On Tue, Jan 12, 2021 at 10:16 AM Gilad Reti wrote: > >>> > >>> Add test to check that

Re: [PATCH bpf 1/2] bpf: support PTR_TO_MEM{,_OR_NULL} register spilling

2021-01-12 Thread KP Singh
On Tue, Jan 12, 2021 at 3:24 PM Gilad Reti wrote: > > On Tue, Jan 12, 2021 at 3:57 PM KP Singh wrote: > > > > On Tue, Jan 12, 2021 at 10:14 AM Gilad Reti wrote: > > > > > > Add support for pointer to mem register spilling, to allow the verifier > > &g

Re: [PATCH 2/2] selftests/bpf: add verifier test for PTR_TO_MEM spill

2021-01-12 Thread KP Singh
On Tue, Jan 12, 2021 at 10:16 AM Gilad Reti wrote: > > Add test to check that the verifier is able to recognize spilling of > PTR_TO_MEM registers. > It would be nice to have some explanation of what the test does to recognize the spilling of the PTR_TO_MEM registers in the commit log as well. W

Re: [PATCH bpf 1/2] bpf: support PTR_TO_MEM{,_OR_NULL} register spilling

2021-01-12 Thread KP Singh
ted with you on the patch? And, in that case: "Co-developed-by:" would be a better tag here. Acked-by: KP Singh > > Fixes: 457f44363a88 ("bpf: Implement BPF ring buffer and verifier > support for it") > Signed-off-by: Gilad Reti > --- > kernel/bpf/verifier.

Re: [PATCH bpf-next 1/4] bpf: enable task local storage for tracing programs

2021-01-11 Thread KP Singh
On Mon, Jan 11, 2021 at 7:57 PM Martin KaFai Lau wrote: > > On Fri, Jan 08, 2021 at 03:19:47PM -0800, Song Liu wrote: > > [ ... ] > > > diff --git a/kernel/bpf/bpf_local_storage.c b/kernel/bpf/bpf_local_storage.c > > index dd5aedee99e73..9bd47ad2b26f1 100644 > > --- a/kernel/bpf/bpf_local_storage.

Re: [PATCH bpf-next 2/4] selftests/bpf: add non-BPF_LSM test for task local storage

2021-01-11 Thread KP Singh
On Mon, Jan 11, 2021 at 6:31 PM Yonghong Song wrote: > > > > On 1/8/21 3:19 PM, Song Liu wrote: > > Task local storage is enabled for tracing programs. Add a test for it > > without CONFIG_BPF_LSM. Can you also explain what the test does in the commit log? It would also be nicer to have a somewh

Re: [PATCH bpf-next 1/4] bpf: enable task local storage for tracing programs

2021-01-11 Thread KP Singh
On Mon, Jan 11, 2021 at 7:27 AM Yonghong Song wrote: > > > > On 1/8/21 3:19 PM, Song Liu wrote: > > To access per-task data, BPF program typically creates a hash table with > > pid as the key. This is not ideal because: > > 1. The use need to estimate requires size of the hash table, with may be

Re: [PATCH bpf-next 1/4] bpf: enable task local storage for tracing programs

2021-01-11 Thread KP Singh
On Sat, Jan 9, 2021 at 12:35 AM Song Liu wrote: > > To access per-task data, BPF program typically creates a hash table with > pid as the key. This is not ideal because: > 1. The use need to estimate requires size of the hash table, with may be > inaccurate; > 2. Big hash tables are slow; >

Re: [PATCH v3 bpf-next 2/4] bpf: allow bpf_d_path in sleepable bpf_iter program

2021-01-08 Thread KP Singh
entiate sleepable and non-sleepable bpf_iter > programs: sleepable programs have access to bpf_d_path; non-sleepable > programs have access to bpf_spin_lock. > > Acked-by: Yonghong Song > Signed-off-by: Song Liu Acked-by: KP Singh

Re: [PATCH v2 bpf-next 2/4] bpf: allow bpf_d_path in sleepable bpf_iter program

2020-12-16 Thread KP Singh
On Wed, Dec 16, 2020 at 7:15 PM KP Singh wrote: > > On Wed, Dec 16, 2020 at 1:06 AM Song Liu wrote: > > > > task_file and task_vma iter programs have access to file->f_path. Enable > > bpf_d_path to print paths of these file. > > > > bpf_iter programs ar

Re: [PATCH v2 bpf-next 2/4] bpf: allow bpf_d_path in sleepable bpf_iter program

2020-12-16 Thread KP Singh
On Wed, Dec 16, 2020 at 1:06 AM Song Liu wrote: > > task_file and task_vma iter programs have access to file->f_path. Enable > bpf_d_path to print paths of these file. > > bpf_iter programs are generally called in sleepable context. However, it > is still necessary to diffientiate sleepable and no

Re: [PATCH v2 bpf-next 3/4] libbpf: introduce section "iter.s/" for sleepable bpf_iter program

2020-12-16 Thread KP Singh
On Wed, Dec 16, 2020 at 6:44 PM Yonghong Song wrote: > > > > On 12/15/20 3:37 PM, Song Liu wrote: > > Sleepable iterator program have access to helper functions like bpf_d_path. > > > > Signed-off-by: Song Liu > > Acked-by: Yonghong Song Acked-by: KP Singh

Re: [PATCH bpf-next v3 3/6] bpf: Expose bpf_sk_storage_* to iterator programs

2020-11-26 Thread KP Singh
ialize a socket local storage with associations between > processes and sockets or to selectively delete local storage values. > > Signed-off-by: Florent Revest > Acked-by: Martin KaFai Lau Acked-by: KP Singh

Re: [PATCH bpf-next v3 1/6] net: Remove the err argument from sock_from_file

2020-11-26 Thread KP Singh
t; This patch simplifies the API by letting callers deduce the error based > on whether the returned socket is NULL or not. > > Suggested-by: Al Viro > Signed-off-by: Florent Revest Reviewed-by: KP Singh

Re: [PATCH v2 5/5] bpf: Add an iterator selftest for bpf_sk_storage_get

2020-11-19 Thread KP Singh
On Fri, Nov 20, 2020 at 1:32 AM Martin KaFai Lau wrote: > > On Thu, Nov 19, 2020 at 05:26:54PM +0100, Florent Revest wrote: > > From: Florent Revest > > > > The eBPF program iterates over all files and tasks. For all socket > > files, it stores the tgid of the last task it encountered with a hand

Re: [PATCH v2 3/5] bpf: Expose bpf_sk_storage_* to iterator programs

2020-11-19 Thread KP Singh
On Thu, Nov 19, 2020 at 5:27 PM Florent Revest wrote: > > From: Florent Revest > > Iterators are currently used to expose kernel information to userspace > over fast procfs-like files but iterators could also be used to > manipulate local storage. For example, the task_file iterator could be > us

Re: [PATCH v2 2/5] bpf: Add a bpf_sock_from_file helper

2020-11-19 Thread KP Singh
r to do this a new helper > wrapping sock_from_file is added. > > This is useful to tracing programs but also other program types > inheriting this set of helpers such as iterators or LSM programs. > > Signed-off-by: Florent Revest Acked-by: KP Singh Some minor comments. &

Re: [PATCH v2 1/5] net: Remove the err argument from sock_from_file

2020-11-19 Thread KP Singh
I think you meant to send these as [PATCH bpf-next] for bpf-next. I guess we can do a round of reviews and update the next revision (if any) with the correct prefixes. On Thu, Nov 19, 2020 at 5:27 PM Florent Revest wrote: > > From: Florent Revest > > Currently, the sock_from_file prototype take

Re: [PATCH v2 bpf-next 1/4] bpf: Folding omem_charge() into sk_storage_charge()

2020-11-12 Thread KP Singh
On Thu, Nov 12, 2020 at 10:13 PM Martin KaFai Lau wrote: > > sk_storage_charge() is the only user of omem_charge(). > This patch simplifies it by folding omem_charge() into > sk_storage_charge(). > > Acked-by: Song Liu > Signed-off-by: Martin KaFai Lau Acked-by: KP Singh

Re: [PATCH v2 bpf-next 2/4] bpf: Rename some functions in bpf_sk_storage

2020-11-12 Thread KP Singh
t; > Signed-off-by: Martin KaFai Lau Acked-by: KP Singh

Re: [PATCH bpf] MAINTAINERS/bpf: Update Andrii's entry.

2020-11-12 Thread KP Singh
On Thu, Nov 12, 2020 at 9:13 PM Toke Høiland-Jørgensen wrote: > > Daniel Borkmann writes: > > > On 11/12/20 7:03 PM, Alexei Starovoitov wrote: > >> From: Alexei Starovoitov > >> > >> Andrii has been a de-facto maintainer for libbpf and other components. > >> Update maintainers entry to acknowled

Re: [PATCH bpf-next 2/3] bpf: Allow using bpf_sk_storage in FENTRY/FEXIT/RAW_TP

2020-11-10 Thread KP Singh
On Mon, Nov 9, 2020 at 9:32 PM John Fastabend wrote: > > Andrii Nakryiko wrote: > > On Fri, Nov 6, 2020 at 5:52 PM Martin KaFai Lau wrote: > > > > > > On Fri, Nov 06, 2020 at 05:14:14PM -0800, Andrii Nakryiko wrote: > > > > On Fri, Nov 6, 2020 at 2:08 PM Martin KaFai Lau wrote: > > > > > > > > >

Re: [PATCH bpf-next] selftests/bpf: Fix stat probe in d_path test

2020-09-16 Thread KP Singh
entify > the issue next time. > > [1] > https://lore.kernel.org/bpf/caadnvqj0fchopqnwm+deppyij-movveg_trefyrhdabtceu...@mail.gmail.com/ > Fixes: e4d1af4b16f8 ("selftests/bpf: Add test for d_path helper") > Signed-off-by: Jiri Olsa Acked-by: KP Singh > --- > kern

Re: [PATCH bpf-next] bpf: Fix build without BPF_LSM.

2020-08-31 Thread KP Singh
t; > > Reported-by: Björn Töpel > > Fixes: 1e6c62a88215 ("bpf: Introduce sleepable BPF programs") > > Signed-off-by: Alexei Starovoitov > > Thanks for the fix! > > Tested-by: Song Liu Thanks Björn for reporting and Alexei for fixing! Acked-by: KP Singh

Re: [PATCH v3 bpf-next 3/5] bpf: Add bpf_copy_from_user() helper.

2020-08-27 Thread KP Singh
On Fri, Aug 28, 2020 at 12:01 AM Alexei Starovoitov wrote: > > From: Alexei Starovoitov > > Sleepable BPF programs can now use copy_from_user() to access user memory. > > Signed-off-by: Alexei Starovoitov > Acked-by: Andrii Nakryiko Acked-by: KP Singh

Re: [PATCH v3 bpf-next 2/5] bpf: Introduce sleepable BPF programs

2020-08-27 Thread KP Singh
chronize_rcu_tasks() to wait for sleepable progs to finish and for > trampoline assembly to finish. > > This is the first step of introducing sleepable progs. Eventually dynamically > allocated hash maps can be allowed and networking program types can become > sleepable too. >

Re: [RFC PATCH v11 bpf-next 10/14] bpf: Add d_path helper

2020-08-17 Thread KP Singh
and adding 'path' to > bpf_helpers_doc.py script. > > Acked-by: Andrii Nakryiko Acked-by: KP Singh Thank you so much for working on this! > Signed-off-by: Jiri Olsa > --- [...] > /* integer value in 'imm' field of BPF_CALL instruction selects which helper >

Re: [PATCH v9 bpf-next 10/14] bpf: Add d_path helper

2020-08-07 Thread KP Singh
On Fri, Aug 7, 2020 at 10:35 AM Jiri Olsa wrote: > > On Fri, Aug 07, 2020 at 02:31:52AM +0200, KP Singh wrote: > > On Sat, Aug 1, 2020 at 7:04 PM Jiri Olsa wrote: > > > > > > Adding d_path helper function that returns full path for > > > > [...]

Re: [PATCH v9 bpf-next 10/14] bpf: Add d_path helper

2020-08-06 Thread KP Singh
On Sat, Aug 1, 2020 at 7:04 PM Jiri Olsa wrote: > > Adding d_path helper function that returns full path for [...] > +} > + > +BTF_SET_START(btf_allowlist_d_path) > +BTF_ID(func, vfs_truncate) > +BTF_ID(func, vfs_fallocate) > +BTF_ID(func, dentry_open) > +BTF_ID(func, vfs_getattr) > +BTF_ID(func

Re: [PATCH v4 bpf-next 10/14] bpf: Add d_path helper

2020-07-16 Thread KP Singh
On 6/28/20 9:42 PM, Jiri Olsa wrote: > On Fri, Jun 26, 2020 at 01:38:27PM -0700, Andrii Nakryiko wrote: >> On Thu, Jun 25, 2020 at 4:49 PM Jiri Olsa wrote: >>> >>> Adding d_path helper function that returns full path >>> for give 'struct path' object, which needs to be the >>> kernel BTF 'path'

Re: [PATCH v5 bpf-next 2/5] bpf: Introduce sleepable BPF programs

2020-07-01 Thread KP Singh
On Wed, Jul 1, 2020 at 5:14 PM Alexei Starovoitov wrote: > > On Wed, Jul 1, 2020 at 2:17 AM Daniel Borkmann wrote: > > ("bpf: Replace cant_sleep() with cant_migrate()"). So perhaps one way to > > catch > > bugs for sleepable progs is to add a __might_sleep() into > > __bpf_prog_enter_sleepable(

Re: [PATCH v5 bpf-next 2/5] bpf: Introduce sleepable BPF programs

2020-07-01 Thread KP Singh
On Wed, Jul 1, 2020 at 1:41 AM Alexei Starovoitov wrote: > > On Wed, Jul 01, 2020 at 01:26:44AM +0200, Daniel Borkmann wrote: > > On 6/30/20 6:33 AM, Alexei Starovoitov wrote: > > [...] > > > +/* list of non-sleepable kernel functions that are otherwise > > > + * available to attach by bpf_lsm or

Re: [PATCH v5 bpf-next 3/5] bpf: Add bpf_copy_from_user() helper.

2020-06-30 Thread KP Singh
On 29-Jun 21:33, Alexei Starovoitov wrote: > From: Alexei Starovoitov > > Sleepable BPF programs can now use copy_from_user() to access user memory. > > Signed-off-by: Alexei Starovoitov > Acked-by: Andrii Nakryiko Really looking forward! Acked-by: KP Singh > --- &

Re: [PATCH] bpf: Use tracing helpers for lsm programs

2020-06-02 Thread KP Singh
On Tue, Jun 2, 2020 at 10:13 AM Jiri Olsa wrote: > > On Mon, Jun 01, 2020 at 03:12:13PM -0700, Alexei Starovoitov wrote: > > On Mon, Jun 1, 2020 at 12:00 PM Song Liu wrote: > > > > > > On Sun, May 31, 2020 at 8:45 AM Jiri Olsa wrote: > > > > > > > > Currenty lsm uses bpf_tracing_func_proto helpe

Re: [PATCH bpf-next 3/3] selftests/bpf: basic sleepable tests

2020-05-28 Thread KP Singh
On 27-May 22:33, Alexei Starovoitov wrote: > From: Alexei Starovoitov > > Modify few tests to sanity test sleepable bpf functionality. > > Signed-off-by: Alexei Starovoitov Acked-by: KP Singh > --- > tools/testing/selftests/bpf/bench.c | 2 ++ >

Re: [PATCH bpf-next 2/3] libbpf: support sleepable progs

2020-05-28 Thread KP Singh
fexit progs will be attached to sleepable > kernel functions. > > Signed-off-by: Alexei Starovoitov Acked-by: KP Singh > --- > tools/lib/bpf/libbpf.c | 25 - > 1 file changed, 24 insertions(+), 1 deletion(-) [...] > - prog->prog_flags =

Re: [PATCH bpf-next 1/3] bpf: Introduce sleepable BPF programs

2020-05-28 Thread KP Singh
o migrate_disable() and > new bpf_map_release_elem() will do corresponding migrate_enable(). > Or explicit bpf_migrate_disable/enable() helpers will be introduced. > > Signed-off-by: Alexei Starovoitov Thanks! This will be really helpful for LSM programs. Acked-by: KP Singh > -

Re: [PATCH bpf] samples/bpf: fix build for task_fd_query_user.c

2019-10-02 Thread KP Singh
On Wed, Oct 2, 2019 at 8:46 PM Song Liu wrote: > > On Tue, Oct 1, 2019 at 4:26 AM Björn Töpel wrote: > > > > From: Björn Töpel > > > > Add missing "linux/perf_event.h" include file. > > > > Signed-off-by: Björn Töpel > > Acked-by: Son