Re: [PATCH RFC 1/7] x86/head/64: Mark startup_gdt and startup_gdt_descr as __initdata

From: Ingo Molnar
Date: Tue Oct 17 2023 - 09:02:36 EST



* Hou Wenlong <houwenlong.hwl@xxxxxxxxxxxx> wrote:

> Hi Ingo,
>
> I have sent patch #6 separately for x86. Do you have any ideas about
> building the head code as PIE? Should I resend the patchset for the PIE
> feature?

So I had a brief look, and despite reading 0/43 it was unclear to me what
the precise advantages of building as PIE are.

Ie. could you please outline:

- *Exactly* how much PIE based KASLR randomization would gain us in terms
of randomization granularity and effective number of randomization bits,
compared to the current status quo?

- How is code generation changed at the instruction level - how does
kernel size change and what are the micro-advantages/disadvantages?

- Are there any other advantages/motivation than improving KASLR?

Ie. before asking us to apply ~50 patches and add a whole new build mode
and the maintainance overhead to support it into infinity and beyond, could
you please offer a better list of pros and cons?

Thanks,

Ingo