mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-08 14:23:19 +00:00
riscv: read-only pages should not be writable
If EFI pages are marked as read-only,
we should remove the _PAGE_WRITE flag.
The current code overwrites an unused value.
Fixes: b91540d52a
("RISC-V: Add EFI runtime services")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Link: https://lore.kernel.org/r/20220528014132.91052-1-heinrich.schuchardt@canonical.com
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
parent
3f68e69520
commit
630f972d76
@ -65,7 +65,7 @@ static int __init set_permissions(pte_t *ptep, unsigned long addr, void *data)
|
||||
|
||||
if (md->attribute & EFI_MEMORY_RO) {
|
||||
val = pte_val(pte) & ~_PAGE_WRITE;
|
||||
val = pte_val(pte) | _PAGE_READ;
|
||||
val |= _PAGE_READ;
|
||||
pte = __pte(val);
|
||||
}
|
||||
if (md->attribute & EFI_MEMORY_XP) {
|
||||
|
Loading…
Reference in New Issue
Block a user