Re: [RFC bpf-next 01/10] uprobe: Add session callbacks to uprobe_consumer

2024-06-19 Thread Jiri Olsa
On Mon, Jun 17, 2024 at 03:53:50PM -0700, Andrii Nakryiko wrote: > On Mon, Jun 10, 2024 at 4:06 AM Jiri Olsa wrote: > > > > On Thu, Jun 06, 2024 at 09:52:39AM -0700, Andrii Nakryiko wrote: > > > On Thu, Jun 6, 2024 at 9:46 AM Jiri Olsa wrote: > > > > > > > > On Wed, Jun 05, 2024 at 10:50:11PM +02

Re: [RFC bpf-next 01/10] uprobe: Add session callbacks to uprobe_consumer

2024-06-17 Thread Andrii Nakryiko
On Mon, Jun 10, 2024 at 4:06 AM Jiri Olsa wrote: > > On Thu, Jun 06, 2024 at 09:52:39AM -0700, Andrii Nakryiko wrote: > > On Thu, Jun 6, 2024 at 9:46 AM Jiri Olsa wrote: > > > > > > On Wed, Jun 05, 2024 at 10:50:11PM +0200, Jiri Olsa wrote: > > > > On Wed, Jun 05, 2024 at 07:56:19PM +0200, Oleg N

Re: [RFC bpf-next 01/10] uprobe: Add session callbacks to uprobe_consumer

2024-06-10 Thread Jiri Olsa
On Thu, Jun 06, 2024 at 09:52:39AM -0700, Andrii Nakryiko wrote: > On Thu, Jun 6, 2024 at 9:46 AM Jiri Olsa wrote: > > > > On Wed, Jun 05, 2024 at 10:50:11PM +0200, Jiri Olsa wrote: > > > On Wed, Jun 05, 2024 at 07:56:19PM +0200, Oleg Nesterov wrote: > > > > On 06/05, Andrii Nakryiko wrote: > > >

Re: [RFC bpf-next 01/10] uprobe: Add session callbacks to uprobe_consumer

2024-06-06 Thread Andrii Nakryiko
On Thu, Jun 6, 2024 at 9:46 AM Jiri Olsa wrote: > > On Wed, Jun 05, 2024 at 10:50:11PM +0200, Jiri Olsa wrote: > > On Wed, Jun 05, 2024 at 07:56:19PM +0200, Oleg Nesterov wrote: > > > On 06/05, Andrii Nakryiko wrote: > > > > > > > > so any such > > > > limitations will cause problems, issue report

Re: [RFC bpf-next 01/10] uprobe: Add session callbacks to uprobe_consumer

2024-06-06 Thread Jiri Olsa
On Wed, Jun 05, 2024 at 10:50:11PM +0200, Jiri Olsa wrote: > On Wed, Jun 05, 2024 at 07:56:19PM +0200, Oleg Nesterov wrote: > > On 06/05, Andrii Nakryiko wrote: > > > > > > so any such > > > limitations will cause problems, issue reports, investigation, etc. > > > > Agreed... > > > > > As one pos

Re: [RFC bpf-next 01/10] uprobe: Add session callbacks to uprobe_consumer

2024-06-05 Thread Oleg Nesterov
On 06/05, Andrii Nakryiko wrote: > > WDYT? It's still fast, and it's simpler than the shadow stack idea, IMO. Andrii. I am alredy sleeping, I'll try to read your email tomorrow. Right now I can only say that everything is simpler than the shadow stack ;) > P.S. Regardless, maybe we should change

Re: [RFC bpf-next 01/10] uprobe: Add session callbacks to uprobe_consumer

2024-06-05 Thread Jiri Olsa
On Wed, Jun 05, 2024 at 01:47:00PM -0700, Andrii Nakryiko wrote: > On Wed, Jun 5, 2024 at 10:57 AM Oleg Nesterov wrote: > > > > On 06/05, Andrii Nakryiko wrote: > > > > > > so any such > > > limitations will cause problems, issue reports, investigation, etc. > > > > Agreed... > > > > > As one poss

Re: [RFC bpf-next 01/10] uprobe: Add session callbacks to uprobe_consumer

2024-06-05 Thread Oleg Nesterov
On 06/05, Jiri Olsa wrote: > > > And the comment about the return value looks confusing too. I mean, the > > logic doesn't differ from the ret-code from ->handler(). > > > > "DO NOT install/execute the return uprobe" is not true if another > > non-session-consumer returns 0. > > well they are meant

Re: [RFC bpf-next 01/10] uprobe: Add session callbacks to uprobe_consumer

2024-06-05 Thread Jiri Olsa
On Wed, Jun 05, 2024 at 10:25:56AM -0700, Andrii Nakryiko wrote: SNIP > > --- > > include/linux/uprobes.h | 18 +++ > > kernel/events/uprobes.c | 69 +++-- > > 2 files changed, 78 insertions(+), 9 deletions(-) > > > > diff --git a/include/linux/uprobes

Re: [RFC bpf-next 01/10] uprobe: Add session callbacks to uprobe_consumer

2024-06-05 Thread Jiri Olsa
On Wed, Jun 05, 2024 at 07:56:19PM +0200, Oleg Nesterov wrote: > On 06/05, Andrii Nakryiko wrote: > > > > so any such > > limitations will cause problems, issue reports, investigation, etc. > > Agreed... > > > As one possible solution, what if we do > > > > struct return_instance { > > ... >

Re: [RFC bpf-next 01/10] uprobe: Add session callbacks to uprobe_consumer

2024-06-05 Thread Andrii Nakryiko
On Wed, Jun 5, 2024 at 10:57 AM Oleg Nesterov wrote: > > On 06/05, Andrii Nakryiko wrote: > > > > so any such > > limitations will cause problems, issue reports, investigation, etc. > > Agreed... > > > As one possible solution, what if we do > > > > struct return_instance { > > ... > > u64

Re: [RFC bpf-next 01/10] uprobe: Add session callbacks to uprobe_consumer

2024-06-05 Thread Jiri Olsa
On Wed, Jun 05, 2024 at 06:36:25PM +0200, Oleg Nesterov wrote: > On 06/05, Oleg Nesterov wrote: > > > > On 06/05, Oleg Nesterov wrote: > > > > > > > +/* > > > > + * Make sure all the uprobe consumers have only one type of entry > > > > + * callback registered (either handler or handler_session) due

Re: [RFC bpf-next 01/10] uprobe: Add session callbacks to uprobe_consumer

2024-06-05 Thread Oleg Nesterov
On 06/05, Andrii Nakryiko wrote: > > so any such > limitations will cause problems, issue reports, investigation, etc. Agreed... > As one possible solution, what if we do > > struct return_instance { > ... > u64 session_cookies[]; > }; > > and allocate sizeof(struct return_instance) + 8 *

Re: [RFC bpf-next 01/10] uprobe: Add session callbacks to uprobe_consumer

2024-06-05 Thread Andrii Nakryiko
On Tue, Jun 4, 2024 at 1:02 PM Jiri Olsa wrote: > > Adding new set of callbacks that are triggered on entry and return > uprobe execution for the attached function. > > The session means that those callbacks are 'connected' in a way > that allows to: > - control execution of return callback from

Re: [RFC bpf-next 01/10] uprobe: Add session callbacks to uprobe_consumer

2024-06-05 Thread Oleg Nesterov
On 06/05, Oleg Nesterov wrote: > > On 06/05, Oleg Nesterov wrote: > > > > > +/* > > > + * Make sure all the uprobe consumers have only one type of entry > > > + * callback registered (either handler or handler_session) due to > > > + * different return value actions. > > > + */ > > > +static int co

Re: [RFC bpf-next 01/10] uprobe: Add session callbacks to uprobe_consumer

2024-06-05 Thread Oleg Nesterov
On 06/05, Oleg Nesterov wrote: > > > +/* > > + * Make sure all the uprobe consumers have only one type of entry > > + * callback registered (either handler or handler_session) due to > > + * different return value actions. > > + */ > > +static int consumer_check(struct uprobe_consumer *curr, struct

Re: [RFC bpf-next 01/10] uprobe: Add session callbacks to uprobe_consumer

2024-06-05 Thread Oleg Nesterov
I'll try to read this code tomorrow, right now I don't really understand what does it do and why. However, On 06/04, Jiri Olsa wrote: > > struct uprobe_consumer { > + /* > + * The handler callback return value controls removal of the uprobe. > + * 0 on success, uprobe stays > +

[RFC bpf-next 01/10] uprobe: Add session callbacks to uprobe_consumer

2024-06-04 Thread Jiri Olsa
Adding new set of callbacks that are triggered on entry and return uprobe execution for the attached function. The session means that those callbacks are 'connected' in a way that allows to: - control execution of return callback from entry callback - share data between entry and return callba