Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5706461imu; Tue, 13 Nov 2018 10:26:28 -0800 (PST) X-Google-Smtp-Source: AJdET5eg1dd+K5DWZ05zdCZwDwUGog1jZinKDLtSIlvyJQPLkDas24eyMEt8Wu+wKdhpFUpLPNww X-Received: by 2002:a62:f5da:: with SMTP id b87mr6310884pfm.253.1542133588455; Tue, 13 Nov 2018 10:26:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542133588; cv=none; d=google.com; s=arc-20160816; b=yfiY2xgaD0Wa6nfQzBtsITuFVyRyKMeJLZapAYRBb65NkEoGnI5HObXQJfOt3VQNSv BC3ilEiFut9V3+JSf7YJ3fNLtzAYvPcRuawsFuiGT3DVCat/d0XAOulUx7UgJ98cqTHJ Gr812ME1ZuWC23+w1E2i1WpLQn31jIjh8K+HAd8z6p6iBCScgine6vMCoYXJsVofUnXq AwS7GRfZuC9px8IkV4587e0hb9AEfOu2z6lofuAgQxDGEIKu+J5vDAleXkOudkjQcz3+ H4zpVqQ4HkK5gNJoiiJFCOP9IMc/sngSqd9uWH1nTxg3HValh9/mLxi+z4LiSKcIqwxk t9xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=YAiG+fVsan9eaGC59/5aeu/pGE+oUoDwiIH6e+8Rfko=; b=mDmvCR2TPZn1bJ1Jda2tY0pCrmewSJbDfxYbhL6Iy4tBUvd4XNe2M+w5O/ibRl6YuM nZxzwLiEi1HgwOiT+6uxPHdjMclWIXS24mMKz1/HNHiLNcRI7NWMDzbV4zOk77FKSN+r 6YzrhOobQBmTokdNN1mm6csvMQ66Vuk6E1NwcIj/PaREG4JvNmq5CwL7xXSbSWjyl7aX rbSgrovJ4eSYq7cqZlujoqioQCAzFPD2DmQ51vqxBJWs+INCpoS7pXyVXKkdhyrA/3RS EfJkxy9eTYtZqXTe6vMFDexPKnw1he9v17AqwKxwrEivg+i88VK5eZxkHlN/UOPfwFBQ MffQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RmP5lA2j; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t5si3656894pgm.79.2018.11.13.10.26.11; Tue, 13 Nov 2018 10:26:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RmP5lA2j; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727551AbeKNEWt (ORCPT + 99 others); Tue, 13 Nov 2018 23:22:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:40412 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726459AbeKNEWt (ORCPT ); Tue, 13 Nov 2018 23:22:49 -0500 Received: from devnote (unknown [64.114.255.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D4401206BB; Tue, 13 Nov 2018 18:23:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542133413; bh=l6VGobAswRrMZlN6IKWBWaezIpPx4k9brX5u5TtFf8s=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=RmP5lA2jziI8SbKDXnNsOavARyNi67q8FvsGwG0BX69ELlefR0Fb4IPTonAilGH3C ae81FC0b2dO4wYLD+FEI4X+fqft50p0AtiWop6nRtWdUC50i7fTt02KIZl8N3F4Yt3 MMDvBJd//OOX7eHumEmB0+BTw+pylBAP96S3i278= Date: Tue, 13 Nov 2018 10:23:32 -0800 From: Masami Hiramatsu To: Alexander Popov Cc: kernel-hardening@lists.openwall.com, Kees Cook , Jann Horn , Ingo Molnar , Andy Lutomirski , Joerg Roedel , Borislav Petkov , Thomas Gleixner , Dave Hansen , Steven Rostedt , Peter Zijlstra , Jan Kara , Mathieu Desnoyers , Dan Williams , Masahiro Yamada , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] stackleak: Disable function tracing and kprobes for stackleak_erase() Message-Id: <20181113102332.00a97f983a2b361328fab9af@kernel.org> In-Reply-To: <1542056928-10917-1-git-send-email-alex.popov@linux.com> References: <1542056928-10917-1-git-send-email-alex.popov@linux.com> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.30; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 13 Nov 2018 00:08:48 +0300 Alexander Popov wrote: > The stackleak_erase() function is called on the trampoline stack at the end > of syscall. This stack is not big enough for ftrace and kprobes operations, > e.g. it can be exhausted if we use kprobe_events for stackleak_erase(). > > So let's disable function tracing and kprobes for stackleak_erase(). > > Reported-by: kernel test robot > Signed-off-by: Alexander Popov Reviewed-by: Masami Hiramatsu Thank you! > --- > kernel/stackleak.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/kernel/stackleak.c b/kernel/stackleak.c > index e428929..08cb57e 100644 > --- a/kernel/stackleak.c > +++ b/kernel/stackleak.c > @@ -11,6 +11,7 @@ > */ > > #include > +#include > > #ifdef CONFIG_STACKLEAK_RUNTIME_DISABLE > #include > @@ -47,7 +48,7 @@ int stack_erasing_sysctl(struct ctl_table *table, int write, > #define skip_erasing() false > #endif /* CONFIG_STACKLEAK_RUNTIME_DISABLE */ > > -asmlinkage void stackleak_erase(void) > +asmlinkage void notrace stackleak_erase(void) > { > /* It would be nice not to have 'kstack_ptr' and 'boundary' on stack */ > unsigned long kstack_ptr = current->lowest_stack; > @@ -101,6 +102,7 @@ asmlinkage void stackleak_erase(void) > /* Reset the 'lowest_stack' value for the next syscall */ > current->lowest_stack = current_top_of_stack() - THREAD_SIZE/64; > } > +NOKPROBE_SYMBOL(stackleak_erase); > > void __used stackleak_track_stack(void) > { > -- > 2.7.4 > -- Masami Hiramatsu