]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: s390: pci: Fix GISC refcount leak on AIF enable failure
authorHaoxiang Li <haoxiang_li2024@163.com>
Wed, 24 Jun 2026 06:19:10 +0000 (14:19 +0800)
committerChristian Borntraeger <borntraeger@linux.ibm.com>
Thu, 9 Jul 2026 08:25:56 +0000 (10:25 +0200)
kvm_s390_gisc_register() registers the guest ISC before pinning
the guest interrupt forwarding pages and allocating the AISB bit.
If any of the later setup steps fails, the function unwinds the
pinned pages and other local state, but does not unregister the
GISC reference. Add the missing kvm_s390_gisc_unregister() to the
error unwind path.

Fixes: 3c5a1b6f0a18 ("KVM: s390: pci: provide routines for enabling/disabling interrupt forwarding")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Tested-by: Matthew Rosato <mjrosato@linux.ibm.com>
Acked-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260624061910.2794734-1-haoxiang_li2024@163.com>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
arch/s390/kvm/pci.c

index 5b075c38998e31d32993068852bbb1a843d35776..686113be053090f03ebe05c2cee465b2ba842d08 100644 (file)
@@ -328,6 +328,7 @@ unpin2:
 unpin1:
        unpin_user_page(aibv_page);
 out:
+       kvm_s390_gisc_unregister(kvm, fib->fmt0.isc);
        return rc;
 }