This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[ 091/117] uprobes: Fix utask->depth accounting in handle_trampoline()
- From: Greg Kroah-Hartman <gregkh at linuxfoundation dot org>
- To: linux-kernel at vger dot kernel dot org
- Cc: Greg Kroah-Hartman <gregkh at linuxfoundation dot org>, stable at vger dot kernel dot org, Mikhail Kulemin <Mikhail dot Kulemin at ru dot ibm dot com>, Hemant Kumar Shaw <hkshaw at linux dot vnet dot ibm dot com>, Oleg Nesterov <oleg at redhat dot com>, Anton Arapov <anton at redhat dot com>, Ingo Molnar <mingo at kernel dot org>, masami dot hiramatsu dot pt at hitachi dot com, srikar at linux dot vnet dot ibm dot com, systemtap at sourceware dot org
- Date: Tue, 24 Sep 2013 17:19:17 -0700
- Subject: [ 091/117] uprobes: Fix utask->depth accounting in handle_trampoline()
- Authentication-results: sourceware.org; auth=none
- References: <20130925001740 dot 833541979 at linuxfoundation dot org>
3.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <oleg@redhat.com>
commit 878b5a6efd38030c7a90895dc8346e8fb1e09b4c upstream.
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.
Reported-by: Mikhail Kulemin <Mikhail.Kulemin@ru.ibm.com>
Reported-by: Hemant Kumar Shaw <hkshaw@linux.vnet.ibm.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Anton Arapov <anton@redhat.com>
Cc: masami.hiramatsu.pt@hitachi.com
Cc: srikar@linux.vnet.ibm.com
Cc: systemtap@sourceware.org
Link: 20130911154726.GA8093@redhat.com">http://lkml.kernel.org/r/20130911154726.GA8093@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/events/uprobes.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--- a/kernel/events/uprobes.c
+++ b/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);
}