On 09/09, Anton Arapov wrote:On Sun, Sep 08, 2013 at 06:32:32PM +0200, Oleg Nesterov wrote:Chained or not, we allocate return_instance every time, so we certainlyNot sure, but I can be easily wrong... afaics we need something like below, no?Oleg, your guess is correct.
Anton?
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.
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)'OK, thanks, I'll write the changelog and re-send the patch below.
check. I think it got mangled somehow when I rebased the code before I sent it
to lkml.
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);
}