From patchwork Mon Jun 22 20:58:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 11619107 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 03B5592A for ; Mon, 22 Jun 2020 21:00:09 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 C7AF52073E for ; Mon, 22 Jun 2020 21:00:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="htXx7jrv"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="d59awIr4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C7AF52073E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HALMnMG/y/YPvMMJzm67HEJsOZnCMcIcxN3dT4ScCKw=; b=htXx7jrvmwUSfCdYcIMANykBF zG82OxU4PU0KBz0ane8PPc+YszroStxPYgKZql8ySNSCb1gnJ2PuBInu4V6J4qFj+Jq01w5mcgNk1 NsZi72NG6QtrRyz/83gd4mO5/GiglnE+AmrT2EbXTIbZHXi0xDiuCzqsiSraf4TZfA8NWQClIjB9L FV08ZkeXofiL9diu2rST7tThPkQuvSEHY3jTPSSMbFTnlPpTl6ZMoTAFKS5kvvGU/Tqt6u5SpODN0 Tz+g2Vw7o+6hI3TDjnW6qJAw56ZSxqbbpuwF0Uk/X9M7C6UhFIbDAlpgLUSAN0M1YHjf/y399hkA5 1xhHN/GzQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnTWJ-00081K-7G; Mon, 22 Jun 2020 20:58:23 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnTWG-00080a-EF for linux-arm-kernel@lists.infradead.org; Mon, 22 Jun 2020 20:58:21 +0000 Received: by mail-pg1-x543.google.com with SMTP id u128so8785545pgu.13 for ; Mon, 22 Jun 2020 13:58:20 -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 :mime-version:content-transfer-encoding; bh=NMAZshRZgRqtOcF48FwBwSDWqy/EeeOlwf50Pbmu5Nk=; b=d59awIr4ey2GlJF/nDZanKh5lasAZo0gqNs/Sj2FIbT3dV7+NE4F8QpEjKuFoUgbUB uNSVKl5PXzhurvRvd7umfMa951SJmZaHGs+OHDW7cINgEp28wHsTCyqp2DgG9k6wOO/q CKRpJktmKcbV+N0XIDIfQpCT8fpjSnYxg1JYk= 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:mime-version:content-transfer-encoding; bh=NMAZshRZgRqtOcF48FwBwSDWqy/EeeOlwf50Pbmu5Nk=; b=R/o3Q/flTvyX8rkr7bnoib/7oB+bplaj4UXzv5sDg0Pzq1w1Tnira1NCRCOP/EqXPl rJ+tmsI5nBt6e/3jUfFmdl+1hcM5a3qQ3946/QmSS/JMDq0RmGYLogHEUKVP4F2qbQLF 4YN3F7KAKdjpZaIRxXhcS3fO8jb7mdMAa+Pn56K8AFrAonQtc9N9xgfsTcfa/i+uRsqs v4hnK9VEMhwDv9Zoe7awymzbU/aLnmsp0Qa0/7KoPMhLEJWgKISlVYkBLVUhJN6tVoIr sEuf6A68Lp19CZGXaEmTWj2Y8ullyzVrJT17jRQHwPU/FvsOjP+raiO+/Wz3bRN3spUM QsPg== X-Gm-Message-State: AOAM531nz/dYVTT7dbZCd1dg9yvcjj6WJay9jp3hjMqg/IBLLcOL4r95 GkdDEbQfMgocF/FqWdH2MVGsEw== X-Google-Smtp-Source: ABdhPJzCXskTt3PimftTRWl/F2Ox5bixevxXdmAFf+vVuL+pxDEUYcX6Bsehddn5WdAfEWSHkb44cw== X-Received: by 2002:aa7:8f1c:: with SMTP id x28mr4466138pfr.19.1592859498597; Mon, 22 Jun 2020 13:58:18 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id c194sm14351376pfc.212.2020.06.22.13.58.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 13:58:17 -0700 (PDT) From: Kees Cook To: Will Deacon Subject: [PATCH v2 1/2] arm64/build: Use common DISCARDS in linker script Date: Mon, 22 Jun 2020 13:58:14 -0700 Message-Id: <20200622205815.2988115-2-keescook@chromium.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200622205815.2988115-1-keescook@chromium.org> References: <20200622205815.2988115-1-keescook@chromium.org> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:543 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -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_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Kees Cook , Arnd Bergmann , Catalin Marinas , Nick Desaulniers , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, James Morse , Nathan Chancellor , Peter Collingbourne , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Use the common DISCARDS rule for the linker script in an effort to regularize the linker script to prepare for warning on orphaned sections. Additionally clean up left-over no-op macros. Signed-off-by: Kees Cook Acked-by: Will Deacon --- arch/arm64/kernel/vmlinux.lds.S | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index 6827da7f3aa5..5427f502c3a6 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -6,6 +6,7 @@ */ #define RO_EXCEPTION_TABLE_ALIGN 8 +#define RUNTIME_DISCARD_EXIT #include #include @@ -89,10 +90,8 @@ SECTIONS * matching the same input section name. There is no documented * order of matching. */ + DISCARDS /DISCARD/ : { - EXIT_CALL - *(.discard) - *(.discard.*) *(.interp .dynamic) *(.dynsym .dynstr .hash .gnu.hash) *(.eh_frame)