Received: by 10.223.176.46 with SMTP id f43csp2725743wra; Mon, 22 Jan 2018 02:20:48 -0800 (PST) X-Google-Smtp-Source: AH8x225t/WRcjZhz394eAaxrmwE202obvQEDc1hDS3E4uZ/2J9l/FdDNH3mnzxwqw6avjzfes3al X-Received: by 10.98.103.83 with SMTP id b80mr7953671pfc.223.1516616448038; Mon, 22 Jan 2018 02:20:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516616448; cv=none; d=google.com; s=arc-20160816; b=QnUZcxHKTyft/UCHxt0AISx9+vHha+Xt5N6x4Pt8FK/pKA+kqRkXe88EVo6vUFsiBb 4gs7w8wJu/KBn6ae/68Fw1uE6XysevX7g8Xcw95dN2diItOwYT/hE5X50G+2G0eG0cjG SXGu0tJSHZC+rPEl7B+Bw5dJT+camvpRCuUqbWkPALhY0XzKCgd9M70O/5aiLTJqO+Ch W+aiLuTpJ9v4/00y/4PFutWPFz4nAgUb6bIfuLf+qL/hlYU1fuDzOZ0v/OZTO9v30hJU XsCgjVYydXdjaYpcr1+jvBBoKeRxvsTyunlJt11ktn3mzJ7IeGRkM9wK+0SUA5io6sa/ 3q9w== 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=dXQqWMFNMYFDlabr5bWYDxwa8MMF+K7F95asCfYXAbQ=; b=Yky1YMobyUfzlm2Ruo9mHv3VYW+cLyE7ANrP1aOMiYA7R9XH5J2RLAIAfp8IYSOO2h BEwmLHDFWKWTOh0FlwxQkey0l+YVxCjkhTlxi8qAHk1/fpysh/Rr8r2oSW0NPSaVmKxQ Z8yOJxS4l2Cn0yj6zqb55wyCCxpVPOdev5YJo+elnG0eug7K9ED2CWfg+G6nt5Xns0BF OUKhD25WAIeks1YjAPBg9NipXN8sIMrBlfr47x5MDcUNgt6KgMDjpg6dKB5VzEphjkzJ L79j4aDlrweBmDqQVJfYdIf2FfhhhZG9JvkRXTmg/BMMTyGnvoQwrz+WZfWTnI3DuK3B E/Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=VkXGjD+w; 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 n13si5438568pgc.95.2018.01.22.02.20.33; Mon, 22 Jan 2018 02:20:48 -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=VkXGjD+w; 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 S1751204AbeAVKUD (ORCPT + 99 others); Mon, 22 Jan 2018 05:20:03 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:48725 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750945AbeAVKUB (ORCPT ); Mon, 22 Jan 2018 05:20:01 -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=dXQqWMFNMYFDlabr5bWYDxwa8MMF+K7F95asCfYXAbQ=; b=VkXGjD+w6w/u8MmhZR7GJnrO5 KKCkbSTze/iEz0n2lEQ8PTxovmFPxuWAbRoCthDi8KWLucd1rMDzzt0CyI9KyKeh1sNLRWOy4+xf3 GBGH1BSMU4eS6Hzq2Uv4B4bilVEZgGDGw0hi5e5fHvUVWbFgX3HrVIysx724CBFxmRmzDgHGRdpLH aDcYjI33Dvs8+/npkMcoqWMzdi4PaoEY7VxTrws2qHV3zGfQilpZC9Pzh16feITMFsNlLjcrTAkAB EwDUjU1nOreQ/YDif1cu2Zbl0Mxkt8VBDcWTg2X+uhhkX2FR1q0vVEvNU8UmUsr7CutXn5ENREaXr lBPWy8LPA==; 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 1edZCj-0004d5-DC; Mon, 22 Jan 2018 10:19:53 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id AA8A82029F9F9; Mon, 22 Jan 2018 11:19:51 +0100 (CET) Date: Mon, 22 Jan 2018 11:19:51 +0100 From: Peter Zijlstra To: David Woodhouse Cc: hjl.tools@gmail.com, KarimAllah Ahmed , linux-kernel@vger.kernel.org, Andi Kleen , Andrea Arcangeli , Andy Lutomirski , Arjan van de Ven , Ashok Raj , Asit Mallick , Borislav Petkov , Dan Williams , Dave Hansen , David Woodhouse , Greg Kroah-Hartman , "H . Peter Anvin" , Ingo Molnar , Janakarajan Natarajan , Joerg Roedel , Jun Nakajima , Laura Abbott , Linus Torvalds , Masami Hiramatsu , Paolo Bonzini , =?utf-8?B?IlJhZGltIEtyxI1tw6HFmSI=?= , Thomas Gleixner , Tim Chen , Tom Lendacky , kvm@vger.kernel.org, x86@kernel.org Subject: Re: [RFC 04/10] x86/mm: Only flush indirect branches when switching into non dumpable process Message-ID: <20180122101951.GC2228@hirez.programming.kicks-ass.net> References: <1516476182-5153-1-git-send-email-karahmed@amazon.de> <1516476182-5153-5-git-send-email-karahmed@amazon.de> <20180121112224.GH2269@hirez.programming.kicks-ass.net> <477cc452f17665440978ae1e227861ca.squirrel@twosheds.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <477cc452f17665440978ae1e227861ca.squirrel@twosheds.infradead.org> 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 Sun, Jan 21, 2018 at 12:04:03PM -0000, David Woodhouse wrote: > > So if I understand it right, this is only needed if the 'other' > > executable itself is susceptible to spectre. If say someone audited gpg > > for spectre-v1 and build it with retpoline, it would be safe to not > > issue the IBPB, right? > > > Spectre V2 not v1. V1 is separate. > For V2 retpoline is enough... as long as all the libraries have it too. Ah, easy then. So we need this toolchain bit and then simply rebuild works and everything is happy again, well except of course those people running closed sores binaries, but meh.. :-) > > I realize that this is all future work, because so far auditing for v1 > > is a lot of pain (we need better tools), but would it be something that > > makes sense in the longer term? > > It's *only* retpoline so it isn't actually that much. Although I'm wary of > Cc'ing HJ on such thoughts because he seems to never sleep and always > respond promptly with "OK I did that... " :) > > If we did systematically do this in userspace we'd probably want to do > external thunks there too, and a flag in the auxvec to tell it not to > bother (for IBRS_ALL etc.). Right, so if its v2/retpoline only, we really should do this asap and then rebuild world on distros (or arch/gentoo people could read a book or something).