From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x2241DJ4UVutMbYh2V1WRbVgprlQugdc9TMCKISqj4Ctramk3Aq5Q50VGpPRLtnoOVBYJiXsB ARC-Seal: i=1; a=rsa-sha256; t=1516616399; cv=none; d=google.com; s=arc-20160816; b=Lij+TYfnL1ZDrlAt4rIBZOhHj45VWl43e+ou8kvsFjQV7hQDGwGqeMdNQ5qAVXOEA/ hnoEQ6P37vRuSeRIqX07hWKD6K/oyYlaJlnUMRL7h6pgZTRfG2ZbKI6pzbTAEP9GAvBV hebcNYKsa7o6jhqkxSWE5V7VNAWJeHg7DFLwKIQvV/hrd/Bl/NQY/hsa97wexRGOj5EN fcbAK+QCNlcjoFoFtYsHQqAOetWJAMhJBS+x25udWzYJ+erNJBfzNqYNCo/xKPKDLpof kF+5qfcwzEhxL3/TV/zNxS9FtdKewMJ/thqGCKHVqWa596xYAxrWxzRf8ezrCK5VlDCy rCMA== 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=dXQqWMFNMYFDlabr5bWYDxwa8MMF+K7F95asCfYXAbQ=; b=oyZoulcnn70vYzwWzypWOqJfiHWUHRFhnze/GJcZKPkKkbIQt8gZ58TuQhTgBVCPXa q41jKcl6vvulYEL+aFgi9ld5BxBc/d62QFQ36Xoi+sku7edJZAFnahw19UQlrl9Ibpxu jqy4L+aP98eYgtnB4GQBwB5tjqq9uLrHmhEtadY46T2QaaJQ8wU410HTBzBbsKSNUsRF PiFzDd4cUSMlA3ZoDH7hoIficSnN84YeMB09DtW6WI335qduP8eeubkfP+7D7Qecu0Fx Y4yYqpQEJWNTvUqbO7ghJsIWfIVKBoYKdu0WqtOoiOjLOXumcEv1GpBM7Voerc/H6N9G tX3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=VkXGjD+w; spf=pass (google.com: best guess record for domain of peterz@infradead.org designates 65.50.211.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=VkXGjD+w; spf=pass (google.com: best guess record for domain of peterz@infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=peterz@infradead.org 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) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1590140567714479425?= X-GMAIL-MSGID: =?utf-8?q?1590287557334494720?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 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).