Received: by 10.223.176.5 with SMTP id f5csp2156059wra; Sun, 28 Jan 2018 13:44:59 -0800 (PST) X-Google-Smtp-Source: AH8x225dgb00SvIT5EHA/c0eSKcu8cdYVbTFloP4+J+ZS07xo8XbUkpH63Pibxt6aN9iBSNJGb+4 X-Received: by 2002:a17:902:b2c1:: with SMTP id x1-v6mr19925158plw.85.1517175899113; Sun, 28 Jan 2018 13:44:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517175899; cv=none; d=google.com; s=arc-20160816; b=hKnjrCoLtAmGvfy+SZdMRR+7bKcoQXGvGFjkyuUgtAIDz9MJzzuCXe1ug988Jbgv/Z Rm3fsEMoa71zJEG/X5ZhYRI6/4nSFp6YRfBzC+Q4FCijnAarrtNAkfwToxTySg6nsBIS qWXLr2p20NQjRLRRuzkzXjp6cvoQtk7yqGsJLQ4OqZoitVI/8jFckZzN68VVXDCgGtxQ JAsDak7Vr6k1W8/9ub7/K6CjoxpktB44nJzPmN+jyLfQOAG5Ei+xl4LuLe4fl67hGvRm zhUVD9dh4LSxQ+ILN/dNorcp/MEvNKjJATKw85dAmDg/x+No4K+NasNlvMWq8OIhP6xh 8PJw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=7a+bdDSm7FjeqIxz6toA6DG1FojeN+qFdpkLEZbPcG8=; b=p+mj41HPsx/5W3/hgLZpE9tpA5KqyGTFu13C2FsGnga/dV8RgJdZz+8W1lK0POM9tx /vnvgHDFtHnv2jCQbynxWERUiXMHc1qRLPJlFPVS6o1HHatC8N/qa1D4EVJkIMS2wqtf nLi3PRKyLu1IIqJr6QUSRv7DPGR3bMZQGMfHPsv9H55JaaSXUjzSTSWqEezw3PfdJiwT LeXLh+SSfNSu32XH0AtmJX7PPmsg04eaQGHrjwfF9rn/HCtehY23qvnIxRVFeiqIkB0w LdjWs46GQFmZMfEYgwrHOoFIEfYtHHs8/DvnT/fd51A7La5ofQcsuKhBVlRWwCWuU5ai 8hTA== 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 f192si5238252pfc.68.2018.01.28.13.44.31; Sun, 28 Jan 2018 13:44:59 -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 S1752577AbeA1VGu (ORCPT + 99 others); Sun, 28 Jan 2018 16:06:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43352 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751837AbeA1VGs (ORCPT ); Sun, 28 Jan 2018 16:06:48 -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 0B3FDC047B8E; Sun, 28 Jan 2018 21:06:48 +0000 (UTC) Received: from treble (ovpn-120-158.rdu2.redhat.com [10.10.120.158]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0DDB608EF; Sun, 28 Jan 2018 21:06:42 +0000 (UTC) Date: Sun, 28 Jan 2018 15:06:42 -0600 From: Josh Poimboeuf To: Guenter Roeck Cc: David Woodhouse , Andi Kleen , Paul Turner , LKML , Linus Torvalds , Greg Kroah-Hartman , Tim Chen , Dave Hansen , tglx@linutronix.de, Kees Cook , Rik van Riel , Peter Zijlstra , Andy Lutomirski , Jiri Kosina , gnomes@lxorguk.ukuu.org.uk, x86@kernel.org, thomas.lendacky@amd.com Subject: Re: [v8,02/12] objtool: Allow alternatives to be ignored Message-ID: <20180128210642.xob2win53h2gztak@treble> References: <1515707194-20531-3-git-send-email-dwmw@amazon.co.uk> <20180118190931.GA27143@roeck-us.net> <20180118193315.zrrya7qo6kf7pmzp@treble> <20180118194112.GA28449@roeck-us.net> <1516649644.9521.61.camel@infradead.org> <20180122202522.GA29081@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180122202522.GA29081@roeck-us.net> 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.31]); Sun, 28 Jan 2018 21:06:48 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 22, 2018 at 12:25:22PM -0800, Guenter Roeck wrote: > Hi David, > > On Mon, Jan 22, 2018 at 07:34:04PM +0000, David Woodhouse wrote: > > On Thu, 2018-01-18 at 11:41 -0800, Guenter Roeck wrote: > > > > > > > Not sure, does your gcc have retpolines?  Give me your .o file and I can > > > > diagnose it. > > > >  > > > Yes, it does, only it is the gcc from the Google toolchain which may > > > generate different code than the upstream version. > > > > > > I attached an affected object file. Please let me know if there is anything else > > > I can do to help. > > Disassembly of section .text.__x86.indirect_thunk: > > > > 0000000000000000 <__x86.indirect_thunk>: > >    0: e8 04 00 00 00        callq  9 <__x86.indirect_thunk+0x9> > >    5: f3 90                 pause   > >    7: eb fc                 jmp    5 <__x86.indirect_thunk+0x5> > >    9: 48 8d 64 24 08        lea    0x8(%rsp),%rsp > >    e: c3                    retq    > > > > That has the old-style CET-incompatible retpoline in a COMDAT section > > in the .o file. What compiler options are being used for that? The > > kernel should only use retpoline if GCC supports both of > > -mindirect-branch=thunk-extern and -mindirect-branch-register, and this > > compiler is doing *neither* of those.  > > It uses "-mindirect-branch=thunk -mindirect-branch-loop=pause > -fno-jump-tables", though I don't know if that even exists in > upstream gcc (it is the gcc use for Chrome OS builds). I'll pass > your feedback to our compiler team. > > Either case, I think it is less than optimal that objtool crashes > with _any_ object code. I've got a pending fix for this, so that objtool doesn't seg fault, and instead prints out a warning: quirks.o: warning: objtool: efi_delete_dummy_variable()+0x99: unsupported intra-function call quirks.o: warning: objtool: If this is a retpoline, please patch it in with alternatives and annotate it with ANNOTATE_NOSPEC_ALTERNATIVE. The code is here, along with a few more fixes: https://git.kernel.org/pub/scm/linux/kernel/git/jpoimboe/linux.git/log/?h=TODO-objtool-seg-fault Will post it soon. -- Josh