Re: [PATCH v4 4/8] uprobes: travers uprobe's consumer list locklessly under SRCU protection
From: Oleg Nesterov
Date: Tue Sep 03 2024 - 14:27:59 EST
On 09/03, Andrii Nakryiko wrote:
>
> On Tue, Sep 3, 2024 at 10:27 AM Andrii Nakryiko
> <andrii.nakryiko@xxxxxxxxx> wrote:
> >
> > On Sat, Aug 31, 2024 at 9:19 AM Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> > >
> > > But. Since you are going to send another version, may I ask you to add a
> > > note into the changelog to explain that this patch assumes (and enforces)
> > > the rule about handler/filter consistency?
> >
> > Yep, will do. I will also leave a comment next to the filter callback
> > definition in uprobe_consumer about this.
> >
>
> Ok, I'm adding this:
>
> diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h
> index 29c935b0d504..33236d689d60 100644
> --- a/include/linux/uprobes.h
> +++ b/include/linux/uprobes.h
> @@ -29,6 +29,14 @@ struct page;
> #define MAX_URETPROBE_DEPTH 64
>
> struct uprobe_consumer {
> + /*
> + * handler() can return UPROBE_HANDLER_REMOVE to signal the need to
> + * unregister uprobe for current process. If UPROBE_HANDLER_REMOVE is
> + * returned, filter() callback has to be implemented as well and it
> + * should return false to "confirm" the decision to uninstall uprobe
> + * for the current process. If filter() is omitted or returns true,
> + * UPROBE_HANDLER_REMOVE is effectively ignored.
> + */
Thanks, LGTM.
Oleg.