From patchwork Thu Jul 28 14:15:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 72951 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp876706qga; Thu, 28 Jul 2016 07:17:00 -0700 (PDT) X-Received: by 10.66.138.108 with SMTP id qp12mr59319435pab.65.1469715420255; Thu, 28 Jul 2016 07:17:00 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id g63si12677496pfg.227.2016.07.28.07.17.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jul 2016 07:17:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for 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; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for 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; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bSm6H-0004kv-9Q; Thu, 28 Jul 2016 14:15:49 +0000 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bSm6C-0004fA-Sv for linux-arm-kernel@lists.infradead.org; Thu, 28 Jul 2016 14:15:47 +0000 Received: by mail-wm0-x229.google.com with SMTP id f65so254134560wmi.0 for ; Thu, 28 Jul 2016 07:15:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=lue6MUKL90m7r2o9C9uHo09zy7ggjYg5i2qHn2IPHhc=; b=F3+HyLVq/IGVz5Hs2Mg0+E2plIbsbQD4nwCSP7402vZj7ErkdZqbrxGaxzankQVSuC AVrGWRUuGhHEGVpQU+K44FVrnE2wjEaAiBGJI7xD0sVjy6ujGJ6hAKfo/sc0cml04RWU aqosKuvUhPO/1Ucu0MXFlikLJgOF+s42DRBcs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=lue6MUKL90m7r2o9C9uHo09zy7ggjYg5i2qHn2IPHhc=; b=gr9L4CbK9D6X4NYOvXaGGPt9W50Q3E0HCOEBDADFXIRSo2tqJyr+hjhShmWbw/M5Xf 4JQWXqjcD5uceTSIpzuF3F48piSPvm4U/f22mDyIpeEz5GFIby4QNkZ/ASk30qS4G0na /4Vw3wxJPgqf7FWQE6F9RxJtlw3QbQF3rocHkd3H7fWdiz85/iaxBrLn6Bs3T+QH6r2V V0bHFBrrs/U6cXjo36AziJJADe21H3CC17hVlGQBNJK/z3cGz+KAvv57WwZmostTZnd1 KdrDahTlLfl2B4rH6rq4rbTZzBHCkQ/5/LDYxOYQi7lZB0Nc3n1iexos5aWPxaxGxf+6 Q0yQ== X-Gm-Message-State: AEkoous57qv9k0G5ojzuBHDQ6DP0WjL6l87WpgeH6jFzQYK8mCuvhaojVfh67OwNvynJ9vUv X-Received: by 10.194.29.2 with SMTP id f2mr32958645wjh.161.1469715322805; Thu, 28 Jul 2016 07:15:22 -0700 (PDT) Received: from localhost.localdomain (53.red-83-57-47.dynamicip.rima-tde.net. [83.57.47.53]) by smtp.gmail.com with ESMTPSA id d80sm43751438wmd.14.2016.07.28.07.15.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Jul 2016 07:15:22 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com Subject: [PATCH] arm64: vmlinux.lds: make __rela_offset and __dynsym_offset ABSOLUTE Date: Thu, 28 Jul 2016 16:15:14 +0200 Message-Id: <1469715314-23260-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160728_071545_260637_0290C5F3 X-CRM114-Status: GOOD ( 11.13 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -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_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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: will.deacon@arm.com, Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Due to the untyped KIMAGE_VADDR constant, the linker may not notice that the __rela_offset and __dynsym_offset expressions are absolute values (i.e., are not subject to relocation). This does not matter for KASLR, but it does confuse kallsyms in relative mode, since it uses the lowest non-absolute symbol address as the anchor point, and expects all other symbol addresses to be within 4 GB of it. Fix this by qualifying these expressions as ABSOLUTE() explicitly. Fixes: 0cd3defe0af4 ("arm64: kernel: perform relocation processing from ID map") Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/vmlinux.lds.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index 89d6e177ecbd..d49492179967 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -184,9 +184,9 @@ SECTIONS *(.hash) } - __rela_offset = ADDR(.rela) - KIMAGE_VADDR; + __rela_offset = ABSOLUTE(ADDR(.rela) - KIMAGE_VADDR); __rela_size = SIZEOF(.rela); - __dynsym_offset = ADDR(.dynsym) - KIMAGE_VADDR; + __dynsym_offset = ABSOLUTE(ADDR(.dynsym) - KIMAGE_VADDR); . = ALIGN(SEGMENT_ALIGN); __init_end = .;