Received: by 10.223.176.46 with SMTP id f43csp2432004wra; Thu, 25 Jan 2018 09:44:53 -0800 (PST) X-Google-Smtp-Source: AH8x224weFw30XrdO9+FvK8bLrOWkstG29uLOKqlhTDHbvSnXGjCJmU61OhxBWWg/xUqi/RMuFAb X-Received: by 10.98.198.2 with SMTP id m2mr16739245pfg.113.1516902293130; Thu, 25 Jan 2018 09:44:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516902293; cv=none; d=google.com; s=arc-20160816; b=iRWeWM/dJ2rVKgfDGuWxU1WPilxXgwWkpwQF0D9fy1EatXVEFoNGeGf6VwrJJZwyOj UU4C5/wzXlu452kP+7+VTKeVopbs2dwD/Z7EvVXZH1EArI49bnksn/FMAAVKcXvoFR/m o39CVBVR+IVFYCmJX+K2iVfYVF718P7g9t/i8oeamqeqbImOQVwXLWkeB4UMIDmKmcsK Po897VrY51LMx6wF92qKX8esnikR+ZzcP3WQjWOc1r49lLIfxFEWakiZRs2KzgiqYwIr 2DdFr1Rs+8GgVKV+a6eBBRjJlbLoh1Hjb+34+qHm1wKySPsuHw0/lt8NA6wURJYhclfE xdRw== 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:arc-authentication-results; bh=8dbzazfogZirHKh2r+QrvRVFuuoYZVmbEpYqutb8wq4=; b=uzZnX90H4wohiBTE5jQ5jV3H4dL+ZD9jMx3df5mwgv16djKTPVa/4Ah3AfTrWaCR// btE1rVMc/LoOHu70LtfouP6aNGZrEcnx77qkPUBzh6vZsVzhoysc7bgEobuMa0tOxBEi I83szOgKSfPySPmyKulD9q5eIyAclm4elNDYBfC0699JxY6Ba4AF/XiIbX11xEadTKUx snVHmIYRTpD0ZmRGqqZJ5HjijfT0i6h7fjjp/mF5AlQEYOFuNCIHslK5wELTg/a4jkdB l8v+C+EioYRtqrtrhARKV58HC9E6DiaiAO1JpBIoorQRIh/FABHoC1LJdXEqfF6EzSpc fpuw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 101-v6si2332830ple.263.2018.01.25.09.44.37; Thu, 25 Jan 2018 09:44:53 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751211AbeAYRoO (ORCPT + 99 others); Thu, 25 Jan 2018 12:44:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49414 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751105AbeAYRoN (ORCPT ); Thu, 25 Jan 2018 12:44:13 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0404F8B10B; Thu, 25 Jan 2018 17:44:13 +0000 (UTC) Received: from treble (ovpn-124-179.rdu2.redhat.com [10.10.124.179]) by smtp.corp.redhat.com (Postfix) with SMTP id 89F9460A9D; Thu, 25 Jan 2018 17:44:06 +0000 (UTC) Date: Thu, 25 Jan 2018 11:44:06 -0600 From: Josh Poimboeuf To: Andy Lutomirski Cc: David Woodhouse , Borislav Petkov , Tim Chen , Paul Turner , Jiri Kosina , Greg Kroah-Hartman , Dave Hansen , Ingo Molnar , Rik van Riel , Linus Torvalds , Andi Kleen , Kees Cook , Peter Zijlstra , Thomas Gleixner , "H. Peter Anvin" , LKML , linux-tip-commits@vger.kernel.org Subject: Re: [tip:x86/pti] x86/retpoline: Fill return stack buffer on vmexit Message-ID: <20180125174406.wxdibcyqv724uuun@treble> References: <20180125120743.ey32gvl5mjam4r2s@pd.tnic> <1516882849.30244.94.camel@infradead.org> <20180125124554.vdx7rrnfrxrzl2ng@pd.tnic> <20180125151024.bidjr26r667vs7h5@treble> <20180125155110.mw655b7fwgm7qqc7@pd.tnic> <1516896198.30244.133.camel@infradead.org> <20180125165646.ytc4upthpaqtwi45@treble> <1516899639.30244.145.camel@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 25 Jan 2018 17:44:13 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 25, 2018 at 09:05:37AM -0800, Andy Lutomirski wrote: > On Thu, Jan 25, 2018 at 9:00 AM, David Woodhouse wrote: > > On Thu, 2018-01-25 at 10:56 -0600, Josh Poimboeuf wrote: > >> On Thu, Jan 25, 2018 at 04:03:18PM +0000, David Woodhouse wrote: > >> > On Thu, 2018-01-25 at 16:51 +0100, Borislav Petkov wrote: > >> > > > >> > > > And the seg fault is objtool's way of telling you you need a > >> > > > ANNOTATE_NOSPEC_ALTERNATIVE above the alternative ;-) > >> > > > >> > > Except that it blew up when I did this which doesn't have ALTERNATIVE > >> > > (it's the diff I saved :-)) > >> > > >> > Yeah, ANNOTATE_NOSPEC_ALTERNATIVE just tells objtool "don't look at the > >> > alternative; you're not going to like it". > >> > > >> > If you start putting a __fill_rsb() function out of line somewhere and > >> > only *calling* it from alternatives, then objtool is going to shit > >> > itself when it sees that function, regardless. > >> > >> Right, if you *really* want it always inline, the short term solution is > >> to just patch it in with X86_FEATURE_ALWAYS. > > > > And the whole problem here is that patching it in with alternatives is > > painful on kernels < 4.1 because back then, we didn't cope with > > oldinstr and altinstr being different lengths. > > > > And they don't want to fix *that* because kABI... > > > > I just stopped caring. > > Screw kABI. There are *many* real world users who depend on kABI, so it's a fact of life with no better known solution for the given constraints. If you have a better idea then I suggest you build your own enterprise distro. > Distros that use retpolines need their driver vendors to recompile no > matter what. Distros that use IBRS and refuse to use retpolines > should get put on a list of "didn't actually adequately mitigate > spectre". Retpolines don't need to break kABI. We can just detect when they're missing and report it to the user. And I don't think there's anybody *refusing* to use retpolines, is there? But they're still not fully baked, especially for Skylake+. IBRS was just easier to implement out of the gate. And it mitigates Spectre just fine, but it's too slow to stick with long term. -- Josh