From patchwork Tue Oct 27 02:20:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 55579 Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1522662lbq; Mon, 26 Oct 2015 19:22:32 -0700 (PDT) X-Received: by 10.107.169.97 with SMTP id s94mr28321189ioe.189.1445912552271; Mon, 26 Oct 2015 19:22:32 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id v42si7319490iov.186.2015.10.26.19.22.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Oct 2015 19:22:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zqtt4-0006zW-RA; Tue, 27 Oct 2015 02:21:22 +0000 Received: from mail-ig0-x236.google.com ([2607:f8b0:4001:c05::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zqtsv-0006v9-4E for linux-arm-kernel@lists.infradead.org; Tue, 27 Oct 2015 02:21:15 +0000 Received: by igpw7 with SMTP id w7so70069igp.1 for ; Mon, 26 Oct 2015 19:20:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=vTi4Dnv1ih1E3XJDtU1n9tia/hOCkVLmbgPVJgZhrS0=; b=eVvPNFJ5JmAjClC2z72XGHcFUw22viMsV0gx2p0o5D4WBFY717/SwggmnP5l/ooPnY zm7/1Et4cT4pmdEsRJd90I6jzsqOiotWB6SNtRH/GPz8JFsJhiJ8PMMLDlJvub4gdmlP fS350A9wbAUTU/Q9yyYDMCUY0/3AIJMWIT3/h+QlqxD1S0m0Co7YCU0OX9c6fCREjx/Z SfP7H8P8QwAQdHtU4rKRcRubIZ0LL4Eo4SVea6D+lUgrcK4uL5n00tstHWd5LZ7/QpzT /5vtgV9psRVDBDycsMKioaOBxK9Y5B0wkY2POcLn7Y7bSgd5Nx9bVcHosQ36YTNDNA7U WIbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=vTi4Dnv1ih1E3XJDtU1n9tia/hOCkVLmbgPVJgZhrS0=; b=cOyt+6nbY/4RuH4k06ckVYRuiBQHNCg+LDifNClOgXDIU74bZxWIyB1ER3od3xGYZ7 azWW72ckumbB9E1y/mB+yxMo0XAL8lnMIBCRjCvFY/KyLaXm2n0u238erkUWn2KZcJlL Qo2iqF1BFvQahlxttsL/Vf5BqS+NW8PMR9A19X8xioeiyXxD9xdK5TVC5qtipS+kL27+ icYDcNxrp3gFMxz/3/e3njuZwij7KoofrQHFeomIHE6l6q58UUWqNFIMclAzUJv6UasF aVs1XVD6LZJkMhubYZB0Q/fgtbXW2q3xCT1Bs1W4FbTygVkzVHeUXYw79REcA4Tyjk2V 69Vw== X-Gm-Message-State: ALoCoQmm3UkgwLVbuTXAJ8B/KT455y6gtQwiol2wfRTeiCO4k6LeMYY6nmq9gZRGto+tx72HhEdc MIME-Version: 1.0 X-Received: by 10.50.156.103 with SMTP id wd7mr274739igb.75.1445912451371; Mon, 26 Oct 2015 19:20:51 -0700 (PDT) Received: by 10.36.214.215 with HTTP; Mon, 26 Oct 2015 19:20:51 -0700 (PDT) In-Reply-To: <562EAA22.3010905@arm.com> References: <1444330924-17830-1-git-send-email-ard.biesheuvel@linaro.org> <1444330924-17830-4-git-send-email-ard.biesheuvel@linaro.org> <562EA894.8070505@arm.com> <562EAA22.3010905@arm.com> Date: Tue, 27 Oct 2015 11:20:51 +0900 Message-ID: Subject: Re: [PATCH v4 3/3] arm64/efi: isolate EFI stub from the kernel proper From: Ard Biesheuvel To: Jeremy Linton X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151026_192113_407039_116A28CF X-CRM114-Status: GOOD ( 20.24 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:4001:c05:0:0:0:236 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , "linux-efi@vger.kernel.org" , Andrey Ryabinin , Catalin Marinas , Will Deacon , Leif Lindholm , Matt Fleming , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org On 27 October 2015 at 07:33, Jeremy Linton wrote: > On 10/26/2015 05:26 PM, Jeremy Linton wrote: >> >> On 10/08/2015 02:02 PM, Ard Biesheuvel wrote: >>> >>> Since arm64 does not use a builtin decompressor, the EFI stub is built >>> into the kernel proper. So far, this has been working fine, but actually, >>> since the stub is in fact a PE/COFF relocatable binary that is executed >>> at an unknown offset in the 1:1 mapping provided by the UEFI firmware, we >>> should not be seamlessly sharing code with the kernel proper, which is a >>> position dependent executable linked at a high virtual offset. >> >> >> This patch appears to be causing a build break >> >> STUBCPY drivers/firmware/efi/libstub/lib-sort.stub.o >> 0000000000000000 R_AARCH64_ABS64 __efistub___crc_sort >> drivers/firmware/efi/libstub/lib-sort.stub.o: absolute symbol references >> not allowed in the EFI stub >> >> __kcrctab_sort: >> .xword __crc_sort >> .weak __crc_sort >> .text >> >> >> Which is the EXPORT_SYMBOL() in sort.c combined with !CONFIG_MODVERSIONS. > > > Sorry, I that should be CONFIG_MODVERSIONS.. > Hi Jeremy, Thanks for the report. The following patch should fix it -----------------8<---------------- >From 1179099f89db54294f419493d152083fb8e5af3d Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Tue, 27 Oct 2015 11:12:51 +0900 Subject: [PATCH] arm64/efi: fix libstub build under CONFIG_MODVERSIONS Now that we strictly forbid absolute relocations in libstub code, make sure that we don't emit any when CONFIG_MODVERSIONS is enabled, by stripping the kcrctab sections from the object file. This fixes a build problem under CONFIG_MODVERSIONS=y. Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/libstub/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.1.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile index bca9a76cbd33..acc25d7c5da2 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile @@ -51,7 +51,7 @@ lib-$(CONFIG_EFI_ARMSTUB) += arm-stub.o fdt.o string.o \ extra-$(CONFIG_EFI_ARMSTUB) := $(lib-y) lib-$(CONFIG_EFI_ARMSTUB) := $(patsubst %.o,%.stub.o,$(lib-y)) -STUBCOPY_FLAGS-y := -R .debug* -R *ksymtab* +STUBCOPY_FLAGS-y := -R .debug* -R *ksymtab* -R *kcrctab* STUBCOPY_FLAGS-$(CONFIG_ARM64) += --prefix-alloc-sections=.init \ --prefix-symbols=__efistub_ STUBCOPY_RELOC-$(CONFIG_ARM64) := R_AARCH64_ABS