projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3f68e69
)
riscv: read-only pages should not be writable
author
Heinrich Schuchardt
<heinrich.schuchardt@canonical.com>
Sat, 28 May 2022 01:41:32 +0000
(
03:41
+0200)
committer
Ard Biesheuvel
<ardb@kernel.org>
Sat, 28 May 2022 09:39:31 +0000
(11:39 +0200)
If EFI pages are marked as read-only,
we should remove the _PAGE_WRITE flag.
The current code overwrites an unused value.
Fixes:
b91540d52a08b
("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>
arch/riscv/kernel/efi.c
patch
|
blob
|
history
diff --git
a/arch/riscv/kernel/efi.c
b/arch/riscv/kernel/efi.c
index
0241592
..
1aa5403
100644
(file)
--- a/
arch/riscv/kernel/efi.c
+++ b/
arch/riscv/kernel/efi.c
@@
-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) {