Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp2383724ybn; Thu, 26 Sep 2019 11:03:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwqpC0s39IimL4eq5w6BMXygxt0oV9hPr8RxFgCprmqVbC4MnXH0RoBcVTTtCD9Ll+PkZYu X-Received: by 2002:a50:9e26:: with SMTP id z35mr9444ede.265.1569521030575; Thu, 26 Sep 2019 11:03:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569521029; cv=none; d=google.com; s=arc-20160816; b=JWLTvE1J2sic/06PK2bDcap5l2e1zrD2gf4/oT5MUf2ixroQydjPI799/NVW2oHHXV gbojlYVqBtlmPnnv6JIh0gHfVlQ76LYdIIcJIA90fKKmcSqZ/E0FvAg72gRrz28wFoaO 2l3eBhbzNDn22xDR43VkDqo4VKAUfZmE2qrrQnYZp7cjGuYrudUIBnxSMJ//BZh8qs5c /Rhjjugvrnq92/wHdWkk8erxTSypgTJtBd+sbD1cMURQMiRodx7WR7Meaj9vcFX1e1Cw 8sAbrZM0dFawk3PfDcu1VN21PpIt2PG1mHiE9+KRRVW3TqX3uF7fYK8frTReGOANN0RO piEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=RJAKRXgj/kaRPgvukPvg+1dwSCdKJa1mCaEQYaeOHdg=; b=Wpml6fzQ1/7OH3uTRMc588I6qXSG4NUE84I6jV/4i1swMAuRrqrLNyvUWl2+esYJdQ v9OiIxKzMPs8V4QHYNZZXQdl0ZK4cqdZkXSsfhQaQJzMucxwu3IQWyUs1zo7n0EIPIka +JYEVKECPvVOtjBBdSyMC5/ptInPzmn9o3WQ1NvfB9isW8ZYOi2xE446LQdYvsOjKccD acLQgRd4xbfugCeoSzUiKJTySDUgDL2x+btNTYLeQrDhVj8JE6cCZRCDgk33wsbPE937 5vnnYJpWdorCzi00ZHAkWCd1EGOXpRYRFnEYH/smBn4xOiexvELkEyhyQQVIglbLkKyz B47w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=cgLBIK2I; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ot6si1396471ejb.62.2019.09.26.11.03.25; Thu, 26 Sep 2019 11:03:49 -0700 (PDT) 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=pass header.i=@chromium.org header.s=google header.b=cgLBIK2I; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728477AbfIZR6G (ORCPT + 99 others); Thu, 26 Sep 2019 13:58:06 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:35236 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727906AbfIZR4U (ORCPT ); Thu, 26 Sep 2019 13:56:20 -0400 Received: by mail-pg1-f194.google.com with SMTP id a24so1977713pgj.2 for ; Thu, 26 Sep 2019 10:56:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RJAKRXgj/kaRPgvukPvg+1dwSCdKJa1mCaEQYaeOHdg=; b=cgLBIK2I68VieSmLoKuVJtCF3SylTocfsX1gD0Zs19cToPMkoDiwNmt929x1jNUOgM aS469WaQkJpluXBWk8krsQRT5IpbWVxb+hJFQczm9Jyie4qjp5mT/a44DKLoq641n34N GcYWI51/QHsLK6gyjooxRPZO/pVEfarMYPph0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RJAKRXgj/kaRPgvukPvg+1dwSCdKJa1mCaEQYaeOHdg=; b=lqsKc+L+iDzUNCjQPYX55npNOGiGjbW/oJMTOQeQ+4IleyM4QbNF4f1kI7N0g46KPc Wf5cUeblhxas3ZC/qN9ktxGCAOe3B1f5ZK2riRKN6wcEnWn9fhauwY+MKx3KHfBPkD/9 OAFd2BX0/kYfQNce5jIRDNwUgNGXVlPSQdbezvOryCJXsLJnny9cotfAUiob2m5fn8mh pHOpUp4YGN4YsGE+NmcoPQOQTxHH0PkFdisVQG3WcXcbhB8zdQ6OQ2TSPm5eJvyF88Hx AvVCNX3Q1KYH4jkpRpfkIXxgkbAxL7xhUfvNJlCgH6jDW4lOqLR1nWH0y03Wq6cG7XTV Ctjw== X-Gm-Message-State: APjAAAWlyX0XoAGxEbazvT3WlIcYCzZK7TkRgbdJO/FK86eSS6lWsrtW uZaB8IYV4aZ1IEQq25Llg9RWsA== X-Received: by 2002:a62:d406:: with SMTP id a6mr5185002pfh.213.1569520577934; Thu, 26 Sep 2019 10:56:17 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id c8sm3054165pfi.117.2019.09.26.10.56.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:56:16 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Cc: Kees Cook , Rick Edgecombe , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Dave Hansen , Andy Lutomirski , Arnd Bergmann , linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, linux-s390@vger.kernel.org, linux-c6x-dev@linux-c6x.org, Yoshinori Sato , Michal Simek , linux-parisc@vger.kernel.org, linux-xtensa@linux-xtensa.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/29] powerpc: Remove PT_NOTE workaround Date: Thu, 26 Sep 2019 10:55:35 -0700 Message-Id: <20190926175602.33098-3-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> References: <20190926175602.33098-1-keescook@chromium.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The kernel requires gcc 4.6 now, so this PT_NOTE workaround can be removed in preparation for moving NOTES into RO_DATA. Signed-off-by: Kees Cook --- arch/powerpc/kernel/vmlinux.lds.S | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index 81e672654789..a3c8492b2b19 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S @@ -20,20 +20,6 @@ ENTRY(_stext) PHDRS { kernel PT_LOAD FLAGS(7); /* RWX */ note PT_NOTE FLAGS(0); - dummy PT_NOTE FLAGS(0); - - /* binutils < 2.18 has a bug that makes it misbehave when taking an - ELF file with all segments at load address 0 as input. This - happens when running "strip" on vmlinux, because of the AT() magic - in this linker script. People using GCC >= 4.2 won't run into - this problem, because the "build-id" support will put some data - into the "notes" segment (at a non-zero load address). - - To work around this, we force some data into both the "dummy" - segment and the kernel segment, so the dummy segment will get a - non-zero load address. It's not enough to always create the - "notes" segment, since if nothing gets assigned to it, its load - address will be zero. */ } #ifdef CONFIG_PPC64 @@ -178,14 +164,8 @@ SECTIONS EXCEPTION_TABLE(0) NOTES :kernel :note - - /* The dummy segment contents for the bug workaround mentioned above - near PHDRS. */ - .dummy : AT(ADDR(.dummy) - LOAD_OFFSET) { - LONG(0) - LONG(0) - LONG(0) - } :kernel :dummy + /* Restore program header away from PT_NOTE. */ + .dummy : { *(.dummy) } :kernel /* * Init sections discarded at runtime -- 2.17.1