Re: [PATCH v2] KVM: s390: pci: Fix GISC refcount leak on AIF enable failure
From: Claudio Imbrenda
Date: Wed Jun 24 2026 - 04:43:11 EST
On Wed, 24 Jun 2026 14:19:10 +0800
Haoxiang Li <haoxiang_li2024@xxxxxxx> wrote:
> 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@xxxxxxxxxxxxxxx
> Signed-off-by: Haoxiang Li <haoxiang_li2024@xxxxxxx>
Acked-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx>
> ---
> Changes in v2:
> - Move unregister call after "out" label. Thanks, Matt!
> ---
> arch/s390/kvm/pci.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/s390/kvm/pci.c b/arch/s390/kvm/pci.c
> index 5b075c38998e..686113be0530 100644
> --- a/arch/s390/kvm/pci.c
> +++ b/arch/s390/kvm/pci.c
> @@ -328,6 +328,7 @@ static int kvm_s390_pci_aif_enable(struct zpci_dev *zdev, struct zpci_fib *fib,
> unpin1:
> unpin_user_page(aibv_page);
> out:
> + kvm_s390_gisc_unregister(kvm, fib->fmt0.isc);
> return rc;
> }
>