Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5811166imu; Tue, 13 Nov 2018 12:07:40 -0800 (PST) X-Google-Smtp-Source: AJdET5dkDspOqXrOcuH/M1oI+22sqlTVHwZu/ziiBsAgPCabUOUdHhuLirzHU9CUyIzcrRuwk9Mu X-Received: by 2002:a62:4105:: with SMTP id o5-v6mr6408542pfa.85.1542139660184; Tue, 13 Nov 2018 12:07:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542139660; cv=none; d=google.com; s=arc-20160816; b=H3kn1YBsMD7Uwhb0bye5Xy6jAdFFdl78UPufeKhfwaFvJWqGTge8V6r3TlKd9cng5n SXEspMbnxX8lWH8hDh3E+Ct2OiocBXVbW+fDSps0cIxmVct8mw++1PF+vIbaYgPYakDO evp9/1FYPHUoBChKSPZfhW4d8Pj1lw34MyqLocZxuztg9N8XWV1SEirycmsiGG+6N1nD Ur7BNgj0avttM8cltgCyG4dol7sNN9lHfZ+7sAY3epL14gt1iNrfhuPHE3Ehlw7ekxTx vdIwQMlTok9cUNrWR48/OAhyEwu1dlnM/u+GN+OiMBzVy7Rw9pGNXDvVTym1Ffd5pWKh iF2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=RTO61L+kG+makdsrA5/OtWEuhnz9rHNDoeryJiudz+Y=; b=u91VbwXmstn4B3yPtnrWiu0rbSmZInoxc6yVoKButSn3nnk6oI4UVL0HlPBsk82Rl3 cSHdy284XtrKuzdeumeeGWXezwdkRqqLCezzjheEA5nZgY2lRu4M9D8qiGGdNYPAI759 iz7/ndY0bUK/VehzyVJezs+3upJt6YUi4PhKQ//4m9qBRZ3YanH41urgcGT89UOXpoRE 6cmXEyFa2y7Z84etLDesU75iPJPNyDX+XKAiggoczNOqUwIkneiq7x/PYLHDR87d0FL2 U6ySWxgcIKPSdVxjrw1o7mtAGVSODQe/VInle2yfeoSpn3JgPK0gO06OupDzkCWNVzV2 BaWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jw7cO068; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u5si7465787pgr.316.2018.11.13.12.07.23; Tue, 13 Nov 2018 12:07:40 -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=@chromium.org header.s=google header.b=jw7cO068; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726659AbeKNGGl (ORCPT + 99 others); Wed, 14 Nov 2018 01:06:41 -0500 Received: from mail-yw1-f67.google.com ([209.85.161.67]:43573 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725748AbeKNGGl (ORCPT ); Wed, 14 Nov 2018 01:06:41 -0500 Received: by mail-yw1-f67.google.com with SMTP id l200so731833ywe.10 for ; Tue, 13 Nov 2018 12:06:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RTO61L+kG+makdsrA5/OtWEuhnz9rHNDoeryJiudz+Y=; b=jw7cO068mMbkhhWPLC3B7OriZJ/mCixGjxxlviueNCDTtQKLpaRTtiUG7MOycMjfSy wKz2v6c0Ma99lfHcGktJvUFyWwmnIZa/2iCo+d3t4wQH9CRNoIjB3YF+FTZLkrWMIv7T 8azHKF92eQo8PE7C6zrRAqCen5HsVtfQcjod8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=RTO61L+kG+makdsrA5/OtWEuhnz9rHNDoeryJiudz+Y=; b=i9GrCZwfWxQLB1GH6UvdfOghWcl4hver6UZH0Mrvlo/FXAm5pnsrLGL+MkR6E+VMRC wSvf2QM/z1cyesH7en43crRSYbxe8kUKRtSjMaYyUNLOm9Yr9pUFjzYGaF1HRldpto+v wppUj/Qp4e3aUu8OUNmsXOzALUxA5cZofz6/WX1ThzBGnP/zDWAMz9OuCe7IeJHQuxj7 a71Di0yC+N0zmRWuNUDIfVmrMAkto+rXj7AkBAgJgSrdt7FwOXHiHEAcHGn1rcwQ+QS6 q7QXTgNPDlSjMyvgY3Oaz7vgFZ9FIQdBdwgjp7xI0jRmUjiuR+F5IUaQ8d+YQTi5R+Yn QDzg== X-Gm-Message-State: AGRZ1gLuHNg5q/8WK+hchRQSFaftYXP5VL+kUK0tZcrPnChV1EQUat48 +jscVv8JgVzJfhFPt20nPDPTTxNprK0= X-Received: by 2002:a81:5946:: with SMTP id n67-v6mr6247781ywb.351.1542139618359; Tue, 13 Nov 2018 12:06:58 -0800 (PST) Received: from mail-yw1-f53.google.com (mail-yw1-f53.google.com. [209.85.161.53]) by smtp.gmail.com with ESMTPSA id l6-v6sm715585ywm.51.2018.11.13.12.06.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 12:06:56 -0800 (PST) Received: by mail-yw1-f53.google.com with SMTP id h32so230255ywk.2 for ; Tue, 13 Nov 2018 12:06:55 -0800 (PST) X-Received: by 2002:a0d:e984:: with SMTP id s126-v6mr6232284ywe.47.1542139614653; Tue, 13 Nov 2018 12:06:54 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a25:b906:0:0:0:0:0 with HTTP; Tue, 13 Nov 2018 12:06:53 -0800 (PST) In-Reply-To: <1542056928-10917-1-git-send-email-alex.popov@linux.com> References: <1542056928-10917-1-git-send-email-alex.popov@linux.com> From: Kees Cook Date: Tue, 13 Nov 2018 14:06:53 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/1] stackleak: Disable function tracing and kprobes for stackleak_erase() To: Alexander Popov Cc: Kernel Hardening , 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 , Masami Hiramatsu , X86 ML , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 12, 2018 at 3:08 PM, 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 Thanks! I'll get this into my tree. -Kees > --- > 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 > -- Kees Cook