From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AG47ELsDxv3kSI0ea3EUVlfOAAqsCeIjBdGvhiMKJvE4wQMFgWbZ63TN2SmsQ7KflUwkNECUo3dw ARC-Seal: i=1; a=rsa-sha256; t=1520363271; cv=none; d=google.com; s=arc-20160816; b=AiTwHTt1YjlAvptJFTIz2U46jJK1mn+HVKwUQSBlPsMQdWMZi/Z/y2c4mqjJHtrd1+ Gzdc79i8KQfxOG99xe+jtp3SXaHsUQJR3XxfJTLrlhPuVW3oEizf8v+5HET9l6WFsGIq J+vM5oK0cBLPhoPU5Ed0uhoXvrsVDjTUS+qYo6Ct3E70PdkR23e2uq83zkCJD1aOy1F7 ENkzbSZoYqrUe2LsNf0PICama/udv3ZinGQldxTJcoLOeAIHJMQdwjfh8uUu0C5sbw9k sSHDIg9J6dwsOt0ACjvfrwLg6UFSBKzuoW+EwadfmoTVRlyi1JWi2AHPaOVnJn6IwTkb dU7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=sK0Ah4WgTXCFRU5csWSmrDfL3rCAAz++CWQbcLeLKxM=; b=lpxptpeyRbUPy2RRP5p8ZfirZEGrRj1UFzBnHXnuq9qQU0AuMTjrC2juEbGOy46TqK uo0Nk2JJdBgkkLW43b8B1l9/z8Q0rbqAZ7FnVkQrljrdT5kE2nWJIoJrvf3ikSdGPx65 KROJB4hSPyo8e0BnJcPtt1yIHJWKs3Jz9gQ5hnqLr0q9E6P2T7LiF02YTZi9J3Ist7tY HfROI+LP5EpCNB4oDHdwLk7i7d7Rq2rpIoNzCrEFfTyuRz5/sMu/BGn5cK44GCi5kmME 4I/7is01qZH44DrkYynY6WlUob5HL2vqORThdRcdtXr3DzRdLleXPPs+GFA1jONi/4As sSsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=tURNZsih; spf=pass (google.com: best guess record for domain of peterz@infradead.org designates 198.137.202.133 as permitted sender) smtp.mailfrom=peterz@infradead.org Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=tURNZsih; spf=pass (google.com: best guess record for domain of peterz@infradead.org designates 198.137.202.133 as permitted sender) smtp.mailfrom=peterz@infradead.org Date: Tue, 6 Mar 2018 20:07:20 +0100 From: Peter Zijlstra To: Linus Torvalds Cc: Daniel Micay , Ingo Molnar , Kees Cook , Dave Hansen , Alexander Popov , Kernel Hardening , PaX Team , Brad Spengler , Andy Lutomirski , Tycho Andersen , Laura Abbott , Mark Rutland , Ard Biesheuvel , Borislav Petkov , Richard Sandiford , Thomas Gleixner , "H . Peter Anvin" , "Dmitry V . Levin" , Emese Revfy , Jonathan Corbet , Andrey Ryabinin , "Kirill A . Shutemov" , Thomas Garnier , Andrew Morton , Alexei Starovoitov , Josef Bacik , Masami Hiramatsu , Nicholas Piggin , Al Viro , "David S . Miller" , Ding Tianhong , David Woodhouse , Josh Poimboeuf , Steven Rostedt , Dominik Brodowski , Juergen Gross , Greg Kroah-Hartman , Dan Williams , Mathias Krause , Vikas Shivappa , Kyle Huey , Dmitry Safonov , Will Deacon , Arnd Bergmann , X86 ML , LKML Subject: Re: [PATCH RFC v9 4/7] x86/entry: Erase kernel stack in syscall_trace_enter() Message-ID: <20180306190720.GK25181@hirez.programming.kicks-ass.net> References: <1520107232-14111-1-git-send-email-alex.popov@linux.com> <1520107232-14111-5-git-send-email-alex.popov@linux.com> <20180306080855.phtgl2bzqm5hnthu@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1593947986518331727?= X-GMAIL-MSGID: =?utf-8?q?1594216437174384915?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: On Tue, Mar 06, 2018 at 10:56:58AM -0800, Linus Torvalds wrote: > On Tue, Mar 6, 2018 at 7:16 AM, Daniel Micay wrote: > > > > Zeroing locals isn't very expensive because the compiler has a chance > > to optimize it out when it can figure out it isn't needed and they're > > almost always used. > > I thought I saw Kees with some stats, and it wasn't even noticeable. > But maybe I mis-remember. > > I definitely like the "zero local variables", and would actually > prefer something even stronger than GCC_PLUGIN_STRUCTLEAK_BYREF_ALL > (although I can't actually read gcc plugins, so I'm just going by > name). > > It's not necessarily just struct, it can very much be arrays and > regular automatic variables too. > > And yes, we might want to have some override switch for individual > variables ("I really know what I'm doing and I promise I fill it > myself, but the compiler doesn't understand me, look here:"). Right, I have one case in perf where we very carefully pass a partially initialized structure around for performance raisins. So I would definitely like to have that attribute that allows us to over-ride that BYREF_ALL thing.