arm64: kasan: ensure that the KASAN zero page is mapped read-only
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 11 Jan 2016 13:50:21 +0000 (14:50 +0100)
committerAlex Shi <alex.shi@linaro.org>
Wed, 11 May 2016 14:19:08 +0000 (22:19 +0800)
commit035fdc46d48ae8a7cbf7199c74bac1de36cca626
tree05945fdacb22842847a4cfb6c50b30ac06bc41e8
parentb87cf8adbe0d3b1998a7dafd01b70e9b118f641d
arm64: kasan: ensure that the KASAN zero page is mapped read-only

When switching from the early KASAN shadow region, which maps the
entire shadow space read-write, to the permanent KASAN shadow region,
which uses a zero page to shadow regions that are not subject to
instrumentation, the lowest level table kasan_zero_pte[] may be
reused unmodified, which means that the mappings of the zero page
that it contains will still be read-write.

So update it explicitly to map the zero page read only when we
activate the permanent mapping.

Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 7b1af9795773d745c2a8c7d4ca5f2936e8b6adfb)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
arch/arm64/mm/kasan_init.c