This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH] uprobes: Fix utask->depth accounting in handle_trampoline()
- From: Anton Arapov <anton at redhat dot com>
- To: Oleg Nesterov <oleg at redhat dot com>
- Cc: Ingo Molnar <mingo at elte dot hu>, Hemant Kumar Shaw <hkshaw at linux dot vnet dot ibm dot com>, masami dot hiramatsu dot pt at hitachi dot com, Mikhail Kulemin <Mikhail dot Kulemin at ru dot ibm dot com>, srikar at linux dot vnet dot ibm dot com, systemtap at sourceware dot org, linux-kernel at vger dot kernel dot org
- Date: Thu, 12 Sep 2013 07:59:44 +0200
- Subject: Re: [PATCH] uprobes: Fix utask->depth accounting in handle_trampoline()
- Authentication-results: sourceware.org; auth=none
- References: <20130911154726 dot GA8093 at redhat dot com>
On Wed, Sep 11, 2013 at 05:47:26PM +0200, Oleg Nesterov wrote:
> Currently utask->depth is simply the number of allocated/pending
> return_instance's in uprobe_task->return_instances list.
>
> handle_trampoline() should decrement this counter every time we
> handle/free an instance, but due to typo it does this only if
> ->chained == T. This means that in the likely case this counter
> is never decremented and the probed task can't report more than
> MAX_URETPROBE_DEPTH events.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
> Reported-by: Mikhail Kulemin <Mikhail.Kulemin@ru.ibm.com>
> Reported-by: Hemant Kumar Shaw <hkshaw@linux.vnet.ibm.com>
Acked-by: Anton Arapov <anton@redhat.com>
> ---
> kernel/events/uprobes.c | 4 +---
> 1 files changed, 1 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
> index f356974..ad8e1bd 100644
> --- a/kernel/events/uprobes.c
> +++ b/kernel/events/uprobes.c
> @@ -1682,12 +1682,10 @@ static bool handle_trampoline(struct pt_regs *regs)
> tmp = ri;
> ri = ri->next;
> kfree(tmp);
> + utask->depth--;
>
> if (!chained)
> break;
> -
> - utask->depth--;
> -
> BUG_ON(!ri);
> }
>
> --
> 1.5.5.1
>
>