[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <03b3647b-49f9-4a9a-be65-3170bde65730@amd.com>
Date: Wed, 9 Oct 2024 13:16:36 -0400
From: Jason Andryuk <jason.andryuk@....com>
To: Ard Biesheuvel <ardb+git@...gle.com>, <linux-kernel@...r.kernel.org>
CC: Ard Biesheuvel <ardb@...nel.org>, Juergen Gross <jgross@...e.com>, "Boris
Ostrovsky" <boris.ostrovsky@...cle.com>, <x86@...nel.org>,
<xen-devel@...ts.xenproject.org>
Subject: Re: [PATCH v3 4/5] x86/xen: Avoid relocatable quantities in Xen ELF
notes
On 2024-10-09 12:04, Ard Biesheuvel wrote:
> From: Ard Biesheuvel <ardb@...nel.org>
>
> Xen puts virtual and physical addresses into ELF notes that are treated
> by the linker as relocatable by default. Doing so is not only pointless,
> given that the ELF notes are only intended for consumption by Xen before
> the kernel boots. It is also a KASLR leak, given that the kernel's ELF
> notes are exposed via the world readable /sys/kernel/notes.
>
> So emit these constants in a way that prevents the linker from marking
> them as relocatable. This involves place-relative relocations (which
> subtract their own virtual address from the symbol value) and linker
> provided absolute symbols that add the address of the place to the
> desired value.
>
> Tested-by: Jason Andryuk <jason.andryuk@....com>
> Signed-off-by: Ard Biesheuvel <ardb@...nel.org>
Reviewed-by: Jason Andryuk <jason.andryuk@....com>
Thanks,
Jason
Powered by blists - more mailing lists