Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel.org>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	moderated for non-subscribers
	<linux-arm-kernel@lists.infradead.org>,
	linux-kbuild@vger.kernel.org, Nicholas Piggin <npiggin@gmail.com>,
	Ingo Molnar <mingo@kernel.org>, Kees Cook <kees@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64: fix .data.rel.ro size assertion when CONFIG_LTO_CLANG
Date: Thu, 7 Nov 2024 11:15:20 +0000	[thread overview]
Message-ID: <20241107111519.GA15424@willie-the-truck> (raw)
In-Reply-To: <20241106161843.189927-1-masahiroy@kernel.org>

On Thu, Nov 07, 2024 at 01:18:42AM +0900, Masahiro Yamada wrote:
> 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 <masahiroy@kernel.org>
> ---
> 
>  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 58d89d997d05..f84c71f04d9e 100644
> --- a/arch/arm64/kernel/vmlinux.lds.S
> +++ b/arch/arm64/kernel/vmlinux.lds.S
> @@ -287,6 +287,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)
> @@ -343,9 +346,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"

Acked-by: Will Deacon <will@kernel.org>

Catalin, please can you pick this up for 6.13?

Will


  reply	other threads:[~2024-11-07 11:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-06 16:18 [PATCH] arm64: fix .data.rel.ro size assertion when CONFIG_LTO_CLANG Masahiro Yamada
2024-11-07 11:15 ` Will Deacon [this message]
2024-11-07 18:40 ` Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241107111519.GA15424@willie-the-truck \
    --to=will@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=kees@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=mingo@kernel.org \
    --cc=npiggin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox