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 9869F2C68E for ; Wed, 28 Feb 2024 08:18:19 +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=1709108299; cv=none; b=rvcrfd0Q2WJrZeE+OmcjY8L6iC9imQPns4ERybzkfgUwa9PvXmglhSgAkWp1Wngh2wUh6+nC08yHNvnBmVfCG7lUQJRhgzRFwM8vDUTT9ArUaGYbTwO9miBZY3LD2w8EX3Iq4t8X9Xf5Ez5IynYGON9E+pbzOeBa96e4gynpjvw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709108299; c=relaxed/simple; bh=D/kw2QakOxRTlmaq37llTcmC249Jtc6QmM42uJ3C0iw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=BqaHLZ1Y7HIvyZwi844Yqbvsu1BUiKOKmcC/vYNvt7CuRnSl2xlEmCyDONxOXO2Ac9yMyKn9XSVccviN4sTxevTT3vO6cHKFa2RLrz/Fg3LuzkQcV5pntZfJxoDy3KjuaS7VWvC9vFrCqH+1n/qI8bAMw2podUJekPYNh4NFe3U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wKUVWNY1; 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="wKUVWNY1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2861AC433C7; Wed, 28 Feb 2024 08:18:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1709108299; bh=D/kw2QakOxRTlmaq37llTcmC249Jtc6QmM42uJ3C0iw=; h=From:To:Cc:Subject:Date:Reply-to:From; b=wKUVWNY1tCtQ8j4uuJtC1pI1thOLXbmblM1CktAp0Jh1DY+BL1kwXVCMo+k1wz9xX K/yYCnsKl3rKzSKexvjKh43cBkT5qM/s0jnL5JORvG26puA9+CVG0csYO6mUysh6Wv Kka2QAeZlJ4QhUSKcbY0DyX+ZfnhM9zRwcwFEvhc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: gregkh@kernel.org Subject: CVE-2021-47015: bnxt_en: Fix RX consumer index logic in the error path. Date: Wed, 28 Feb 2024 09:15:05 +0100 Message-ID: <2024022832-CVE-2021-47015-c2ae@gregkh> X-Mailer: git-send-email 2.44.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=3821; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=xSDw3DtoIOEQPYND0gXufDMX0+2J1V8sR74y059P5sI=; b=owGbwMvMwCRo6H6F97bub03G02pJDKn3Xmf81vdeZjbfLPHc+n2ns7Y6OArcspx4R7RpV9C7K 3f9bxfZd8SyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBElv1nmO+2qu5rfQODZ7ai 562lskVvvSZWOjIsONLzM3TK17McPj3X9WR2G5XtvSqzBwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: gregkh@kernel.org Description =========== In the Linux kernel, the following vulnerability has been resolved: bnxt_en: Fix RX consumer index logic in the error path. In bnxt_rx_pkt(), the RX buffers are expected to complete in order. If the RX consumer index indicates an out of order buffer completion, it means we are hitting a hardware bug and the driver will abort all remaining RX packets and reset the RX ring. The RX consumer index that we pass to bnxt_discard_rx() is not correct. We should be passing the current index (tmp_raw_cons) instead of the old index (raw_cons). This bug can cause us to be at the wrong index when trying to abort the next RX packet. It can crash like this: #0 [ffff9bbcdf5c39a8] machine_kexec at ffffffff9b05e007 #1 [ffff9bbcdf5c3a00] __crash_kexec at ffffffff9b111232 #2 [ffff9bbcdf5c3ad0] panic at ffffffff9b07d61e #3 [ffff9bbcdf5c3b50] oops_end at ffffffff9b030978 #4 [ffff9bbcdf5c3b78] no_context at ffffffff9b06aaf0 #5 [ffff9bbcdf5c3bd8] __bad_area_nosemaphore at ffffffff9b06ae2e #6 [ffff9bbcdf5c3c28] bad_area_nosemaphore at ffffffff9b06af24 #7 [ffff9bbcdf5c3c38] __do_page_fault at ffffffff9b06b67e #8 [ffff9bbcdf5c3cb0] do_page_fault at ffffffff9b06bb12 #9 [ffff9bbcdf5c3ce0] page_fault at ffffffff9bc015c5 [exception RIP: bnxt_rx_pkt+237] RIP: ffffffffc0259cdd RSP: ffff9bbcdf5c3d98 RFLAGS: 00010213 RAX: 000000005dd8097f RBX: ffff9ba4cb11b7e0 RCX: ffffa923cf6e9000 RDX: 0000000000000fff RSI: 0000000000000627 RDI: 0000000000001000 RBP: ffff9bbcdf5c3e60 R8: 0000000000420003 R9: 000000000000020d R10: ffffa923cf6ec138 R11: ffff9bbcdf5c3e83 R12: ffff9ba4d6f928c0 R13: ffff9ba4cac28080 R14: ffff9ba4cb11b7f0 R15: ffff9ba4d5a30000 ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018 The Linux kernel CVE team has assigned CVE-2021-47015 to this issue. Affected and fixed versions =========================== Issue introduced in 5.1 with commit a1b0e4e684e9 and fixed in 5.4.119 with commit b1523e4ba293 Issue introduced in 5.1 with commit a1b0e4e684e9 and fixed in 5.10.37 with commit 4fcaad2b7dac Issue introduced in 5.1 with commit a1b0e4e684e9 and fixed in 5.11.21 with commit e187ef83c04a Issue introduced in 5.1 with commit a1b0e4e684e9 and fixed in 5.12.4 with commit 3fbc5bc651d6 Issue introduced in 5.1 with commit a1b0e4e684e9 and fixed in 5.13 with commit bbd6f0a94813 Please see https://www.kernel.org or 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-2021-47015 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/b1523e4ba293b2a32d9fabaf70c1dcaa6e3e2847 https://git.kernel.org/stable/c/4fcaad2b7dac3f16704f8118c7e481024ddbd3ed https://git.kernel.org/stable/c/e187ef83c04a5d23e68d39cfdff1a1931e29890c https://git.kernel.org/stable/c/3fbc5bc651d688fbea2a59cdc91520a2f5334d0a https://git.kernel.org/stable/c/bbd6f0a948139970f4a615dff189d9a503681a39