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 8F0871487D5 for ; Mon, 26 Aug 2024 10:24:21 +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=1724667861; cv=none; b=QnZru+py2yLX/8FqR78SNcge+T+vWvuxp8mYrjHW2WEDYIdu5v6Xz0OxBrYYVpJ2HmG2jr7kF25QhIWKyzXN2iTLmZH0RygLig1+HIColPY9Gq2gBdklEJja3FyfDUYaJZYWARr/AVb1c8YXYSwxBctDpVGToJD8T+X2NW/NHiM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724667861; c=relaxed/simple; bh=d4ejofxMQ9xZuVoZmrNIRHn+CNDMI5tk42mAMahTM3Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NYK+VsNJs9DeRlBZWYUJ1zaB1LdXyUB5DqF20fc5Sqkqa8iRYW44t8NNsfAcn+Xlexqi+c3dvvSio7OdpFR9buJAcvc467j+MFheXoH8g47je2A3Oo7ikyI3s8nntT8wL0IjWzMj6fy03S++QrUkTNe171IppPaKpJcxtRtdgS0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BK/Rjs7B; 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="BK/Rjs7B" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17702C8B4D6; Mon, 26 Aug 2024 10:24:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1724667861; bh=d4ejofxMQ9xZuVoZmrNIRHn+CNDMI5tk42mAMahTM3Y=; h=From:To:Cc:Subject:Date:Reply-to:From; b=BK/Rjs7B9xkV3q2Ekd9I2mGAJtQmysIv59oNKMebecyPstmNaP5i4Jn0nVNjHrQEn +8KEmi0VDRIVTwqtb8vbTS+AVlHxKO1pWKqRHTtD/p2S8NwbpwRnhnWWxvFtbETmuc jxCKGBgPnIwMaFe3Ps2YuYG9R6dudsMR+mT8Fi0o= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-44933: bnxt_en : Fix memory out-of-bounds in bnxt_fill_hw_rss_tbl() Date: Mon, 26 Aug 2024 12:17:25 +0200 Message-ID: <2024082639-CVE-2024-44933-222c@gregkh> X-Mailer: git-send-email 2.46.0 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=3435; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=d4ejofxMQ9xZuVoZmrNIRHn+CNDMI5tk42mAMahTM3Y=; b=owGbwMvMwCRo6H6F97bub03G02pJDGlnwlzezk8sDirfxvh9buOOHHbZmO07K+0XlparuMSWc WR/Ore+I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACZSu5NhwX7mGeZVp48v3/R9 Q1vFVu9fv7dk1jHMj2KtjhW62zdjz/kzdjZ1ceY5/hIXAA== 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: bnxt_en : Fix memory out-of-bounds in bnxt_fill_hw_rss_tbl() A recent commit has modified the code in __bnxt_reserve_rings() to set the default RSS indirection table to default only when the number of RX rings is changing. While this works for newer firmware that requires RX ring reservations, it causes the regression on older firmware not requiring RX ring resrvations (BNXT_NEW_RM() returns false). With older firmware, RX ring reservations are not required and so hw_resc->resv_rx_rings is not always set to the proper value. The comparison: if (old_rx_rings != bp->hw_resc.resv_rx_rings) in __bnxt_reserve_rings() may be false even when the RX rings are changing. This will cause __bnxt_reserve_rings() to skip setting the default RSS indirection table to default to match the current number of RX rings. This may later cause bnxt_fill_hw_rss_tbl() to use an out-of-range index. We already have bnxt_check_rss_tbl_no_rmgr() to handle exactly this scenario. We just need to move it up in bnxt_need_reserve_rings() to be called unconditionally when using older firmware. Without the fix, if the TX rings are changing, we'll skip the bnxt_check_rss_tbl_no_rmgr() call and __bnxt_reserve_rings() may also skip the bnxt_set_dflt_rss_indir_tbl() call for the reason explained in the last paragraph. Without setting the default RSS indirection table to default, it causes the regression: BUG: KASAN: slab-out-of-bounds in __bnxt_hwrm_vnic_set_rss+0xb79/0xe40 Read of size 2 at addr ffff8881c5809618 by task ethtool/31525 Call Trace: __bnxt_hwrm_vnic_set_rss+0xb79/0xe40 bnxt_hwrm_vnic_rss_cfg_p5+0xf7/0x460 __bnxt_setup_vnic_p5+0x12e/0x270 __bnxt_open_nic+0x2262/0x2f30 bnxt_open_nic+0x5d/0xf0 ethnl_set_channels+0x5d4/0xb30 ethnl_default_set_doit+0x2f1/0x620 The Linux kernel CVE team has assigned CVE-2024-44933 to this issue. Affected and fixed versions =========================== Issue introduced in 6.10.4 with commit bc57f879a420 and fixed in 6.10.5 with commit abd573e9ad2b Issue introduced in 6.11-rc2 with commit 98ba1d931f61 and fixed in 6.11-rc3 with commit da03f5d1b2c3 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-2024-44933 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/net/ethernet/broadcom/bnxt/bnxt.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/abd573e9ad2ba64eaa6418a5f4eec819de28f205 https://git.kernel.org/stable/c/da03f5d1b2c319a2b74fe76edeadcd8fa5f44376