mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Oleg Nesterov <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
	hkshaw@linux.vnet.ibm.com, anton@redhat.com, tglx@linutronix.de,
	oleg@redhat.com, Mikhail.Kulemin@ru.ibm.com
Subject: [tip:perf/urgent] uprobes: Fix utask-> depth accounting in handle_trampoline()
Date: Thu, 12 Sep 2013 04:11:37 -0700	[thread overview]
Message-ID: <tip-878b5a6efd38030c7a90895dc8346e8fb1e09b4c@git.kernel.org> (raw)
In-Reply-To: <20130911154726.GA8093@redhat.com>

Commit-ID:  878b5a6efd38030c7a90895dc8346e8fb1e09b4c
Gitweb:     http://git.kernel.org/tip/878b5a6efd38030c7a90895dc8346e8fb1e09b4c
Author:     Oleg Nesterov <oleg@redhat.com>
AuthorDate: Wed, 11 Sep 2013 17:47:26 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 12 Sep 2013 08:00:55 +0200

uprobes: Fix utask->depth accounting in handle_trampoline()

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
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/20130911154726.GA8093@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/events/uprobes.c | 4 +---
 1 file changed, 1 insertion(+), 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);
 	}
 

      parent reply	other threads:[~2013-09-12 11:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-11 15:47 [PATCH] uprobes: Fix utask->depth " Oleg Nesterov
2013-09-12  6:49 ` Srikar Dronamraju
2013-09-12 11:11 ` tip-bot for Oleg Nesterov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-878b5a6efd38030c7a90895dc8346e8fb1e09b4c@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=Mikhail.Kulemin@ru.ibm.com \
    --cc=anton@redhat.com \
    --cc=hkshaw@linux.vnet.ibm.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome