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 B36561AB37B for ; Thu, 20 Jun 2024 11:18:16 +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=1718882296; cv=none; b=cXzbdIw+Ou/TdPhIk1ZK2prgPiGKMBpaRxJJ64Ol74BMJ9qAMI5aws1ihxH8U+aBb1YuuZhq5a2snd3jkFCBZMuLRc98UtlIzs20GaYU4HZySvpEfH7XAFMEnBjHPPMtEKRLhlwtL64+Gjs7PkyEksVp8gJ3U96StmrFVIs24i8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718882296; c=relaxed/simple; bh=gSL3C31UoAzMH3zs+/NLVwcDLPc2A3AjfA3RYfKwTXU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=sI3rVdiizthCyroJ/FZfVzO39QuvnpXAS/3ZkHGfel9+5GcygwOs+75U4TLsEnaS+VDQBrm5Z2klj8/OvWRYd6otFtdPd0ZkYfGCeBK1YOYf8PMFwHDmNf2JJJvCBoO9R8mMFuIK8tF42piefF8q/BUjgx1dA3+6AGKFuw12KDc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=O3RZPdsx; 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="O3RZPdsx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB0E7C2BD10; Thu, 20 Jun 2024 11:18:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718882296; bh=gSL3C31UoAzMH3zs+/NLVwcDLPc2A3AjfA3RYfKwTXU=; h=From:To:Cc:Subject:Date:Reply-to:From; b=O3RZPdsxUISRXFG2FoKlnllyqjT3pQCySgxjXN5gOpWWP7iKstbOyY/L3RHKmV0mX F7j5ysFdjQ2x6t49nBjYwgTfeICqJY6s6qMyptsjimdTzeCeUsN54gGoDKYvWNpPNN mwYbwEu1LWs6ZApPpPgqEFV31v7EwU0cQi173osQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48728: IB/hfi1: Fix AIP early init panic Date: Thu, 20 Jun 2024 13:16:08 +0200 Message-ID: <2024062058-CVE-2022-48728-caf6@gregkh> X-Mailer: git-send-email 2.45.2 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=4745; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=gSL3C31UoAzMH3zs+/NLVwcDLPc2A3AjfA3RYfKwTXU=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkl/PmhvR7cpp+1VdpfbtlUqjHnwx7HOyX/mb3TJtVl+ V4M+p7dEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABMRlGFYsFFz/oo93WylZ7kU 3u5dMrfyoeEJNoYFmzreHly/JvDWrYPmOpXzS44+TDXcDwA= 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: IB/hfi1: Fix AIP early init panic An early failure in hfi1_ipoib_setup_rn() can lead to the following panic: BUG: unable to handle kernel NULL pointer dereference at 00000000000001b0 PGD 0 P4D 0 Oops: 0002 [#1] SMP NOPTI Workqueue: events work_for_cpu_fn RIP: 0010:try_to_grab_pending+0x2b/0x140 Code: 1f 44 00 00 41 55 41 54 55 48 89 d5 53 48 89 fb 9c 58 0f 1f 44 00 00 48 89 c2 fa 66 0f 1f 44 00 00 48 89 55 00 40 84 f6 75 77 48 0f ba 2b 00 72 09 31 c0 5b 5d 41 5c 41 5d c3 48 89 df e8 6c RSP: 0018:ffffb6b3cf7cfa48 EFLAGS: 00010046 RAX: 0000000000000246 RBX: 00000000000001b0 RCX: 0000000000000000 RDX: 0000000000000246 RSI: 0000000000000000 RDI: 00000000000001b0 RBP: ffffb6b3cf7cfa70 R08: 0000000000000f09 R09: 0000000000000001 R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000 R13: ffffb6b3cf7cfa90 R14: ffffffff9b2fbfc0 R15: ffff8a4fdf244690 FS: 0000000000000000(0000) GS:ffff8a527f400000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000001b0 CR3: 00000017e2410003 CR4: 00000000007706f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: __cancel_work_timer+0x42/0x190 ? dev_printk_emit+0x4e/0x70 iowait_cancel_work+0x15/0x30 [hfi1] hfi1_ipoib_txreq_deinit+0x5a/0x220 [hfi1] ? dev_err+0x6c/0x90 hfi1_ipoib_netdev_dtor+0x15/0x30 [hfi1] hfi1_ipoib_setup_rn+0x10e/0x150 [hfi1] rdma_init_netdev+0x5a/0x80 [ib_core] ? hfi1_ipoib_free_rdma_netdev+0x20/0x20 [hfi1] ipoib_intf_init+0x6c/0x350 [ib_ipoib] ipoib_intf_alloc+0x5c/0xc0 [ib_ipoib] ipoib_add_one+0xbe/0x300 [ib_ipoib] add_client_context+0x12c/0x1a0 [ib_core] enable_device_and_get+0xdc/0x1d0 [ib_core] ib_register_device+0x572/0x6b0 [ib_core] rvt_register_device+0x11b/0x220 [rdmavt] hfi1_register_ib_device+0x6b4/0x770 [hfi1] do_init_one.isra.20+0x3e3/0x680 [hfi1] local_pci_probe+0x41/0x90 work_for_cpu_fn+0x16/0x20 process_one_work+0x1a7/0x360 ? create_worker+0x1a0/0x1a0 worker_thread+0x1cf/0x390 ? create_worker+0x1a0/0x1a0 kthread+0x116/0x130 ? kthread_flush_work_fn+0x10/0x10 ret_from_fork+0x1f/0x40 The panic happens in hfi1_ipoib_txreq_deinit() because there is a NULL deref when hfi1_ipoib_netdev_dtor() is called in this error case. hfi1_ipoib_txreq_init() and hfi1_ipoib_rxq_init() are self unwinding so fix by adjusting the error paths accordingly. Other changes: - hfi1_ipoib_free_rdma_netdev() is deleted including the free_netdev() since the netdev core code deletes calls free_netdev() - The switch to the accelerated entrances is moved to the success path. The Linux kernel CVE team has assigned CVE-2022-48728 to this issue. Affected and fixed versions =========================== Issue introduced in 5.8 with commit d99dc602e2a5 and fixed in 5.10.99 with commit 4a9bd1e6780f Issue introduced in 5.8 with commit d99dc602e2a5 and fixed in 5.15.22 with commit a3dd4d2682f2 Issue introduced in 5.8 with commit d99dc602e2a5 and fixed in 5.16.8 with commit 1899c3cad265 Issue introduced in 5.8 with commit d99dc602e2a5 and fixed in 5.17 with commit 5f8f55b92edd 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-48728 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/infiniband/hw/hfi1/ipoib_main.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/4a9bd1e6780fc59f81466ec3489d5ad535a37190 https://git.kernel.org/stable/c/a3dd4d2682f2a796121609e5f3bbeb1243198c53 https://git.kernel.org/stable/c/1899c3cad265c4583658aed5293d02e8af84276b https://git.kernel.org/stable/c/5f8f55b92edd621f056bdf09e572092849fabd83