]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Don't inherit exec permission across page-table levels
authorWill Deacon <will@kernel.org>
Thu, 23 Jul 2020 10:17:14 +0000 (11:17 +0100)
committerMarc Zyngier <maz@kernel.org>
Tue, 28 Jul 2020 08:03:57 +0000 (09:03 +0100)
commitb063db3a3d570e6810f7826dd26e74f910be1869
treeec558f6379e7781e63977615616bb5b6a059532c
parentebec9bd777b3ed59798aa45abbe95e7aef57889e
KVM: arm64: Don't inherit exec permission across page-table levels

If a stage-2 page-table contains an executable, read-only mapping at the
pte level (e.g. due to dirty logging being enabled), a subsequent write
fault to the same page which tries to install a larger block mapping
(e.g. due to dirty logging having been disabled) will erroneously inherit
the exec permission and consequently skip I-cache invalidation for the
rest of the block.

Ensure that exec permission is only inherited by write faults when the
new mapping is of the same size as the existing one. A subsequent
instruction abort will result in I-cache invalidation for the entire
block mapping.

Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Tested-by: Quentin Perret <qperret@google.com>
Reviewed-by: Quentin Perret <qperret@google.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200723101714.15873-1-will@kernel.org
arch/arm64/kvm/mmu.c