Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2114982ybl; Sat, 11 Jan 2020 09:24:15 -0800 (PST) X-Google-Smtp-Source: APXvYqyfFGtgFQsquDb25F7lGgvuyGRlXA/EVQDvO2Q4KMWOdyKIP9THsCzaOj16jwZilBsSQIev X-Received: by 2002:a9d:4902:: with SMTP id e2mr7667258otf.116.1578763455341; Sat, 11 Jan 2020 09:24:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578763455; cv=none; d=google.com; s=arc-20160816; b=b9KPWOkNEL1eSDx+ey69e+Fn38mveHG3rASiDLSaoaGJSZd+lj2GP1CEVwn9fNbiFx 5YEr8NgVUggitKdJ/6IcOGohk88SR9nd69qJ7TFgAnewhdRutu4WS2v0q/SDixCoymiJ cgweblQtKpi5Z1aj9q19KZ0d/pSzMpEtvvg0zDZlBoUpUjWxRqIBST2c6T3eSLsIZ+dC KdlDmI2vjCOovIUuKipYklRmkogxZdw8ucBf1rJDcGOhc4H+32fhLMKO5wa3GbR+SbEB 6+aipfgSo9bgbsxgI4AjCOfMTRxLeK4sQ4gYr6F/uh/81Im4qe1eQ5MeR2Llop9PuV97 pLmw== 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:date:from:dkim-signature; bh=TAr5OK9nYYr6KPzytVTTj/GP8wLPVsT/jCkjRteOAkU=; b=tyFDQEHCNFSJ/BRkn8JE0jBxU65N77fFgnx7QvxwWnGQGFuhiY5uHZNgJxW1B3IUZy zhnxSNqSiRcrobg1Hi4bLsiyXoX8OHxKCz+Bel81TkZrdOxrMEdPlSZbU6XOaesMFzDL 3H1/onT/90giUYjMSVRapHGh1qwYQ3RFm9NiHFAY8U12n/iKOB7W/sP+QkMYsQcYa6jM HuMtW+Y6+I1kS87w6vmpmeoN3HeufG7L+3PgoB7a3kWDEKtQUinm4971kjDnbQr2kM69 lHAG1Mb/kenE0SCk38SyTc5vTv672lntMZ7MkWVWbsikIvtXV8ju7U/l2or+O1nJr4Hn hwdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=O8W2kT8S; 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 l5si3331635oil.96.2020.01.11.09.24.03; Sat, 11 Jan 2020 09:24:15 -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=O8W2kT8S; 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 S1730584AbgAKRUv (ORCPT + 99 others); Sat, 11 Jan 2020 12:20:51 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:47029 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730519AbgAKRUv (ORCPT ); Sat, 11 Jan 2020 12:20:51 -0500 Received: by mail-qt1-f196.google.com with SMTP id g1so5082300qtr.13 for ; Sat, 11 Jan 2020 09:20:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=TAr5OK9nYYr6KPzytVTTj/GP8wLPVsT/jCkjRteOAkU=; b=O8W2kT8SOx19v+19A/C+AcDBh/FhX6z5VriorQFDMEZcnoi5Tet7IdI2bw5BMOR9EF ZCoV5kyUP4L9W9OAYEsfW7b6OnTHCQ1nDRYbX22msxD6cljwazHyAPNgwu4NUYAm7KG/ 6nheoLEb+QockYF74HAQjxFezhfLkiRFaPYW99vnD+b22ODx5F3xqlYiKhX7RMHFLY2t BqaTKn1cL3gsH+g9mEwtZtTXrnBHoL8eqpv0yZ5dAenQqXlNYdWKO8uPUgM06bkIee62 q/V5tKltz+gAQFSMqLSGF29JMYv1ei/Ww2SQGGPZx0SBQu8/Vhm1Rp4yTRRpxW5aGQIh xq+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=TAr5OK9nYYr6KPzytVTTj/GP8wLPVsT/jCkjRteOAkU=; b=tsw7fvBON+1dlWYTHVO7Icba4bNNGbntB3BqjKunBHglgrjymYIpdoQA3fpHNWWnU3 CfIymy5CWBxK1rQk/DzNPY4+07dCuCuf5JqSFqKtv6a8c64Sh1y80QJBY5PFse0L1hOY LxWnZrNgXxQDe2jWG1gvoL5ggSIZFWaQayqAiZxM6ilK8fKCDz8u0rrz1xHOGGBLp0OA GSUchG0nJTXo3rJ51Ktul67+g9Tc4XMobDd0gJHSeJ3pM8rjmypqGfsU54HJBJWkkdvy SYopSS7F1B0tTpSEE8dzpVEB3nXdewdZf1NaW2R70QroELgRmPvY9WP9+b+pmoUc2J3t tNhw== X-Gm-Message-State: APjAAAUjK4WLZ6rE6ZJRC1+7um1YagwWrXDLLmDqgRXLS8eODqevUN6p esJBXecbz8yBI8FjTf2kbe8= X-Received: by 2002:ac8:2bcd:: with SMTP id n13mr3779069qtn.21.1578763250270; Sat, 11 Jan 2020 09:20:50 -0800 (PST) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id 65sm2866876qtf.95.2020.01.11.09.20.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jan 2020 09:20:49 -0800 (PST) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Sat, 11 Jan 2020 12:20:48 -0500 To: Borislav Petkov Cc: Arvind Sankar , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, Kees Cook , Thomas Lendacky Subject: Re: [PATCH] x86/tools/relocs: Add _etext and __end_of_kernel_reserve to S_REL Message-ID: <20200111172047.GA2688392@rani.riverdale.lan> References: <20200110202349.1881840-1-nivedita@alum.mit.edu> <20200110203828.GK19453@zn.tnic> <20200110205028.GA2012059@rani.riverdale.lan> <20200111130243.GA23583@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200111130243.GA23583@zn.tnic> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 11, 2020 at 02:02:43PM +0100, Borislav Petkov wrote: > On Fri, Jan 10, 2020 at 03:50:29PM -0500, Arvind Sankar wrote: > > On Fri, Jan 10, 2020 at 09:38:28PM +0100, Borislav Petkov wrote: > > > On Fri, Jan 10, 2020 at 03:23:49PM -0500, Arvind Sankar wrote: > > > > Pre-2.23 binutils makes symbols defined outside sections absolute, so > > > > these two symbols break the build on old linkers. > > > > > > -ENOTENOUGHINFO > > > > > > Which old linkers, how exactly do they break the build, etc etc? > > > > > > Please give exact reproduction steps. > > > > > > Thx. > > > > > > > binutils-2.21 and -2.22. An x86-64 defconfig will fail with > > Invalid absolute R_X86_64_32S relocation: _etext > > and after fixing that one, with > > Invalid absolute R_X86_64_32S relocation: __end_of_kernel_reserve > > I'm still not clear as to why this happens. I tried reproducing on > openSUSE 12.1 which has > > Repository: openSUSE-12.1-Oss > Name: binutils > Version: 2.21.1-12.1.4 > > and the build there fails with: > > objdump: arch/x86/lib/clear_page_64.o: File format not recognized > objdump: arch/x86/lib/cmdline.o: File format not recognized > objdump: arch/x86/lib/cmpxchg16b_emu.o: File format not recognized > objdump: arch/x86/lib/copy_page_64.o: File format not recognized > objdump: arch/x86/lib/copy_user_64.o: File format not recognized > objdump: arch/x86/lib/cpu.o: File format not recognized > ... > > and objdump is part of binutils. > > Now, this looks like another symptom of what you're reporting but what > we're missing is the rootcause about *why* this happens. > > Because if the issue is hard to fix or similar, then we probably should > raise the minimum supported binutils version from 2.21 to something > newer and not do this fix. > > But before we do that, we need a proper analysis as to why it happens. > > Also, what distro are you using to reproduce it on? > > Thx. > I'm not sure if that's the same issue. The root cause for the one I reported is described in more detail in [1], and the change that makes these symbols no longer absolute is commit d2667025dd30 in binutils-gdb (sourceware.org seems to be taking too long to respond from here so I don't have the web link). I'm running gentoo, but building the kernel using binutils-2.21.1 compiled from the GNU source tarball, and gcc-4.6.4 again compiled from source. (It's not something I normally need but I was investigating something else to see what exactly happens with older toolchains.) I used the below to compile the kernel (I added in readelf/objdump/objcopy just now, and it does build until the relocs error). The config is x86-64 defconfig with CONFIG_RETPOLINE overridden to n (since gcc 4.6.4 doesn't support retpoline). make O=~/kernel64 -j LD=~/old/bin/ld AS=~/old/bin/as READELF=~/old/bin/readelf \ OBJDUMP=~/old/bin/objdump OBJCOPY=~/old/bin/objcopy GCC=~/old/bin/gcc [1] https://lore.kernel.org/lkml/20200110215005.2164353-1-nivedita@alum.mit.edu/