diff options
| author | Fuad Tabba <fuad.tabba@linux.dev> | 2026-10-21 12:06:59 +0100 |
|---|---|---|
| committer | Marc Zyngier <maz@kernel.org> | 2026-11-03 12:03:43 +0000 |
| commit | 249e053eaacb2959794a5ee3d27737063f4e3dad (patch) | |
| tree | 99b0d71cf8bdfe5552b341f811e994f508e3c9c2 /scripts/Makefile.thinlto | |
| parent | 62b9e1f75a3c39cfc38b3950bbad017ac5f95bcc (diff) | |
KVM: arm64: Sanitise MTE tags when a permission fault installs a mapping
The stage-2 fault path sanitises MTE tags only on translation faults, as
a permission fault normally just relaxes an existing leaf. However, when
the page is backed by a THP, a permission fault at page granule installs
a block whose other pages may never have been mapped or sanitised. Once
dirty logging is off, a guest write to a page mapped read-only during
logging installs the block, and the guest can read the tags those pages'
previous owners left.
Sanitise whenever the fault path calls kvm_pgtable_stage2_map() rather
than relaxing permissions. If the VMM replaces the VMA after the guest
takes a permission fault but before vma_lookup(), that path would map
and sanitise memory from the new VMA without checking it. Run the
VM_MTE_ALLOWED check in kvm_s2_fault_compute_prot() on permission
faults too.
Fixes: ea7fc1bb1cd1b ("KVM: arm64: Introduce MTE VM feature")
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://patch.msgid.link/20261021110700.493315-4-fuad.tabba@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
