From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 824AC32C8B; Fri, 6 Dec 2024 14:50:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733496647; cv=none; b=heX8fD2jNFKiDL1tQUHif5wdeX4Km1mmD3m2FFXiREmvomZL1vuLS8cuyeCPYGOKHHARN9h6muJ3u/ryjwqm8JtVOS6BOJuF9cImT20iTwGxMa7jbHXF0VyVwkuW8j75bMFDFzGoLwfqy0CBESQPIrlmxuVDKc/lEbOiMKreJ8s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733496647; c=relaxed/simple; bh=qaIbE3J6YxhSq9JXaGx9Ttievl28BZH8yzVpsoPN+Jc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qZ/bV6UZQw4zd19GEJal0zpZInJe6p7tEjXrKgdJzmIO5FyPzRvylaLgRJoLokXPso1sIidxxaMmNqJoXxryXCL3VXeSXHhnyIL0htQTNNcEbJ948Wj+xmwR779QmexgZc82+FWY5VP79hCMbK/Yy7kbIm/Giq+HPc9jYsJGPGk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=gCIMCAdV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="gCIMCAdV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98D4CC4CED1; Fri, 6 Dec 2024 14:50:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1733496647; bh=qaIbE3J6YxhSq9JXaGx9Ttievl28BZH8yzVpsoPN+Jc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gCIMCAdVgGcD5MFWXo01gB2yPIaaSBHVPrvVA+cjm9UPOGVNMmk0Clxx4oVxI9HmD rDrx5P/EJw0eHzYKohRxxEaLuDaxKNGVncbonD6Hju5DhIyQY0Nn5pe9W7qeaVS+El gEFOx9FqDlBLAGzyO0Llw6svG0JXCCOADW7izKl4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Masahiro Yamada , Will Deacon , Catalin Marinas , Sasha Levin Subject: [PATCH 6.6 064/676] arm64: fix .data.rel.ro size assertion when CONFIG_LTO_CLANG Date: Fri, 6 Dec 2024 15:28:03 +0100 Message-ID: <20241206143655.861447548@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241206143653.344873888@linuxfoundation.org> References: <20241206143653.344873888@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Masahiro Yamada [ Upstream commit 340fd66c856651d8c1d29f392dd26ad674d2db0e ] Commit be2881824ae9 ("arm64/build: Assert for unwanted sections") introduced an assertion to ensure that the .data.rel.ro section does not exist. However, this check does not work when CONFIG_LTO_CLANG is enabled, because .data.rel.ro matches the .data.[0-9a-zA-Z_]* pattern in the DATA_MAIN macro. Move the ASSERT() above the RW_DATA() line. Fixes: be2881824ae9 ("arm64/build: Assert for unwanted sections") Signed-off-by: Masahiro Yamada Acked-by: Will Deacon Link: https://lore.kernel.org/r/20241106161843.189927-1-masahiroy@kernel.org Signed-off-by: Catalin Marinas Signed-off-by: Sasha Levin --- arch/arm64/kernel/vmlinux.lds.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index 3cd7e76cc5626..a553dae9a0d48 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -285,6 +285,9 @@ SECTIONS __initdata_end = .; __init_end = .; + .data.rel.ro : { *(.data.rel.ro) } + ASSERT(SIZEOF(.data.rel.ro) == 0, "Unexpected RELRO detected!") + _data = .; _sdata = .; RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_ALIGN) @@ -336,9 +339,6 @@ SECTIONS *(.plt) *(.plt.*) *(.iplt) *(.igot .igot.plt) } ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!") - - .data.rel.ro : { *(.data.rel.ro) } - ASSERT(SIZEOF(.data.rel.ro) == 0, "Unexpected RELRO detected!") } #include "image-vars.h" -- 2.43.0