From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10272 invoked by alias); 11 Sep 2013 15:54:18 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 10261 invoked by uid 89); 11 Sep 2013 15:54:17 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Sep 2013 15:54:17 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8BFrawa015844 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 11 Sep 2013 11:53:37 -0400 Received: from tranklukator.brq.redhat.com (dhcp-1-191.brq.redhat.com [10.34.1.191]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id r8BFrWiA021201; Wed, 11 Sep 2013 11:53:34 -0400 Received: by tranklukator.brq.redhat.com (nbSMTP-1.00) for uid 500 oleg@redhat.com; Wed, 11 Sep 2013 17:47:30 +0200 (CEST) Date: Wed, 11 Sep 2013 15:54:00 -0000 From: Oleg Nesterov To: Ingo Molnar Cc: anton@redhat.com, Hemant Kumar Shaw , masami.hiramatsu.pt@hitachi.com, Mikhail Kulemin , srikar@linux.vnet.ibm.com, systemtap@sourceware.org, linux-kernel@vger.kernel.org Subject: [PATCH] uprobes: Fix utask->depth accounting in handle_trampoline() Message-ID: <20130911154726.GA8093@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-SW-Source: 2013-q3/txt/msg00300.txt.bz2 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 Reported-by: Mikhail Kulemin Reported-by: Hemant Kumar Shaw --- 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