From patchwork Wed Sep 7 22:55:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 12969431 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BC02BC54EE9 for ; Wed, 7 Sep 2022 22:56:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=4CRDZ1+oIMVqUE/0bmHaBkdq+69jk2pJwdMB+5Xyz2Y=; b=u65WMpMxvXwIl/ D1iOpWAIq2vXz97wHOBFWaTWw/mNw2/ttBRJDwwVzDfeUOBlBjfDiS6dqyySg3x1EDiTvMOEXjkvX iH41f/5h7Ge7QnEircJEy9jccQ17NuVfAhHpcVO6I75xhWov/Xv+aTjAwq9CrfAhe3BDxuOl/rY1/ 8oJu6fof6XRzCJ/RyCe/Cb0fGPgao9QNjC3hkJuadhO4szLU/qgCsOf2vKtd4j7MmHx1xcwfk84vf izvupwEXpJnXNdv3s09/N73FawbVxMHyctrUQ7RdQhLW65gIlIWmwzELD32hl5tMgQbcwK9mjzEXC tKo2L/Pw83iFcU3uqIaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oW3xD-00Az7l-IV; Wed, 07 Sep 2022 22:55:31 +0000 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oW3xA-00Az3V-Tz for linux-arm-kernel@lists.infradead.org; Wed, 07 Sep 2022 22:55:30 +0000 Received: by mail-pg1-x530.google.com with SMTP id 202so14950243pgc.8 for ; Wed, 07 Sep 2022 15:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=Q7pmrL+4wpGBCbVasMs4fSOlbSdHMQaBsvngND+c1lM=; b=Gbv62ufdc9ZHs+vkgxl3i8Wyc5jfPcgwUwck9cmVn2Unq5TqW0stEiF2Yh/9KvqGbR Bdom5pBR+tYMsrhM5doM4A4wRnJWX50FGhNIoTiWS3hqaikoYbEbIoyQbS28DhSo8qvI Z7qzB/b6HBkttLvXs5hbISf/DY4+kNqtBw3E8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=Q7pmrL+4wpGBCbVasMs4fSOlbSdHMQaBsvngND+c1lM=; b=ihuum1zT1MwZxuUicrerx26OyySo+rDRFU3IQEGc1AgobFlO4bwflT0cfqsQc9U5LS Chuen5YfTuWI/c3YwhbqS5BsoYpCqxWYUr7UrgE355tJ9o9l1uDozuGl8lXUEZkqwPXB o9482LACxIzFHwKbI4MTk2/2t5Lc1BRICjfW5ClmgrkiaGsKLfWBMUa7+brH+8ridGJC p8wyjpGkFHR+qd8FQWbNeQ8tJRBDZMrCA4UZDOuKTzZdXK464oVkFWRCqrdWL1o4BvNV BywXGmrcC2/mhIySI7bax1zElZZrd4dwQTFh1Y0wSdOt7hmivFCoo/yOcTb3AtzrYYy9 0KxA== X-Gm-Message-State: ACgBeo1M98OeydEMX6ZzhOssmHtiUvY/kRnmRIqxbXQjAn8ONjLs28jq 9HR2Rqx3V/oZNV2QLvj9n24UFQ== X-Google-Smtp-Source: AA6agR4iPretcBm0dZThuzVqecZwXG9MyW8TFBNEW/TtH75AoPT84tbbR6bcda0YeCEWeNHbGzfU/Q== X-Received: by 2002:a63:f547:0:b0:434:e1b8:45ef with SMTP id e7-20020a63f547000000b00434e1b845efmr5207647pgk.620.1662591327017; Wed, 07 Sep 2022 15:55:27 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id ik26-20020a170902ab1a00b00172d0c7edf4sm10440172plb.106.2022.09.07.15.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Sep 2022 15:55:26 -0700 (PDT) From: Kees Cook To: Russell King Cc: Kees Cook , kernel test robot , linux-arm-kernel@lists.infradead.org, Chris Down , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH] ARM: decompressor: Include .data.rel.ro.local Date: Wed, 7 Sep 2022 15:55:20 -0700 Message-Id: <20220907225520.55855-1-keescook@chromium.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1585; h=from:subject; bh=ALlFctFnZceo9yABdixwcNtBAmKlABPuY5GvGOh0ppI=; b=owEBbAKT/ZANAwAKAYly9N/cbcAmAcsmYgBjGSFY1rlJ6AQJtVRC1NVyScvP4dCo4yiu/ywMziAD d4iSe56JAjIEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCYxkhWAAKCRCJcvTf3G3AJvm1D/ UYwfAMV9EwisJ8hT8C5PdYlmAVN1ymHS5fIzWpmqDh2iusCjeyOziuZ6NoniwHCeXqKoFKDyb6Ry3u aJBjEFGKMdYGYGc8eCLZ2GMRRubyQ6K/lHylV3jVPauuLv2qWgt6LCEACjt4cq6x5Wkd85+AduCVml DqkkhvpbwK5KqFv+bdWcF9Do8caNuZz5xRe2+enLPp5ETWy6uG1oSxYzFXF5GIQvuxhpJXJSUos5fB 8tG3n/EV2p4lX3MFGi1qSgxjU9mrxwv8Hit9ycuWqWa+VSOgCDV5CQBb41tM2RGkrPmJFGUd85P096 05zwShEKrFtZJv/MiUOIo46e3IH6i0R/4gspJDaM9e2HFyIB0LD+vrrVRwdFLjlRlTjBttIHFmuolW Xq223PeibLpMTF0LRGqMq+QG6EFbfG15kDYSGCwo0InzFFv2MgvlF2bS2y7rMlrsQjZ1ZD5aCQSgnY O00Vxuz41oGen66/ogh8SMYOwSV7GgGXOUdCNisL4PyFTAqurVydNE3QgxXp6yEZpvuKK1u3yP9VAx PHHfM0SnDOfVAiY9hODQrvpPtwkyFa88yArjcOqCK6ExHfNWX0OZwmoVDqpblLGF08ZBzXGwxlGzkd zM4LXI8RkGxChI/PwLPIKRV9By5jiUe1JcvAOF5ilS8HaGIJo58PG+S+0h X-Developer-Key: i=keescook@chromium.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220907_155529_006314_B3CBD2E2 X-CRM114-Status: GOOD ( 12.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The .data.rel.ro.local section has the same semantics as .data.rel.ro here, so include it in the .rodata section of the decompressor. Additionally, Since the .printk_index section isn't usable outside of the core kernel, discard it in the decompressor. Avoids these warnings: arm-linux-gnueabi-ld: warning: orphan section `.data.rel.ro.local' from `arch/arm/boot/compressed/fdt_rw.o' being placed in section `.data.rel.ro.local' arm-linux-gnueabi-ld: warning: orphan section `.printk_index' from `arch/arm/boot/compressed/fdt_rw.o' being placed in section `.printk_index' Reported-by: kernel test robot Link: https://lore.kernel.org/linux-mm/202209080545.qMIVj7YM-lkp@intel.com Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Kees Cook --- arch/arm/boot/compressed/vmlinux.lds.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot/compressed/vmlinux.lds.S b/arch/arm/boot/compressed/vmlinux.lds.S index 1bcb68ac4b01..3fcb3e62dc56 100644 --- a/arch/arm/boot/compressed/vmlinux.lds.S +++ b/arch/arm/boot/compressed/vmlinux.lds.S @@ -23,6 +23,7 @@ SECTIONS *(.ARM.extab*) *(.note.*) *(.rel.*) + *(.printk_index) /* * Discard any r/w data - this produces a link error if we have any, * which is required for PIC decompression. Local data generates @@ -57,6 +58,7 @@ SECTIONS *(.rodata) *(.rodata.*) *(.data.rel.ro) + *(.data.rel.ro.*) } .piggydata : { *(.piggydata)