From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2312342EEDD; Mon, 17 Aug 2026 14:56:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786978600; cv=none; b=GbWLLU6nxr9+cmJvaZrJEm2jYqOhtTYzzcia2wz5G5voenzme8oZ+e81Cv2EjKWnqr2/5nWFpHNXFAQ2YJA2kh43Q+Wz1PzCM5RLeuAZroOiKMD74sTptJ5MpvQkZGmfMdiVwj9OCBCzPOEK/RdkHjfc6wrJo1ptxxDF6tuLW4U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786978600; c=relaxed/simple; bh=x49rD71/3viuVCxLhRA7ZbBYigZJeo+4h8gl6/FLQ+8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BhHW/Y6w186OYGVRo6X4Jacs4y/yF5nHzJWo6EC24EL5UJnCnXOaug7QZXEQsjlKQeSkfSI/JDLPVfOSc2ocvnDrWAxszyUepJQ00BWKoY9NRW1kOtB4gD23Hz827lDHa0tvNEtCsRKr9NWLR2VKBUj+WhU+7iAgiVnyfOaHzPQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1mdxri8W; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="1mdxri8W" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D7EA1F000E9; Mon, 17 Aug 2026 14:56:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1786978598; bh=9S1/VHeFcDMw+Nh5juW/IOuHxEosRc7J5Jfpcpyob0c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=1mdxri8W/4mMb5ygAT1vTij0LQkr2aS+G0pUq8qkzslMgzOUVAabXjwtSKPnRjWhB d34folWWBoXqfwsG7b4bcE39RtC5jLCw0AtACITdnZBOSKlDwYjNDoxHb8Q2vvu9NL Mn65OPFNBAjIBlSszDxKBejmq0mbIUp9hDnUyzd4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Matthew Rosato , Niklas Schnelle , Christian Borntraeger , Farhan Ali , Sasha Levin Subject: [PATCH 6.6 093/156] KVM: s390: pci: Fix aisb calculation Date: Mon, 17 Aug 2026 15:33:47 +0200 Message-ID: <20260817132538.259775045@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260817132534.666299318@linuxfoundation.org> References: <20260817132534.666299318@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Matthew Rosato [ Upstream commit 0cfe660559e857d7c00ab86c73e4510ce069086f ] The current implementation of aisb calculation will erroneously index via an unsigned long * as well as multiply by 8B for every 64-bits in the offset; only one or the other is required. This throws off aisb calculations once the number of devices exceeds 64, and can result in out-of-bounds access as well as failure to indicate summary bits associated with those devices in guests. Fix this by converting to a physical address before applying the offset, as is already done in arch/s390/pci/pci_irq.c. Fixes: 3c5a1b6f0a18 ("KVM: s390: pci: provide routines for enabling/disabling interrupt forwarding") Signed-off-by: Matthew Rosato Reviewed-by: Niklas Schnelle Signed-off-by: Christian Borntraeger [alifm@linux.ibm.com: Resolved merge conflict] Signed-off-by: Farhan Ali Signed-off-by: Sasha Levin --- arch/s390/kvm/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/kvm/pci.c b/arch/s390/kvm/pci.c index 61489016e4252..d9fcbf41025e0 100644 --- a/arch/s390/kvm/pci.c +++ b/arch/s390/kvm/pci.c @@ -167,7 +167,7 @@ static int kvm_zpci_set_airq(struct zpci_dev *zdev) fib.fmt0.noi = airq_iv_end(zdev->aibv); fib.fmt0.aibv = virt_to_phys(zdev->aibv->vector); fib.fmt0.aibvo = 0; - fib.fmt0.aisb = virt_to_phys(aift->sbv->vector + (zdev->aisb / 64) * 8); + fib.fmt0.aisb = virt_to_phys(aift->sbv->vector) + (zdev->aisb / 64) * 8; fib.fmt0.aisbo = zdev->aisb & 63; fib.gd = zdev->gisa; -- 2.53.0