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 051461AAE2F for ; Thu, 20 Jun 2024 11:16:44 +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=1718882205; cv=none; b=rAyaqpIUB/ziRWZroBpjDOg2gbGakMbr1xOTQ3Pm+8wm4mY9tQkTT9nSnNR3ftu5vnu1+dUDfBqD4U08hPt/e3ojmNfkHD4m7z+zsLw7uLc3wwkG1GlvfxOcY1Vp30ANaZ+Q17/TAOmpOLBcpM7oNPta1D3Xf41x3ZMZ2UDRDf8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718882205; c=relaxed/simple; bh=oERIURI7y7cH6GmLNhxQUGOi4OwoQG8EUuqGDCwqhpM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=M42qX0dxdPbNqK0nCOpkrsKaxW2IJ9f7UutPqcIyfSGCeKKM1mw6huIOlPTB853oKPRK30tIxgztI+tRve6kZbcCKzCmI/8BOw5Cnz7voeX649oH7uD4Woq69sTVKM80pThF/foeecOlwq3kDU8tUz0rMkT/7nT1Ro/jglQ9Byc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Q9JLDHpV; 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="Q9JLDHpV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26859C32781; Thu, 20 Jun 2024 11:16:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718882204; bh=oERIURI7y7cH6GmLNhxQUGOi4OwoQG8EUuqGDCwqhpM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Q9JLDHpV0lkLf3fz4tbpkhywfPoG6FddrQBnccbrfVY6a56/VoHQlVmx4VyEGv8f9 T9L5Uj34G2CHZQd6V+P5Z3P4yhxllWBCBzWFL3XPnzxUyLJlCjx8QASz9esmWYDG2j xBeWw/NL81mmOjW8pv6TStOQ+DCbcb4KQMhxAngE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48729: IB/hfi1: Fix panic with larger ipoib send_queue_size Date: Thu, 20 Jun 2024 13:16:09 +0200 Message-ID: <2024062059-CVE-2022-48729-dc0b@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=3664; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=oERIURI7y7cH6GmLNhxQUGOi4OwoQG8EUuqGDCwqhpM=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkl/PnSNq+1iyzTpLZ8c3cSfi5sJvpNxeL/rB3M+x5vP xL9efGZjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjI8nsM84z/PjAJ5G30P/sw xG+OkNK0Q7EvzRjme83eWHjy8YQJudF2W+OaOayYLihzAQA= 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 panic with larger ipoib send_queue_size When the ipoib send_queue_size is increased from the default the following panic happens: RIP: 0010:hfi1_ipoib_drain_tx_ring+0x45/0xf0 [hfi1] Code: 31 e4 eb 0f 8b 85 c8 02 00 00 41 83 c4 01 44 39 e0 76 60 8b 8d cc 02 00 00 44 89 e3 be 01 00 00 00 d3 e3 48 03 9d c0 02 00 00 83 18 01 00 00 00 00 00 00 48 8b bb 30 01 00 00 e8 25 af a7 e0 RSP: 0018:ffffc9000798f4a0 EFLAGS: 00010286 RAX: 0000000000008000 RBX: ffffc9000aa0f000 RCX: 000000000000000f RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000 RBP: ffff88810ff08000 R08: ffff88889476d900 R09: 0000000000000101 R10: 0000000000000000 R11: ffffc90006590ff8 R12: 0000000000000200 R13: ffffc9000798fba8 R14: 0000000000000000 R15: 0000000000000001 FS: 00007fd0f79cc3c0(0000) GS:ffff88885fb00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffc9000aa0f118 CR3: 0000000889c84001 CR4: 00000000001706e0 Call Trace: hfi1_ipoib_napi_tx_disable+0x45/0x60 [hfi1] hfi1_ipoib_dev_stop+0x18/0x80 [hfi1] ipoib_ib_dev_stop+0x1d/0x40 [ib_ipoib] ipoib_stop+0x48/0xc0 [ib_ipoib] __dev_close_many+0x9e/0x110 __dev_change_flags+0xd9/0x210 dev_change_flags+0x21/0x60 do_setlink+0x31c/0x10f0 ? __nla_validate_parse+0x12d/0x1a0 ? __nla_parse+0x21/0x30 ? inet6_validate_link_af+0x5e/0xf0 ? cpumask_next+0x1f/0x20 ? __snmp6_fill_stats64.isra.53+0xbb/0x140 ? __nla_validate_parse+0x47/0x1a0 __rtnl_newlink+0x530/0x910 ? pskb_expand_head+0x73/0x300 ? __kmalloc_node_track_caller+0x109/0x280 ? __nla_put+0xc/0x20 ? cpumask_next_and+0x20/0x30 ? update_sd_lb_stats.constprop.144+0xd3/0x820 ? _raw_spin_unlock_irqrestore+0x25/0x37 ? __wake_up_common_lock+0x87/0xc0 ? kmem_cache_alloc_trace+0x3d/0x3d0 rtnl_newlink+0x43/0x60 The issue happens when the shift that should have been a function of the txq item size mistakenly used the ring size. Fix by using the item size. The Linux kernel CVE team has assigned CVE-2022-48729 to this issue. Affected and fixed versions =========================== Issue introduced in 5.16 with commit d47dfc2b00e6 and fixed in 5.16.8 with commit 1530d84fba1e Issue introduced in 5.16 with commit d47dfc2b00e6 and fixed in 5.17 with commit 8c83d39cc730 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-48729 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_tx.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/1530d84fba1e459ba55f46aa42649b88773210e7 https://git.kernel.org/stable/c/8c83d39cc730378bbac64d67a551897b203a606e