]> git.baikalelectronics.ru Git - kernel.git/commit
arm64/mm: use fixmap to modify swapper_pg_dir
authorJun Yao <yaojun8558363@gmail.com>
Mon, 24 Sep 2018 16:15:02 +0000 (17:15 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 25 Sep 2018 14:10:55 +0000 (15:10 +0100)
commit26b2f14b6e47d636dbd34dc1e24163ff0d0f66ce
tree22f8fed6993270edb2b4e2570101a675b703ca3a
parent5ab2ed2c94fbd9846871fd64de46e358f7e48fd2
arm64/mm: use fixmap to modify swapper_pg_dir

Once swapper_pg_dir is in the rodata section, it will not be possible to
modify it directly, but we will need to modify it in some cases.

To enable this, we can use the fixmap when deliberately modifying
swapper_pg_dir. As the pgd is only transiently mapped, this provides
some resilience against illicit modification of the pgd, e.g. for
Kernel Space Mirror Attack (KSMA).

Signed-off-by: Jun Yao <yaojun8558363@gmail.com>
Reviewed-by: James Morse <james.morse@arm.com>
[Mark: simplify ifdeffery, commit message]
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/pgtable.h
arch/arm64/mm/mmu.c