On Fri, Oct 04, 2024 at 03:41:26PM +0100, Mate Kukri wrote:
> Currently we load module sections at whatever alignment gcc+ld happened
> to dump into the ELF section header, which is often less then the page
> size. Since NX protections are page based, this alignment must be
> rounded up to page size on platforms supporting NX protections.
>
> This patch switches EFI platforms to load module sections at 4kB
> page-aligned addresses.
>
> It then changes the allocation size computation and the loader code in
> grub_dl_load_segments() to align the locations and sizes up to these
> boundaries, and fills any added padding with zeros.
>
> All of this happens before relocations are applied, so the relocations
> factor that in with no change.
>
> Signed-off-by: Peter Jones <[email protected]>
> Signed-off-by: Laszlo Ersek <[email protected]>
> Signed-off-by: Jan Setje-Eilers <[email protected]>
> Signed-off-by: Mate Kukri <[email protected]>

Reviewed-by: Daniel Kiper <[email protected]>

Daniel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to