linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/kasan: map KASAN zero page read only
@ 2016-01-06 15:54 Ard Biesheuvel
  2016-01-06 19:48 ` Andrey Ryabinin
  0 siblings, 1 reply; 5+ messages in thread
From: Ard Biesheuvel @ 2016-01-06 15:54 UTC (permalink / raw)
  To: linux-mm, linux-arm-kernel, ryabinin.a.a, catalin.marinas, mingo
  Cc: Ard Biesheuvel

The original x86_64-only version of KASAN mapped its zero page
read-only, but this got lost when the code was generalised and
ported to arm64, since, at the time, the PAGE_KERNEL_RO define
did not exist. It has been added to arm64 in the mean time, so
let's use it.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 mm/kasan/kasan_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/kasan/kasan_init.c b/mm/kasan/kasan_init.c
index 3f9a41cf0ac6..8726a92604ad 100644
--- a/mm/kasan/kasan_init.c
+++ b/mm/kasan/kasan_init.c
@@ -49,7 +49,7 @@ static void __init zero_pte_populate(pmd_t *pmd, unsigned long addr,
 	pte_t *pte = pte_offset_kernel(pmd, addr);
 	pte_t zero_pte;
 
-	zero_pte = pfn_pte(PFN_DOWN(__pa(kasan_zero_page)), PAGE_KERNEL);
+	zero_pte = pfn_pte(PFN_DOWN(__pa(kasan_zero_page)), PAGE_KERNEL_RO);
 	zero_pte = pte_wrprotect(zero_pte);
 
 	while (addr + PAGE_SIZE <= end) {
-- 
2.5.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-01-07 10:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-06 15:54 [PATCH] mm/kasan: map KASAN zero page read only Ard Biesheuvel
2016-01-06 19:48 ` Andrey Ryabinin
2016-01-06 20:18   ` Ard Biesheuvel
2016-01-07  9:51     ` Catalin Marinas
2016-01-07 10:01       ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox