From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796316548; b=opbUY6j7nO9826jtaKzPXKfCnqK2QQStZoDKHmqs9M8BcoEgaBF/nbZRr+jglciLo1CZ QKpQtttztqdXUSa1cKYFdzpYObnV9AVeHSmIFEm88A2XI9fJ0vv8A6ZymXhUgIdG/GgWN VV3+m5La3xHFzlHyK5Zu2kwbKS4n7MX5OFGKrcIzGoWu661TRpLw1WD0ctJmY+k9tp3Gy 0E3OFuR+JdELw+ipDEsZjGaL/0ttUrI1VnGNd2UuOHy4G9tRQf15iD/KPVHz6vsbWsrok njcpom9mcQC8mrH5sw4fsvm69KLJwqIq57iRhFbIg7miF2qUs+AF5e/LYZ40PEjbXDg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796316548; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=3b3oSKfWV2aUAQEIVb2Skh6e3O5YVJOoeJt/19Ridhc=; b=ozYUSpZz7LpTc0QkkDcvpjNfFmTZv0vTETGyswy4Y6gKQbsmCjjhTRF/lNjBunEMnhTC 3jaDlo7TGpfVOasN9tcL76/s0QyknXrU956yw46O8PnP+2ED7XcW8o7nbD0Rg5OLT9Xbv s8Liy6YHLiCtpzvc04H2Rux49c1+jN2rbNB9KeG23Qr+z6EQoJmFmP/137QF8Xc1KZVBP X1cUYXqXw7g8uTU9n6ICHk3NiZh9ta2RtSBntpF/AWE5u95NdcIgbNaPIkjeGpKmwqfy+ JBFm67ZEWph1I8i3uUmNJl1N6ZrTxlWf2yzykxe7+C2YC0r7/mr0tOfGr6R2DkMzilw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="bgIjOk/1"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2451C606A32D; Thu, 3 Dec 2026 16:49:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bgIjOk/1 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF6891F00893; Thu, 3 Dec 2026 16:49:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796316548; bh=3b3oSKfWV2aUAQEIVb2Skh6e3O5YVJOoeJt/19Ridhc=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=bgIjOk/1mRn0Vs2xk8qY8HHKpt+9BCsxs05ZKNK5OL3cUTiMk9QXs4eR3ZDCKcia3 UAFx7dzBQ/XIRzTLCs3OyadV2ZWicMJvznG5aZNdyGPkFLbU9W+rVhJ3HlTzQHJtFt wQfXrR4UjAOasLEKghVZrCOtZyiuhBaf8hQlbS3ptt7Ti4Px4HBiCK06JI2jlY5E7G PaI0wVyV7w9OV5h6ldp9ZUClTVZhFAtKhqqBgkT6DZmXuaRmlqrBKCoKTkbT5A79xP BgGS5WpO4X09wVYTkoLFyh6lQQg1M+aMfBZlyhHaK5fxsKmdppiqcQkc5WA6hOktAF 353s0KSYC+GvA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 02/12] KVM: s390: Fix potential leak in kvm_s390_get_io_int() Reply-To: sashiko-reviews@lists.linux.dev To: "Claudio Imbrenda" , kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, "Heiko Carstens" , "Vasily Gorbik" , "Alexander Gordeev" , "Christian Borntraeger" In-Reply-To: <20261203161527.188235-3-imbrenda@linux.ibm.com> References: <20261203161527.188235-1-imbrenda@linux.ibm.com> <20261203161527.188235-3-imbrenda@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 16:49:07 +0000 X-Mailing-List: linux-s390@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] KVM: s390: missing vCPU wakeup after gisa_set_ipm_gisc() rollback -- commit f5328eb608a4958f3ba6e17facc3c8bfabc5afa0 Author: Claudio Imbrenda KVM: s390: Fix potential leak in kvm_s390_get_io_int() This commit handles kvm_s390_reinject_io_int() failure in kvm_s390_get_io_int() by freeing tmp_inti, restoring the GISA IPM bit, and returning the lower-priority classic interrupt instead of leaking it. > diff --git a/arch/s390/kvm/s390/interrupt.c b/arch/s390/kvm/s390/interrup= t.c > index 31a6074feffcb..8612d2e96205d 100644 > --- a/arch/s390/kvm/s390/interrupt.c > +++ b/arch/s390/kvm/s390/interrupt.c > @@ -1775,8 +1775,21 @@ struct kvm_s390_interrupt_info *kvm_s390_get_io_in= t(struct kvm *kvm, > if (tmp_inti) { > tmp_inti->type =3D KVM_S390_INT_IO(1, 0, 0, 0); > tmp_inti->io.io_int_word =3D isc_to_int_word(isc); > - if (inti) > - kvm_s390_reinject_io_int(kvm, inti); > + if (inti && kvm_s390_reinject_io_int(kvm, inti)) { > + /* > + * The maximum number of pending interrupts is so > + * high that this is impossible in practice during > + * normal guest operation. > + * If this happens anyway, deliver the lower > + * priority interrupt, instead of discarding it. It > + * is still technically a violation of the > + * architecture, but it's not as bad as dropping an > + * interrupt entirely. > + */ > + kfree(tmp_inti); > + gisa_set_ipm_gisc(gi->origin, isc); > + goto out; > + } [Severity: Medium] Can this rollback strand the GISA adapter interrupt without waking an idle vCPU? get_top_gisa_isc() clears bit isc in gisa->ipm before the sleepable kzalloc_obj() and kvm_s390_reinject_io_int() calls. While that bit is cleared, another vCPU can enter enabled wait and halt: CPU0 CPU1 kvm_s390_get_io_int() get_top_gisa_isc() gisa_tac_ipm_gisc(..., isc) kzalloc_obj(...) kvm_s390_handle_wait() gisa_get_ipm_or_restore_iam() /* observes IPM =3D=3D 0 */ kvm_vcpu_halt() kvm_s390_reinject_io_int() -> -EBUSY gisa_set_ipm_gisc(..., isc) <-- no wakeup or timer restart A software set_bit_inv() to gisa->ipm does not place the GISA on the GIB alert list or raise a host GAL interrupt. Unlike __inject_io(), which pairs gisa_set_ipm_gisc() with __floating_irq_kick() in __inject_vm(), this rollback neither kicks idle vCPUs nor restarts gi->timer. If gisa_vcpu_kicker() also fired during the cleared window and stopped gi->timer, the restored interrupt stays pending while eligible vCPUs remain halted until an unrelated wakeup or new hardware GIB alert arrives. The existing gisa_set_ipm_gisc() rollback paths in kvm_s390_get_io_int() have the same gap. Calling __floating_irq_kick() or restarting gi->timer after restoring the IPM bit would prevent the lost wakeup. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203161527.1882= 35-1-imbrenda@linux.ibm.com?part=3D2