[PATCH v2 10/16] KVM: arm64: gic-v5: Add ITS userspace register access
Fuad Tabba
fuad.tabba at linux.dev
Tue Nov 3 06:22:36 PST 2026
On Mon, 02 Nov 2026 19:44:48 +0000, Sascha Bischoff
<sascha.bischoff at arm.com> wrote:
[...]
> diff --git a/arch/arm64/kvm/vgic/vgic-its-v5.c b/arch/arm64/kvm/vgic/vgic-its-v5.c
[...]
> +static int vgic_v5_its_attr_regs_access(struct kvm_device *dev,
> + struct kvm_device_attr *attr,
> + u64 *reg, bool is_write)
> +{
[...]
> + if (IS_VGIC_ADDR_UNDEF(its->vgic_v5_its_base)) {
> + ret = -ENXIO;
> + goto out;
> + }
This lets userspace set CR0.ITSEN before the vgic is initialised,
while the VM ID is still VGIC_V5_VM_ID_INVAL. An MSI (KVM_SIGNAL_MSI
or an irqfd) then reaches EL2 with VM ID 0xffff, and forwarding writes
the same into the ITTE. With 16 VM ID bits and every lower ID in use,
that lands in another VM. Could enabling the ITS be rejected until the
vgic is initialised? The existing its->enabled checks then cover
injection and forwarding. (Sashiko raised this on patch 7 [1])
Thanks!
/fuad
[1] https://lore.kernel.org/all/sashiko-outbox-194102@kernel.org/
More information about the linux-arm-kernel
mailing list