Received: by 10.223.176.46 with SMTP id f43csp3341119wra; Mon, 22 Jan 2018 12:26:04 -0800 (PST) X-Google-Smtp-Source: AH8x2259ZZ6thKA4bup5fD9Rd4kw4cuyZ/qOR7WFmu706gnLU4vV7JRMgGI0THvDE+jsmUJ6OFqY X-Received: by 10.107.137.26 with SMTP id l26mr191964iod.108.1516652764424; Mon, 22 Jan 2018 12:26:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516652764; cv=none; d=google.com; s=arc-20160816; b=GhNcci7dTQQPRaj4ZVQFidDnNopQT4SLxLe7cxvXvgHnSL4poSs5qN7qd+kkxDxR6i gm2o3MwthGthd+t2RL6AXfmIqKa5AlPAZOC5kqzg64WTBofy2Ux8lyfaSWSL/OXQVtvV 8XBoNc/D1fxjlsVRMt6khj5C+ZiwlDSTypTf5ekxOmzArrr/HPkHVJ8xnm17Hzma3hAx x7i0uXSxK8I+cX9zmFm1I0qeFKDPKbyINgZ8cCc3PCk+VInGvUIEWbbfVhGLKLpuBBHt BGULKGbwLTofQxxDmQtuzgO6UGCWWJr+yMyMBGhKnHto7u/HHnp7ddIL14hWPdu9/Wam OSBg== 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:dkim-signature :arc-authentication-results; bh=9f5zBXaXd3TLhluLMZCR0puRviJ+yAaDe+sL2OmGCI4=; b=dP0zX+PkXVDPp9iz3fhBT9LejXdsywKRkSG35ARTrdb+U360rX27VxoVS/8cGgYnGl GmwKyQczPTE8ExklCizzVzuk1Y2VVJCp+X9KDccUbis1PA+MKcKOV8cueTGnFisoKmAz c/XgrLmnBaq8qpszAOfTdiziki/w2S2h17PS1ovL5zdP8F2/TDofXaz9lkTuZmUzX1Ik rCuhC6kkphjflTOlDeX0lfD4Jba59lWY0KL+ZtiGcMJDxkYi1FNgswTUvQ9ebm0Aw5CG DVzt2nrs39AfbL9/betdUMWjbq9n5Hk11vUBeT4hxzCWgQwsHBeCqKMxjR6EemPep6lo Rrmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=QD0+6Tex; 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 l130si12800810ioe.300.2018.01.22.12.25.51; Mon, 22 Jan 2018 12:26:04 -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=@gmail.com header.s=20161025 header.b=QD0+6Tex; 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 S1751621AbeAVUZ3 (ORCPT + 99 others); Mon, 22 Jan 2018 15:25:29 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:40050 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751214AbeAVUZZ (ORCPT ); Mon, 22 Jan 2018 15:25:25 -0500 Received: by mail-pg0-f67.google.com with SMTP id g16so7956197pgn.7 for ; Mon, 22 Jan 2018 12:25:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=9f5zBXaXd3TLhluLMZCR0puRviJ+yAaDe+sL2OmGCI4=; b=QD0+6TexjzzS34+dfdJr5/HMPRx9QBobmZnGv6zxWZL0OmDSpVTMHbclveeHi42Jol vx1lr18BDDfF2hmxjcGPJNwMKPpuupacrxYenTyT3xl8F+ybXRhz1FJ9DDFFHder/uQ9 uR7+TSf3PHluM6VjMBXZDO/QcEEjRzo5MbWEdDirGcSJ1r9L+6Ml+7+76LZJ3vv/5BqS 0tNjsxX1mlVp6AEg242r5fR3JTlDhfgE8Bml+6ijInBcpEdzOyBKnoAGeE/u6UbAcpbA /UqfdmFLlzqIg4bViM8B7qWIj0it4K6DOcZWlIY0aOKXcSKKMRS+qK7oZks+xAXbIax8 1zVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=9f5zBXaXd3TLhluLMZCR0puRviJ+yAaDe+sL2OmGCI4=; b=kgxDtpJLXcPdecBjXj5yO9e+EbxmCwaTXnsHvJyipmx9H1xi0S7ozeFgsYueKJeqI8 3Vbl5i6HKDj3MyToEFLoANwjxGLlIe5vBoB1RNPWMMQxqR3GIEdr8w3s/PBVDzvGL0Cq bIw0BUQUO9C1Td7Ba0/0UqY4h4pV3kC8oiXLHqd9u6XmzGfdLnBfXg05C/LZyfXIbzSG nv5TH0oq2jPjRsfmBaGM2dbcSHz08Bkm2tyWZEUGWOiDMZ2YV4qCzyZZBR7HaN56FCLF TRdOET/tBFPa4czcdoVvvZydfUMJnvw7r7so9Di8J/OXF/ro0CRoS37bHBk3wLagImuv OZRw== X-Gm-Message-State: AKwxytfQ2pK2jFLrT192ByBKgdRruU46WHSBa8WTImdUFsuPwo6WoOB1 Z/DTe2wvzA+h14PqL/Es5dw= X-Received: by 2002:a17:902:2c43:: with SMTP id m61-v6mr4214554plb.189.1516652725130; Mon, 22 Jan 2018 12:25:25 -0800 (PST) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id g1sm6424325pge.83.2018.01.22.12.25.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jan 2018 12:25:24 -0800 (PST) Date: Mon, 22 Jan 2018 12:25:22 -0800 From: Guenter Roeck To: David Woodhouse Cc: Josh Poimboeuf , 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: <20180122202522.GA29081@roeck-us.net> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1516649644.9521.61.camel@infradead.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks, Guenter