* Re: Patch "x86/relocs: Handle R_X86_64_REX_GOTPCRELX relocations" has been added to the 6.14-stable tree
[not found] <20250522213009.3137023-1-sashal@kernel.org>
@ 2025-05-22 23:01 ` Nathan Chancellor
2025-05-23 12:23 ` Sasha Levin
0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2025-05-22 23:01 UTC (permalink / raw)
To: stable, Sasha Levin
Cc: stable-commits, brgerst, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
Nick Desaulniers, Bill Wendling, Justin Stitt
On Thu, May 22, 2025 at 05:30:09PM -0400, Sasha Levin wrote:
> This is a note to let you know that I've just added the patch titled
>
> x86/relocs: Handle R_X86_64_REX_GOTPCRELX relocations
>
> to the 6.14-stable tree which can be found at:
> http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
>
> The filename of the patch is:
> x86-relocs-handle-r_x86_64_rex_gotpcrelx-relocations.patch
> and it can be found in the queue-6.14 subdirectory.
>
> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable@vger.kernel.org> know about it.
>
>
>
> commit d8e603969259e50aa632d1a3fde8883f41e26150
> Author: Brian Gerst <brgerst@gmail.com>
> Date: Thu Jan 23 14:07:37 2025 -0500
>
> x86/relocs: Handle R_X86_64_REX_GOTPCRELX relocations
>
> [ Upstream commit cb7927fda002ca49ae62e2782c1692acc7b80c67 ]
>
> Clang may produce R_X86_64_REX_GOTPCRELX relocations when redefining the
> stack protector location. Treat them as another type of PC-relative
> relocation.
>
> Signed-off-by: Brian Gerst <brgerst@gmail.com>
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Link: https://lore.kernel.org/r/20250123190747.745588-6-brgerst@gmail.com
> Signed-off-by: Sasha Levin <sashal@kernel.org>
>
> diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c
> index e937be979ec86..92a1e503305ef 100644
> --- a/arch/x86/tools/relocs.c
> +++ b/arch/x86/tools/relocs.c
> @@ -32,6 +32,11 @@ static struct relocs relocs32;
> static struct relocs relocs32neg;
> static struct relocs relocs64;
> # define FMT PRIu64
> +
> +#ifndef R_X86_64_REX_GOTPCRELX
> +# define R_X86_64_REX_GOTPCRELX 42
> +#endif
> +
> #else
> # define FMT PRIu32
> #endif
> @@ -227,6 +232,7 @@ static const char *rel_type(unsigned type)
> REL_TYPE(R_X86_64_PC16),
> REL_TYPE(R_X86_64_8),
> REL_TYPE(R_X86_64_PC8),
> + REL_TYPE(R_X86_64_REX_GOTPCRELX),
> #else
> REL_TYPE(R_386_NONE),
> REL_TYPE(R_386_32),
> @@ -861,6 +867,7 @@ static int do_reloc64(struct section *sec, Elf_Rel *rel, ElfW(Sym) *sym,
>
> case R_X86_64_PC32:
> case R_X86_64_PLT32:
> + case R_X86_64_REX_GOTPCRELX:
> /*
> * PC relative relocations don't need to be adjusted unless
> * referencing a percpu symbol.
Didn't Ard just say this has no purpose in stable?
https://lore.kernel.org/CAMj1kXGtasdqRPn8koNN095VEEU4K409QvieMdgGXNUK0kPgkw@mail.gmail.com/
Cheers,
Nathan
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Patch "x86/relocs: Handle R_X86_64_REX_GOTPCRELX relocations" has been added to the 6.14-stable tree
2025-05-22 23:01 ` Patch "x86/relocs: Handle R_X86_64_REX_GOTPCRELX relocations" has been added to the 6.14-stable tree Nathan Chancellor
@ 2025-05-23 12:23 ` Sasha Levin
0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2025-05-23 12:23 UTC (permalink / raw)
To: Nathan Chancellor
Cc: stable, stable-commits, brgerst, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
Nick Desaulniers, Bill Wendling, Justin Stitt
On Thu, May 22, 2025 at 04:01:01PM -0700, Nathan Chancellor wrote:
>On Thu, May 22, 2025 at 05:30:09PM -0400, Sasha Levin wrote:
>> This is a note to let you know that I've just added the patch titled
>>
>> x86/relocs: Handle R_X86_64_REX_GOTPCRELX relocations
>>
>> to the 6.14-stable tree which can be found at:
>> http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
>>
>> The filename of the patch is:
>> x86-relocs-handle-r_x86_64_rex_gotpcrelx-relocations.patch
>> and it can be found in the queue-6.14 subdirectory.
>>
>> If you, or anyone else, feels it should not be added to the stable tree,
>> please let <stable@vger.kernel.org> know about it.
>>
>>
>>
>> commit d8e603969259e50aa632d1a3fde8883f41e26150
>> Author: Brian Gerst <brgerst@gmail.com>
>> Date: Thu Jan 23 14:07:37 2025 -0500
>>
>> x86/relocs: Handle R_X86_64_REX_GOTPCRELX relocations
>>
>> [ Upstream commit cb7927fda002ca49ae62e2782c1692acc7b80c67 ]
>>
>> Clang may produce R_X86_64_REX_GOTPCRELX relocations when redefining the
>> stack protector location. Treat them as another type of PC-relative
>> relocation.
>>
>> Signed-off-by: Brian Gerst <brgerst@gmail.com>
>> Signed-off-by: Ingo Molnar <mingo@kernel.org>
>> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
>> Cc: Linus Torvalds <torvalds@linux-foundation.org>
>> Link: https://lore.kernel.org/r/20250123190747.745588-6-brgerst@gmail.com
>> Signed-off-by: Sasha Levin <sashal@kernel.org>
>>
>> diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c
>> index e937be979ec86..92a1e503305ef 100644
>> --- a/arch/x86/tools/relocs.c
>> +++ b/arch/x86/tools/relocs.c
>> @@ -32,6 +32,11 @@ static struct relocs relocs32;
>> static struct relocs relocs32neg;
>> static struct relocs relocs64;
>> # define FMT PRIu64
>> +
>> +#ifndef R_X86_64_REX_GOTPCRELX
>> +# define R_X86_64_REX_GOTPCRELX 42
>> +#endif
>> +
>> #else
>> # define FMT PRIu32
>> #endif
>> @@ -227,6 +232,7 @@ static const char *rel_type(unsigned type)
>> REL_TYPE(R_X86_64_PC16),
>> REL_TYPE(R_X86_64_8),
>> REL_TYPE(R_X86_64_PC8),
>> + REL_TYPE(R_X86_64_REX_GOTPCRELX),
>> #else
>> REL_TYPE(R_386_NONE),
>> REL_TYPE(R_386_32),
>> @@ -861,6 +867,7 @@ static int do_reloc64(struct section *sec, Elf_Rel *rel, ElfW(Sym) *sym,
>>
>> case R_X86_64_PC32:
>> case R_X86_64_PLT32:
>> + case R_X86_64_REX_GOTPCRELX:
>> /*
>> * PC relative relocations don't need to be adjusted unless
>> * referencing a percpu symbol.
>
>Didn't Ard just say this has no purpose in stable?
>
>https://lore.kernel.org/CAMj1kXGtasdqRPn8koNN095VEEU4K409QvieMdgGXNUK0kPgkw@mail.gmail.com/
Indeed! This was an issue with my scripts and happened to ~10 more
commits I was dropping. I've now dropped all of those.
Sorry for the noise and thanks for catching this!
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-23 12:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20250522213009.3137023-1-sashal@kernel.org>
2025-05-22 23:01 ` Patch "x86/relocs: Handle R_X86_64_REX_GOTPCRELX relocations" has been added to the 6.14-stable tree Nathan Chancellor
2025-05-23 12:23 ` Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox