]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: arm64: Inject SIGSEGV on illegal accesses
authorQuentin Perret <qperret@google.com>
Mon, 30 Mar 2026 14:48:20 +0000 (15:48 +0100)
committerMarc Zyngier <maz@kernel.org>
Mon, 30 Mar 2026 15:58:08 +0000 (16:58 +0100)
commit9ff714a09222128da16900fc7c15dea65692fc26
tree426024359dc51a0c555335881d92f2c66febed38
parentbe9ed3529e0599f036a425d83ecc6dd4a085c9d2
KVM: arm64: Inject SIGSEGV on illegal accesses

The pKVM hypervisor will currently panic if the host tries to access
memory that it doesn't own (e.g. protected guest memory). Sadly, as
guest memory can still be mapped into the VMM's address space, userspace
can trivially crash the kernel/hypervisor by poking into guest memory.

To prevent this, inject the abort back in the host with S1PTW set in the
ESR, hence allowing the host to differentiate this abort from normal
userspace faults and inject a SIGSEGV cleanly.

Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Tested-by: Mostafa Saleh <smostafa@google.com>
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Link: https://patch.msgid.link/20260330144841.26181-20-will@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/hyp/nvhe/mem_protect.c
arch/arm64/mm/fault.c