提交 3f680876 编写于 作者: H Heiner Kallweit 提交者: Yang Yingliang

efi: Allow EFI_MEMORY_XP and EFI_MEMORY_RO both to be cleared

stable inclusion
from linux-4.19.194
commit 5fdb418b14e41b33880b949db64b18f1f448916b

--------------------------------

[ Upstream commit 45add3cc ]

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: NHeiner Kallweit <hkallweit1@gmail.com>
Fixes: 10f0d2f5 ("efi: Implement generic support for the Memory Attributes table")
Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 04197a72
...@@ -69,11 +69,6 @@ static bool entry_is_valid(const efi_memory_desc_t *in, efi_memory_desc_t *out) ...@@ -69,11 +69,6 @@ static bool entry_is_valid(const efi_memory_desc_t *in, efi_memory_desc_t *out)
return false; return false;
} }
if (!(in->attribute & (EFI_MEMORY_RO | EFI_MEMORY_XP))) {
pr_warn("Entry attributes invalid: RO and XP bits both cleared\n");
return false;
}
if (PAGE_SIZE > EFI_PAGE_SIZE && if (PAGE_SIZE > EFI_PAGE_SIZE &&
(!PAGE_ALIGNED(in->phys_addr) || (!PAGE_ALIGNED(in->phys_addr) ||
!PAGE_ALIGNED(in->num_pages << EFI_PAGE_SHIFT))) { !PAGE_ALIGNED(in->num_pages << EFI_PAGE_SHIFT))) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册