Received: by 10.223.185.116 with SMTP id b49csp3013571wrg; Mon, 5 Mar 2018 12:28:24 -0800 (PST) X-Google-Smtp-Source: AG47ELtIWJN3bxDSeeTRp7C88EShklMi75LamheqKTwhWdJBKcEAsG5nDXU/5etH8v0a6Cg9cs+I X-Received: by 2002:a17:902:724b:: with SMTP id c11-v6mr14267946pll.352.1520281704072; Mon, 05 Mar 2018 12:28:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520281704; cv=none; d=google.com; s=arc-20160816; b=WBZzlZSoJluCqwo5UAK77Sk/oxU9UwDpSBlSxrOtWCFn7wJyw0+bFxqx5BJX1tvo1y 8sZeVI0PG92dsJPCi/RGc8k/hHZE7q35kkLDUlGProtQH5GA3o/cdjmplbnCYV8U7HUV vYImTAyYz+ZkRb2M3oPdajVpdHp1Nk/1qwmwmUpBk2otoXz0hsPJHvy0SflFrUsEr7O3 anitKfEB3xK2sGTB8ITwAfTzfI0Csvk+1LkquOh1XN26dxvz6srzoUdD7YilOEjd9srO YtCCMUJUA22y2v+fhW4BW4eqc6yTVRT21dKpg+aO3PXaPDR+6sLdm7RFrHUbR2Uq1fKb q2KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=GxWc+s78YbuiFJbOw/ieTGdfveeeBjdGT0dAp/UPLrA=; b=sAH9UzeszlSBWeqLEicBsdHG11+Q/epc4m4AhYbYYALI0u3gJWKGjjEHBIOzjrZ5x4 Lyv+1VYUJNnKPOqCyN+gLG7VkytdEmwjlio9tZ8KinDVTjaPbFgUDqw1i/17YuJruu/u dnOydCWRrO4mzox7JQ4ZQFQxXPDlbbkNrchN4qD2FGck7O6WLhIRcFd8CjDMntX5mWIj C6/eUPS6if5OceWQoMwA+tdxrIR0V/3aWCzKBTtvtyXCLMS6KwnkPMNzOIgHU7olUpnz 5grm7lNmZh255kvxKWoK/VB9tGDdaQwbos3MyNfoK2XHUI9iRunqsmXoF94KXEI7sHc9 bLgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=M9QaGhrs; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q195si7656100pgq.309.2018.03.05.12.28.10; Mon, 05 Mar 2018 12:28:24 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=M9QaGhrs; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753134AbeCEU0a (ORCPT + 99 others); Mon, 5 Mar 2018 15:26:30 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:54242 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752999AbeCEU03 (ORCPT ); Mon, 5 Mar 2018 15:26:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=GxWc+s78YbuiFJbOw/ieTGdfveeeBjdGT0dAp/UPLrA=; b=M9QaGhrsvQzoqgYkaRAGN3eYb Vto189823rB46yQp8lyB7FRSbp3NlVc89sdaa6qfTmnhuzBu1huDUYP49UTqxdRLfJxt/DDSKo710 GkMGJuZjMO/GRR/40pbmXYvCkzJccRNIQfWOdf4JnuMKqZy2oO1hmnSe+6F24lMMRhfPYo/rXe2DD iqJy1CjpUvVhb2dZOjMrmTgibDWsLoEoJdYg45aEwP/CaCNQTlSaa8oA9Py071uELYGjwmOVxbira z15yscV+sCVkVR2pfoQTzwKKmSR5r5HgtZxmTqdIoLbN+5JeQspugU14MrKqpbcIlSDgwNlwOCvfs tAGvbjmOw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1eswfx-0005Xu-EE; Mon, 05 Mar 2018 20:25:37 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C92352029F1FB; Mon, 5 Mar 2018 21:25:35 +0100 (CET) Date: Mon, 5 Mar 2018 21:25:35 +0100 From: Peter Zijlstra To: Laura Abbott Cc: Dave Hansen , Alexander Popov , kernel-hardening@lists.openwall.com, Kees Cook , PaX Team , Brad Spengler , Ingo Molnar , Andy Lutomirski , Tycho Andersen , 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@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC v9 2/7] x86/entry: Add STACKLEAK erasing the kernel stack at the end of syscalls Message-ID: <20180305202535.GX25201@hirez.programming.kicks-ass.net> References: <1520107232-14111-1-git-send-email-alex.popov@linux.com> <1520107232-14111-3-git-send-email-alex.popov@linux.com> <94f268b2-31a4-620a-86ed-325d5bb33c57@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <94f268b2-31a4-620a-86ed-325d5bb33c57@redhat.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 05, 2018 at 11:43:19AM -0800, Laura Abbott wrote: > On 03/05/2018 08:41 AM, Dave Hansen wrote: > > On 03/03/2018 12:00 PM, Alexander Popov wrote: > > > Documentation/x86/x86_64/mm.txt | 2 + > > > arch/Kconfig | 27 ++++++++++ > > > arch/x86/Kconfig | 1 + > > > arch/x86/entry/entry_32.S | 88 +++++++++++++++++++++++++++++++ > > > arch/x86/entry/entry_64.S | 108 +++++++++++++++++++++++++++++++++++++++ > > > arch/x86/entry/entry_64_compat.S | 11 ++++ > > > > This is a *lot* of assembly. I wonder if you tried at all to get more > > of this into C or whether you just inherited the assembly from the > > original code? > > > > This came up previously http://www.openwall.com/lists/kernel-hardening/2017/10/23/5 > there were concerns about trusting C to do the right thing as well as > speed. And therefore the answer to this obvious question should've been part of the Changelog :-) Dave is last in a long line of people asking this same question.