Received: by 10.223.176.46 with SMTP id f43csp2389737wra; Thu, 25 Jan 2018 09:06:54 -0800 (PST) X-Google-Smtp-Source: AH8x2257FnBmq09GaDmwBRDHs4HCRcDJiGdTfSE8L+3z7iWym/nClziF50yKDa5BaaRrSZzeHjeE X-Received: by 10.99.56.85 with SMTP id h21mr13436369pgn.402.1516900014214; Thu, 25 Jan 2018 09:06:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516900014; cv=none; d=google.com; s=arc-20160816; b=lAbjCsgcSXNiaH8gbuORyN8BM5aSGVsPNZLs3Lwuevif1rF9wi/byftWrkOqjqsDvT fTOiJ0VT7qUMgQOMWhG0+G6KW3Rlt0+LICknlXiGelBbMZTa3TZ1JtuGr2l7JOrJsDkQ lVQ+DZpfKQdvhSSVPa9lxcH5AYPl8FEBjTl6fm/h8lMP+RNxK3nTrzH3o4qKatGd5HRf 8jgGyuDJepTO5jvS7yG9PHLx96my/PTJs5NLsWH/Y1XPs1KjgjBdlR7AhYyMNiRPqSQJ LcwEQmMvylkM3H2uFihhg9Mo8jFgVwm9jgwg9NgI1wrZDZdLc90P5KVy9e/aM842YEB8 EcpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dmarc-filter :arc-authentication-results; bh=mrjnRcOGle3M82YwzzhXZrbElwnRKGlw9EhAe2s5+uY=; b=zHHas0Ad3ITIVnM+NzCF34XWL5CGz+L8TOH0EsM80drOgTcr07w+P8iZKxtypk4eou DyoHwhZS8vPEgm+unuZguf46EGeynafxmeKmQ9uHzSUi6IHR3tW7nLv5i023jQpl7DS7 0D4Ev8q02H1TXfxYZuNbTKf/lhNrYEvZoLgKRWrQBphtewOjGMLikoUsZs2TU/ZbqEXb ffQ+fqKmzn4HdOb1dX1JHd7jXbUkYYqvD9fzqgskTc+mcrwTWQkDLShFes0B/KtVH9Zi lfDUv4lFA55OknPFBL7abjnpYL8B5y13Iwc8Y9uX5fwMDRJtblmgWHpnikt99gWc5wfx RL+g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x11-v6si2240631pln.665.2018.01.25.09.06.30; Thu, 25 Jan 2018 09:06:54 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751273AbeAYRGB (ORCPT + 99 others); Thu, 25 Jan 2018 12:06:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:52476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750992AbeAYRF7 (ORCPT ); Thu, 25 Jan 2018 12:05:59 -0500 Received: from mail-it0-f43.google.com (mail-it0-f43.google.com [209.85.214.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A6DC3217A5 for ; Thu, 25 Jan 2018 17:05:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A6DC3217A5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org Received: by mail-it0-f43.google.com with SMTP id q8so10666204itb.2 for ; Thu, 25 Jan 2018 09:05:58 -0800 (PST) X-Gm-Message-State: AKwxytegXkATzuwvwDpq4Pj0h2z+LHG9nFXBh+yuufd+R9Mm54pI4aDw h60eAXujcvUV1vtYFKfsHVralJY2ywsSIw2cIPIXTA== X-Received: by 10.36.108.13 with SMTP id w13mr13342526itb.109.1516899958093; Thu, 25 Jan 2018 09:05:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.137.84 with HTTP; Thu, 25 Jan 2018 09:05:37 -0800 (PST) In-Reply-To: <1516899639.30244.145.camel@infradead.org> References: <1515755487-8524-1-git-send-email-dwmw@amazon.co.uk> <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> From: Andy Lutomirski Date: Thu, 25 Jan 2018 09:05:37 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [tip:x86/pti] x86/retpoline: Fill return stack buffer on vmexit To: David Woodhouse Cc: Josh Poimboeuf , 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 Content-Type: text/plain; charset="UTF-8" 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 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. 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".