Skip to content

efi: Fix alignenment issues in unaccepted memory code

Kiryl Shutsemau (Meta) linux-efi linux-mm lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 4 repliesIn review
  2. v12 patches 11 repliesSuperseded

Changes in v2 from the cover letter

- Fix 'end' calculation in the second patch (Tom)

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2efi: Fix reservation of unaccepted memory tabledrivers/firmware/efi/efi.c+4 -40 replies
2/2efi: Align unaccepted memory range to page boundarydrivers/firmware/efi/unaccepted_memory.c+8 -20 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMike Rapoport (Microsoft)Tom Lendacky
SeriesA-b R-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCHv2 0/2] efi: Fix alignenment issues in unaccepted memory code

This series addresses two issues related to unaligned physical addresses and sizes when handling EFI unaccepted memory. These issues were identified as potential sources of kernel panics in Intel TDX environments due to incomplete memory reservation or missing "guard page" extensions.

The first patch fixes the reservation of the unaccepted memory table itself in efi_config_parse_tables(). It ensures the entire page range covering the table is reserved even if the table doesn't start on a page boundary.

The second patch ensures that memory acceptance requests in accept_memory() and range_contains_unaccepted_memory() are page-aligned before performing the unit_size alignment check. This prevents skipping the necessary "guard page" extension for unaligned ranges, which is required to avoid crashes with load_unaligned_zeropad().

v2:
- Fix 'end' calculation in the second patch (Tom)

Kiryl Shutsemau (Meta) (2):
efi: Fix reservation of unaccepted memory table
efi: Align unaccepted memory range to page boundary

 drivers/firmware/efi/efi.c               |  8 ++++----
 drivers/firmware/efi/unaccepted_memory.c | 10 ++++++++--
 2 files changed, 12 insertions(+), 6 deletions(-)
Signature · 1 line
2.51.2