[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171011082227.20546-8-liuwenliang@huawei.com>
Date: Wed, 11 Oct 2017 16:22:23 +0800
From: Abbott Liu <liuwenliang@...wei.com>
To: <linux@...linux.org.uk>, <aryabinin@...tuozzo.com>,
<liuwenliang@...wei.com>, <afzal.mohd.ma@...il.com>,
<f.fainelli@...il.com>, <labbott@...hat.com>,
<kirill.shutemov@...ux.intel.com>, <mhocko@...e.com>,
<cdall@...aro.org>, <marc.zyngier@....com>,
<catalin.marinas@....com>, <akpm@...ux-foundation.org>,
<mawilcox@...rosoft.com>, <tglx@...utronix.de>,
<thgarnie@...gle.com>, <keescook@...omium.org>, <arnd@...db.de>,
<vladimir.murzin@....com>, <tixy@...aro.org>,
<ard.biesheuvel@...aro.org>, <robin.murphy@....com>,
<mingo@...nel.org>, <grygorii.strashko@...aro.org>
CC: <glider@...gle.com>, <dvyukov@...gle.com>, <opendmb@...il.com>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <kasan-dev@...glegroups.com>,
<linux-mm@...ck.org>, <jiazhenghua@...wei.com>,
<dylix.dailei@...wei.com>, <zengweilin@...wei.com>,
<heshaoliang@...wei.com>
Subject: [PATCH 07/11] Avoid cleaning the KASan shadow area's mapping table
From: Andrey Ryabinin <a.ryabinin@...sung.com>
Avoid cleaning the mapping table(page table) of KASAN shadow area.
Cc: Andrey Ryabinin <a.ryabinin@...sung.com>
Signed-off-by: Abbott Liu <liuwenliang@...wei.com>
---
arch/arm/mm/mmu.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index e46a6a4..f5aa1de 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -1251,9 +1251,14 @@ static inline void prepare_page_table(void)
/*
* Clear out all the mappings below the kernel image.
*/
- for (addr = 0; addr < MODULES_VADDR; addr += PMD_SIZE)
+ for (addr = 0; addr < TASK_SIZE; addr += PMD_SIZE)
pmd_clear(pmd_off_k(addr));
+#ifdef CONFIG_KASAN
+ /*TASK_SIZE ~ MODULES_VADDR is the KASAN's shadow area -- skip over it*/
+ addr = MODULES_VADDR;
+#endif
+
#ifdef CONFIG_XIP_KERNEL
/* The XIP kernel is mapped in the module area -- skip over it */
addr = ((unsigned long)_exiprom + PMD_SIZE - 1) & PMD_MASK;
--
2.9.0
Powered by blists - more mailing lists