[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] xen/arm: vITS: check the target vCPU in INVALL



commit 0d498e4f9cd85ea060aa9d9d621923a8a6685357
Author:     Mykola Kvach <mykola_kvach@xxxxxxxx>
AuthorDate: Fri Nov 20 20:37:22 2026 +0100
Commit:     Michal Orzel <michal.orzel@xxxxxxx>
CommitDate: Tue Nov 24 10:39:45 2026 +0100

    xen/arm: vITS: check the target vCPU in INVALL
    
    get_vcpu_from_collection() can return NULL if the collection entry
    cannot be read or does not identify a vCPU. its_handle_invall() then
    dereferences NULL when taking the vCPU's vGIC lock, crashing the
    hypervisor.
    
    Return -ENOENT to the vITS command dispatcher when the lookup fails.
    
    Fixes: e975cca32bde ("ARM: vITS: handle INVALL command")
    Signed-off-by: Mykola Kvach <mykola_kvach@xxxxxxxx>
    Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
---
 xen/arch/arm/vgic-v3-its.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/arm/vgic-v3-its.c b/xen/arch/arm/vgic-v3-its.c
index 79d056e21a..b2103d820d 100644
--- a/xen/arch/arm/vgic-v3-its.c
+++ b/xen/arch/arm/vgic-v3-its.c
@@ -533,6 +533,9 @@ static int its_handle_invall(struct virt_its *its, uint64_t 
*cmdptr)
     vcpu = get_vcpu_from_collection(its, collid);
     spin_unlock(&its->its_lock);
 
+    if ( !vcpu )
+        return -ENOENT;
+
     spin_lock_irqsave(&vcpu->arch.vgic.lock, flags);
     read_lock(&its->d->arch.vgic.pend_lpi_tree_lock);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.