arm64: mm: BUG on unsupported manipulations of live kernel mappings
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 21 Oct 2016 11:22:56 +0000 (12:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jan 2020 07:19:33 +0000 (08:19 +0100)
commit120db145140a9f64275f8efd56a3c20793c5ae47
tree5207dc7c5dfdfb40c48138c84ed357c821908b9c
parent65b32fd4eabc5209019894627b1bda65611fd1cb
arm64: mm: BUG on unsupported manipulations of live kernel mappings

commit e98216b52176ba2bfa4bdb02f178f4d08832d465 upstream.

Now that we take care not manipulate the live kernel page tables in a
way that may lead to TLB conflicts, the case where a table mapping is
replaced by a block mapping can no longer occur. So remove the handling
of this at the PUD and PMD levels, and instead, BUG() on any occurrence
of live kernel page table manipulations that modify anything other than
the permission bits.

Since mark_rodata_ro() is the only caller where the kernel mappings that
are being manipulated are actually live, drop the various conditional
flush_tlb_all() invocations, and add a single call to mark_rodata_ro()
instead.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/mm/mmu.c