This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH] uprobes: Fix limiting un-nested return probes
- From: Oleg Nesterov <oleg at redhat dot com>
- To: Anton Arapov <anton at redhat dot com>
- Cc: Hemant Kumar Shaw <hkshaw at linux dot vnet dot ibm dot com>, linux-kernel at vger dot kernel dot org, Mikhail dot Kulemin at ru dot ibm dot com, srikar at linux dot vnet dot ibm dot com, peterz at infradead dot org, mingo at redhat dot com, systemtap at sourceware dot org, masami dot hiramatsu dot pt at hitachi dot com
- Date: Mon, 9 Sep 2013 16:55:15 +0200
- Subject: Re: [PATCH] uprobes: Fix limiting un-nested return probes
- Authentication-results: sourceware.org; auth=none
- References: <20130903060959 dot 1351 dot 16587 dot stgit at hemant-fedora> <20130908163232 dot GA32685 at redhat dot com> <20130909083635 dot GA3270 at bandura dot laptop>
On 09/09, Anton Arapov wrote:
>
> On Sun, Sep 08, 2013 at 06:32:32PM +0200, Oleg Nesterov wrote:
> >
> > Not sure, but I can be easily wrong... afaics we need something like below, no?
> > Anton?
>
> Oleg, your guess is correct.
>
> My original intention was to limit by depth the chained only probes. But later,
> after your review, we've decided /based on safety concerns/ to limit it hard.
Chained or not, we allocate return_instance every time, so we certainly
need to account to limit the depth unconditionally. Unless we reuse the
same return_instance if chained, but this is another story.
> The decrement 'utask->depth--;' in my own tree is above the 'if (!chained)'
> check. I think it got mangled somehow when I rebased the code before I sent it
> to lkml.
OK, thanks, I'll write the changelog and re-send the patch below.
> Anton.
>
>
> > Oleg.
> >
> > --- x/kernel/events/uprobes.c
> > +++ x/kernel/events/uprobes.c
> > @@ -1682,12 +1682,10 @@ static bool handle_trampoline(struct pt_
> > tmp = ri;
> > ri = ri->next;
> > kfree(tmp);
> > + utask->depth--;
> >
> > if (!chained)
> > break;
> > -
> > - utask->depth--;
> > -
> > BUG_ON(!ri);
> > }