Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 13FE921C16E for ; Wed, 26 Feb 2025 02:27:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740536860; cv=none; b=nhgT+qVagt2EC3ZcqFzUSm4cSwp9mLHeMrPXjJhLpJNrpi66Kcdhrg8LdW8AUeWh4ozCuWiAWUKg6G6achbrWddateINrOKP0WmRQ+ctX9E+hDx5+/AdBYhtGkiJnhBEDshFxIwaeuIT9EuKylS3rGOYV/vN9sto/hF6UrPJeWk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740536860; c=relaxed/simple; bh=ytKyv+6is9n69BZhGbZU6BDg06JBjJ+qCuXwpsspR0Q=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=d4LwWLiqxh8sLtdoGkPMW7M+S9whcALqPOu0LrvykJcpmbLyuvUksGRpsw6I6OcwrFUzSYSO7JNydJ6Fu6eoJ9KKeScRhksocZjpYE9gDhzH4RobmtY9IIao6XioxbsRK10H+5/HhabcpaAXQIUN9Pl4Qxtm8QUlD3EHzPkloHI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=OFouriTd; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="OFouriTd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDB63C4CEE6; Wed, 26 Feb 2025 02:27:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740536860; bh=ytKyv+6is9n69BZhGbZU6BDg06JBjJ+qCuXwpsspR0Q=; h=From:To:Cc:Subject:Date:Reply-to:From; b=OFouriTdKNbIoFZc22oedaXDgaM4s2wN2BkUZ3gZM8ICgWA1biYAqccvNlqGgc/j1 2nW0XsndqbRLCn/mXF8pfZxk7OYh4ZzsfBVn5RM8usVsTv8PJ9wl/rxrmvjsettVr8 1TgE13wKZZErQirSIa3Y+PwR8u7tCPSRCQL17vC8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49703: scsi: ibmvfc: Store vhost pointer during subcrq allocation Date: Wed, 26 Feb 2025 03:24:26 +0100 Message-ID: <2025022629-CVE-2022-49703-9539@gregkh> X-Mailer: git-send-email 2.48.1 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=4270; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=ytKyv+6is9n69BZhGbZU6BDg06JBjJ+qCuXwpsspR0Q=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7qp6eL/0ieWrKxb+C0ur9My/M2Jz8oO/R8QNe00JvF qTV871K6ohlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJvGRmmJ8VpvGP6eSxjeH/ WTS1WlvC09m35DLMZikrX6p54tvS6Rs5PHd/V7953W/nLQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: scsi: ibmvfc: Store vhost pointer during subcrq allocation Currently the back pointer from a queue to the vhost adapter isn't set until after subcrq interrupt registration. The value is available when a queue is first allocated and can/should be also set for primary and async queues as well as subcrqs. This fixes a crash observed during kexec/kdump on Power 9 with legacy XICS interrupt controller where a pending subcrq interrupt from the previous kernel can be replayed immediately upon IRQ registration resulting in dereference of a garbage backpointer in ibmvfc_interrupt_scsi(). Kernel attempted to read user page (58) - exploit attempt? (uid: 0) BUG: Kernel NULL pointer dereference on read at 0x00000058 Faulting instruction address: 0xc008000003216a08 Oops: Kernel access of bad area, sig: 11 [#1] ... NIP [c008000003216a08] ibmvfc_interrupt_scsi+0x40/0xb0 [ibmvfc] LR [c0000000082079e8] __handle_irq_event_percpu+0x98/0x270 Call Trace: [c000000047fa3d80] [c0000000123e6180] 0xc0000000123e6180 (unreliable) [c000000047fa3df0] [c0000000082079e8] __handle_irq_event_percpu+0x98/0x270 [c000000047fa3ea0] [c000000008207d18] handle_irq_event+0x98/0x188 [c000000047fa3ef0] [c00000000820f564] handle_fasteoi_irq+0xc4/0x310 [c000000047fa3f40] [c000000008205c60] generic_handle_irq+0x50/0x80 [c000000047fa3f60] [c000000008015c40] __do_irq+0x70/0x1a0 [c000000047fa3f90] [c000000008016d7c] __do_IRQ+0x9c/0x130 [c000000014622f60] [0000000020000000] 0x20000000 [c000000014622ff0] [c000000008016e50] do_IRQ+0x40/0xa0 [c000000014623020] [c000000008017044] replay_soft_interrupts+0x194/0x2f0 [c000000014623210] [c0000000080172a8] arch_local_irq_restore+0x108/0x170 [c000000014623240] [c000000008eb1008] _raw_spin_unlock_irqrestore+0x58/0xb0 [c000000014623270] [c00000000820b12c] __setup_irq+0x49c/0x9f0 [c000000014623310] [c00000000820b7c0] request_threaded_irq+0x140/0x230 [c000000014623380] [c008000003212a50] ibmvfc_register_scsi_channel+0x1e8/0x2f0 [ibmvfc] [c000000014623450] [c008000003213d1c] ibmvfc_init_sub_crqs+0xc4/0x1f0 [ibmvfc] [c0000000146234d0] [c0080000032145a8] ibmvfc_reset_crq+0x150/0x210 [ibmvfc] [c000000014623550] [c0080000032147c8] ibmvfc_init_crq+0x160/0x280 [ibmvfc] [c0000000146235f0] [c00800000321a9cc] ibmvfc_probe+0x2a4/0x530 [ibmvfc] The Linux kernel CVE team has assigned CVE-2022-49703 to this issue. Affected and fixed versions =========================== Issue introduced in 5.12 with commit 3034ebe26389740bb6b4a463e05afb51dc93c336 and fixed in 5.15.51 with commit 8540f66196ca35b7b5e902932571c18b9fde0cd1 Issue introduced in 5.12 with commit 3034ebe26389740bb6b4a463e05afb51dc93c336 and fixed in 5.18.8 with commit 6d38e3b614ded59da8b95377a98df969a5a5627a Issue introduced in 5.12 with commit 3034ebe26389740bb6b4a463e05afb51dc93c336 and fixed in 5.19 with commit aeaadcde1a60138bceb65de3cdaeec78170b4459 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2022-49703 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/scsi/ibmvscsi/ibmvfc.c drivers/scsi/ibmvscsi/ibmvfc.h Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/8540f66196ca35b7b5e902932571c18b9fde0cd1 https://git.kernel.org/stable/c/6d38e3b614ded59da8b95377a98df969a5a5627a https://git.kernel.org/stable/c/aeaadcde1a60138bceb65de3cdaeec78170b4459