Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

efi: Allow EFI_MEMORY_XP and EFI_MEMORY_RO both to be cleared

UEFI spec 2.9, p.108, table 4-1 lists the scenario that both attributes
are cleared with the description "No memory access protection is
possible for Entry". So we can have valid entries where both attributes
are cleared, so remove the check.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Fixes: 10f0d2f577053 ("efi: Implement generic support for the Memory Attributes table")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

authored by

Heiner Kallweit and committed by
Ard Biesheuvel
45add3cc 668a84c1

-5
-5
drivers/firmware/efi/memattr.c
··· 67 67 return false; 68 68 } 69 69 70 - if (!(in->attribute & (EFI_MEMORY_RO | EFI_MEMORY_XP))) { 71 - pr_warn("Entry attributes invalid: RO and XP bits both cleared\n"); 72 - return false; 73 - } 74 - 75 70 if (PAGE_SIZE > EFI_PAGE_SIZE && 76 71 (!PAGE_ALIGNED(in->phys_addr) || 77 72 !PAGE_ALIGNED(in->num_pages << EFI_PAGE_SHIFT))) {