Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp234597ybp; Thu, 10 Oct 2019 17:11:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqykRnxHulxXv4hp7i60N79dR+9KuZDqxsgaxSe+xh55Hmp40xHGv2Fqh8ApBnhdqt8PRLKx X-Received: by 2002:a50:fe0f:: with SMTP id f15mr10581047edt.89.1570752666555; Thu, 10 Oct 2019 17:11:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570752666; cv=none; d=google.com; s=arc-20160816; b=WfqUN7QJ8TZ1VXWW99oOS2Jui75HWVtDkoCeWEedEVrI52QVwMI5lMqKWTFeHoZteE mDEd42PgS4andB+6UfP0Flfh7DQq43oNR63OfvL1ft+JjcuZiuLkOi2P18wcGHA6Ujp8 LEEnVf3gti6o/RbdRy1hxK9dZnGBFWYYRaH47+lcZoQZd9KWZLvVd77uP0ZMhkj6hHQT Wn0pJTljmbJXEUI0U1dhqMejgsPwp8tT0R1mB9J0LXM3N5kmTIVwC0THMoFB2gFHBRBg QV7FZYplUAF+VwFCM7e1EtNl7ZwUA79/M41+emlOaCX+njrVTsv2a6Re0YQwq5GVPw2Z ogUw== 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=7dmckIaKuL5uoyVhYLyxQgvD7laB8s0ddXfS7YNycCU=; b=dlQFyrHN+09VDgYgWngQnFydkjL6dJZp7YhMrNK+AW4c0tjj9kywflMoeW3X+G7Y69 fx/eK4HiR5fW5MP7YyVmzK/Qaxhf39BJnSvyAv9g52mkSvpspKXYrla26YeoDS7wkHSR tk5FHU5SD1sjvid/5i6bEN8PwGApxqX28JZEhNTNUFXH+TabXkOSQSeDYSLPDQxEpq8R Km2eaE/xGRCqxY+19eBA8i/onFwMBHr+N8R3vp3nJHZJktcRNLIWrY5ITukzN4RCRVgQ fiXNDA8wiwHvcEtKLvpSnGlbBWPJnmtNKZe+qiRG7AOvPAhpcUlIboHnVaVNw4VdqIDu dgBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Zkm/RKe8"; 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 si9si4219228ejb.97.2019.10.10.17.10.43; Thu, 10 Oct 2019 17:11:06 -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="Zkm/RKe8"; 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 S1727796AbfJKAHc (ORCPT + 99 others); Thu, 10 Oct 2019 20:07:32 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:35014 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727499AbfJKAGY (ORCPT ); Thu, 10 Oct 2019 20:06:24 -0400 Received: by mail-pg1-f193.google.com with SMTP id p30so4699620pgl.2 for ; Thu, 10 Oct 2019 17:06:22 -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=7dmckIaKuL5uoyVhYLyxQgvD7laB8s0ddXfS7YNycCU=; b=Zkm/RKe8e+Liv+qZ7ZPm9kwWeSr+NIaspEW7t3lmnI5dNpUpSo6dTzux6vNvY1O0iZ mXmbpcaYzINbphQms11pCzDFWcPo5ulCRYCfFRW5DOq8KNnHUZoPg9cYONZAaxdOzKmE WYECp/MY1nFT0o4uteh9HzWwnmK7DhrJcJDFU= 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=7dmckIaKuL5uoyVhYLyxQgvD7laB8s0ddXfS7YNycCU=; b=LxKjz/2e9a1JAt28AZQd8fWKVy+Ue54bP6NlV0V7niRUOO5GJ1uN0yiE0adtT8HBqA 0W+qWNje2R8nek6rLihrdPnJGbsSAOVqMDXSXAaQFcaWmV/fq7xPpyR4ODO8PiXuvZO2 XrtT/p9m4AovrhwJYUxl0+GIPCjly7Zx6HtayppmlaRnWA8j4OL2ad8dhKXJjHeTFqRz DTssR+izEVCmNKvkjifHSSt6vWKNYY6t1scD9QgOWKW99oVdf8tIV+aWJcv1WKIGq0o5 e0SucwWI0wmxR44v8oGeEBkbJKlYhl2YbL+CkUc3ISJmV37meOoH6IvdM/p2CjNyUUdk ntTg== X-Gm-Message-State: APjAAAWC8gm5o4ddYe6pPcpQS+5EqUspZngw6+qM2i+Y5fpjXmP6fR+D M7nRYasqBNQFn+stHcZNwm5CQg== X-Received: by 2002:a63:554b:: with SMTP id f11mr13613094pgm.151.1570752381593; Thu, 10 Oct 2019 17:06:21 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id o42sm12777771pjo.32.2019.10.10.17.06.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 17:06:20 -0700 (PDT) From: Kees Cook To: Borislav Petkov Cc: Kees Cook , Rick Edgecombe , Dave Hansen , Andy Lutomirski , Arnd Bergmann , Michael Ellerman , Heiko Carstens , Will Deacon , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.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 v2 02/29] powerpc: Remove PT_NOTE workaround Date: Thu, 10 Oct 2019 17:05:42 -0700 Message-Id: <20191011000609.29728-3-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191011000609.29728-1-keescook@chromium.org> References: <20191011000609.29728-1-keescook@chromium.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation for moving NOTES into RO_DATA, remove the PT_NOTE workaround since the kernel requires at least gcc 4.6 now. 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