From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6254ACA9EAE for ; Tue, 29 Oct 2019 21:27:49 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 067542087F for ; Tue, 29 Oct 2019 21:27:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Mf8D0sae" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 067542087F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 472l6p6P6nzF3Bj for ; Wed, 30 Oct 2019 08:27:46 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::541; helo=mail-pg1-x541.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Mf8D0sae"; dkim-atps=neutral Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 472kq25F7yzF34X for ; Wed, 30 Oct 2019 08:14:06 +1100 (AEDT) Received: by mail-pg1-x541.google.com with SMTP id l3so10493183pgr.8 for ; Tue, 29 Oct 2019 14:14:06 -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=IUB0MN6IjH7KcACf0jON8xeDsmoKIFP2Ldh5d1L6UPI=; b=Mf8D0saeSN+0m1YpxFdkmvjwDLF69xca5s60V1U26r/aG9tDbY+KmdSEZ+ycIlGrdm fJay3bujo2c2izvt9E/Xr7795kKH5LjAp715+5k8tVYty/z0ImtxaP1C8iM07/GXFMce avtalpOy9rw451gCCfHNsjmH0eMt4o1fE+6Ws= 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=IUB0MN6IjH7KcACf0jON8xeDsmoKIFP2Ldh5d1L6UPI=; b=gK+ts6Z+3I7vsZ/ffdMS0MG/+Djg0KZGfLm962EGe4ROc4MwDsNHMWxT0W+TYcYXv7 OC589QeokE5vE88Mv+SrfRjRg+fNT55nV3Ah5K0lGJYyAsGpEwNAj6V8CpzV64yfnZBR T925eYunTlGjv7kX0Ta844bwR0xv5T7RrBS6m40gFw/tlkNsCAwWmTFbvb6OmTYXQIvH jWHvGDwKT/odemTrLv30ClHv3UgjVrefOIwAG622rFlpu9prOY0DYZ+UCxhaALf1DGB/ QMXX4DUA8bq9k8G3w+pnQXrhIAtqQoE1dZ3ZmCElXEe2TLlMC2QkuVbUZY/xjCgphXY0 9sxQ== X-Gm-Message-State: APjAAAU2kCJGHG9qmKOos2T1P12PnwgbqypKkWaVOz8X1O5QgUtPTe96 Y4LREmJVZFaMUNPLZXkzH/q7NQ== X-Google-Smtp-Source: APXvYqyam6Nj/3qGHt41KW7lrAi/B4rZMlVCWM/rpmjyHxsuoq9yc40ldr6w0Vf1EPp7DW/iR8X5qQ== X-Received: by 2002:aa7:9157:: with SMTP id 23mr3843926pfi.73.1572383644781; Tue, 29 Oct 2019 14:14:04 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id c26sm25490pfo.173.2019.10.29.14.13.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 14:14:00 -0700 (PDT) From: Kees Cook To: Borislav Petkov Subject: [PATCH v3 02/29] powerpc: Remove PT_NOTE workaround Date: Tue, 29 Oct 2019 14:13:24 -0700 Message-Id: <20191029211351.13243-3-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191029211351.13243-1-keescook@chromium.org> References: <20191029211351.13243-1-keescook@chromium.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Michal Simek , linux-ia64@vger.kernel.org, Kees Cook , Arnd Bergmann , Dave Hansen , linuxppc-dev@lists.ozlabs.org, Heiko Carstens , Yoshinori Sato , Andy Lutomirski , linux-alpha@vger.kernel.org, Rick Edgecombe , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 Acked-by: Michael Ellerman --- 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