From mboxrd@z Thu Jan 1 00:00:00 1970 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 621FE1A4F2D for ; Wed, 26 Feb 2025 01:58:53 +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=1740535133; cv=none; b=k0OZsFP3d2RPF+PL8QKYfKkhgwaaQJBjfpK+70PX7iVeMHV2g8wrahUVisB9DfEQtMFyUQCoHOoqmjpzqcJ6jTq2NhnU1ntAemm4aWclQekvrAvKZn6mnDh6WhJJkiC6Y6G19lIGqmREY7bFDXclLMphft1UNXDIiiwtoERCt98= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740535133; c=relaxed/simple; bh=HQhSqdFMvURl8dIJyyWhucXFBtF1Dd/hCGRD/CMTu1k=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=VM3vdvC/r4t0/bthJoh40WMfunlFJfD/AmJrGspo0UNiKOgXfGi1mD0QqUQdPQoOQl9CGvu0YrImW6aTeS7dCW+7mrAwCXEx4MA51K0Yvnlr/G+uvqTnZxnbikqSSE9xzj7z1rhXnRK+IApueuPfgBufhNSrH9k5CsOmJ/ALK04= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jA6wAFLI; 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="jA6wAFLI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 394D3C4CEDD; Wed, 26 Feb 2025 01:58:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740535133; bh=HQhSqdFMvURl8dIJyyWhucXFBtF1Dd/hCGRD/CMTu1k=; h=From:To:Cc:Subject:Date:Reply-to:From; b=jA6wAFLIxGVl8u7PNkSn/oyYEQb3fQaDvNXcfDeSnDtaTTtH73qucOUv0Fp6O7oYT BoSieN1sW8CHUvyV3RrDFX/2LBUCRlbFOXa91nnBUDAye707IFw4VbD85s4Ua9Avl6 280DVNPFqkWWGZ5MGOZDfHwk1J6tvRs+ztS5cUOg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49118: scsi: hisi_sas: Free irq vectors in order for v3 HW Date: Wed, 26 Feb 2025 02:55:23 +0100 Message-ID: <2025022603-CVE-2022-49118-e2fa@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=2821; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=HQhSqdFMvURl8dIJyyWhucXFBtF1Dd/hCGRD/CMTu1k=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7SqznH1mcyVBw+3Blx7M/RQKhDI3XJyy4umvDoYWOK iHV6pwqHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjAR4aMMCw4/Y/3GkXd9qpLs K9YHTxYJPatgusUwT/N6wvbS2F1bH+0RN5x+ZfLpkFcLBQA= 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: hisi_sas: Free irq vectors in order for v3 HW If the driver probe fails to request the channel IRQ or fatal IRQ, the driver will free the IRQ vectors before freeing the IRQs in free_irq(), and this will cause a kernel BUG like this: ------------[ cut here ]------------ kernel BUG at drivers/pci/msi.c:369! Internal error: Oops - BUG: 0 [#1] PREEMPT SMP Call trace: free_msi_irqs+0x118/0x13c pci_disable_msi+0xfc/0x120 pci_free_irq_vectors+0x24/0x3c hisi_sas_v3_probe+0x360/0x9d0 [hisi_sas_v3_hw] local_pci_probe+0x44/0xb0 work_for_cpu_fn+0x20/0x34 process_one_work+0x1d0/0x340 worker_thread+0x2e0/0x460 kthread+0x180/0x190 ret_from_fork+0x10/0x20 ---[ end trace b88990335b610c11 ]--- So we use devm_add_action() to control the order in which we free the vectors. The Linux kernel CVE team has assigned CVE-2022-49118 to this issue. Affected and fixed versions =========================== Fixed in 5.10.111 with commit 224903cc60d045576393c3b16907742f23e6c740 Fixed in 5.15.34 with commit f05a0d8de2ea49af36821a20b0b501e20ced937e Fixed in 5.16.20 with commit 8b6eab9d683bae7f88dc894b8c851f866032301c Fixed in 5.17.3 with commit b4cc04fa8f1fc3816c8494d77abab3f72b9d2292 Fixed in 5.18 with commit 554fb72ee34f4732c7f694f56c3c6e67790352a0 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-49118 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/hisi_sas/hisi_sas_v3_hw.c 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/224903cc60d045576393c3b16907742f23e6c740 https://git.kernel.org/stable/c/f05a0d8de2ea49af36821a20b0b501e20ced937e https://git.kernel.org/stable/c/8b6eab9d683bae7f88dc894b8c851f866032301c https://git.kernel.org/stable/c/b4cc04fa8f1fc3816c8494d77abab3f72b9d2292 https://git.kernel.org/stable/c/554fb72ee34f4732c7f694f56c3c6e67790352a0