]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: s390: pci: Fix NULL dereference on AIBV allocation failure
authorFarhan Ali <alifm@linux.ibm.com>
Thu, 23 Jul 2026 22:14:07 +0000 (15:14 -0700)
committerChristian Borntraeger <borntraeger@linux.ibm.com>
Fri, 24 Jul 2026 09:26:54 +0000 (11:26 +0200)
commit8bf09b9b7d3232806df95f409581f8a9fd99a3fa
tree6c06375084cc97c9b2c0ce2cc87b1606b84aaaa4
parentf86842e4d6c482300f4567f492d512c9ccf5bc4f
KVM: s390: pci: Fix NULL dereference on AIBV allocation failure

The airq_iv_create() can return NULL on failure, but the return value was
never checked. If it fails, zdev->aibv will be NULL and fail when
dereferenced in kvm_zpci_set_airq(). Add a NULL check and free the
previously allocated AISB bit and zdev->aisb on failure.

Fixes: 3c5a1b6f0a18 ("KVM: s390: pci: provide routines for enabling/disabling interrupt forwarding")
Cc: stable@vger.kernel.org
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
Tested-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
arch/s390/kvm/pci.c