[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 04/10] modules: load module sections at page-aligned addre
From: |
Daniel Kiper |
Subject: |
Re: [PATCH v7 04/10] modules: load module sections at page-aligned addresses |
Date: |
Tue, 8 Oct 2024 16:50:39 +0200 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
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 <pjones@redhat.com>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> Signed-off-by: Jan Setje-Eilers <jan.setjeeilers@oracle.com>
> Signed-off-by: Mate Kukri <mate.kukri@canonical.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Daniel
- [PATCH v7 00/10] UEFI NX support and NX Linux loader using shim loader protocol, Mate Kukri, 2024/10/04
- [PATCH v7 01/10] modules: make .module_license read-only, Mate Kukri, 2024/10/04
- [PATCH v7 03/10] modules: Don't allocate space for non-allocable sections., Mate Kukri, 2024/10/04
- [PATCH v7 04/10] modules: load module sections at page-aligned addresses, Mate Kukri, 2024/10/04
- Re: [PATCH v7 04/10] modules: load module sections at page-aligned addresses,
Daniel Kiper <=
- [PATCH v7 05/10] nx: add memory attribute get/set API, Mate Kukri, 2024/10/04
- [PATCH v7 02/10] modules: strip .llvm_addrsig sections and similar., Mate Kukri, 2024/10/04
- [PATCH v7 06/10] nx: set page permissions for loaded modules., Mate Kukri, 2024/10/04
- [PATCH v7 07/10] nx: set the nx compatible flag in EFI GRUB images, Mate Kukri, 2024/10/04
- [PATCH v7 10/10] efi: Disallow fallback to legacy Linux loader when shim says NX is required., Mate Kukri, 2024/10/04
- [PATCH v7 08/10] efi: Provide wrappers for load_image, start_image, unload_image, Mate Kukri, 2024/10/04
- [PATCH v7 09/10] efi: Use shim's loader protocol for EFI image verification and loading, Mate Kukri, 2024/10/04