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 4E45B12D76F for ; Fri, 24 May 2024 15:13: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=1716563601; cv=none; b=j+xhfGNF2KiXsfEbl5ooQ49Pjeoo2eH+mVAcssa3qJm5iTqi+W24dTflZUW6kfi7bP9b2zeST1ewU78yebxColbHJxY77ffx+DsGjMJli7NcZ55L2ov7iViHlNr3yeIf7/lLdAHrTrwN3ErTCuoC4gOdj3qmksy3BqACNW3vtbg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716563601; c=relaxed/simple; bh=+5I6b3y9wE/GAZv1MqjeBnx0ejL2TEU86UGWWFIjY2A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=iuNLWpbAxDGkEE0qDx+RDE5zaotm0949zEkwX1dsMSfvvER2xFkgnBAQEula+MaotxisUBV4VDK0DiC3dqlvndgNpfCgM2IFy20ZApE754/BE3A0CC51ib3oBiYbM1Fr9eJz9gcZTsOBy4strMczNcYKlHey8tcr3cSFMWqG2Oo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hAvEvOZ9; 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="hAvEvOZ9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CDA9BC2BBFC; Fri, 24 May 2024 15:13:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716563601; bh=+5I6b3y9wE/GAZv1MqjeBnx0ejL2TEU86UGWWFIjY2A=; h=From:To:Cc:Subject:Date:Reply-to:From; b=hAvEvOZ9SgGuR8PIFTcw3znIVlpxkVnA2rIaAn79q12Ba2vHQoO7bhw8PcnNdarRe FCbrjydXnN8AnCGhXTCP6g1ShV4ATW3jFy6DhvA3I7+Tfxxeby2VONAN67EW28EfTN cwrUPpw7sv7dhn5wfjtqzl70K1Z3wO85iz3NVUP8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47562: ice: fix vsi->txq_map sizing Date: Fri, 24 May 2024 17:12:54 +0200 Message-ID: <2024052451-CVE-2021-47562-52ec@gregkh> X-Mailer: git-send-email 2.45.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=4980; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=+5I6b3y9wE/GAZv1MqjeBnx0ejL2TEU86UGWWFIjY2A=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkB64r979TWt+2cVXR90jGZvQd/P2C/c/7oIv0790xPm F/laPw4sSOWhUGQiUFWTJHlyzaeo/srDil6GdqehpnDygQyhIGLUwAmom/FML/m8dMvGfrn9JwZ xC5pnrKe6z2leh/DPMOLM470PBXsk/zvURWdaJd0YdmRjQA= 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: ice: fix vsi->txq_map sizing The approach of having XDP queue per CPU regardless of user's setting exposed a hidden bug that could occur in case when Rx queue count differ from Tx queue count. Currently vsi->txq_map's size is equal to the doubled vsi->alloc_txq, which is not correct due to the fact that XDP rings were previously based on the Rx queue count. Below splat can be seen when ethtool -L is used and XDP rings are configured: [ 682.875339] BUG: kernel NULL pointer dereference, address: 000000000000000f [ 682.883403] #PF: supervisor read access in kernel mode [ 682.889345] #PF: error_code(0x0000) - not-present page [ 682.895289] PGD 0 P4D 0 [ 682.898218] Oops: 0000 [#1] PREEMPT SMP PTI [ 682.903055] CPU: 42 PID: 2878 Comm: ethtool Tainted: G OE 5.15.0-rc5+ #1 [ 682.912214] Hardware name: Intel Corp. GRANTLEY/GRANTLEY, BIOS GRRFCRB1.86B.0276.D07.1605190235 05/19/2016 [ 682.923380] RIP: 0010:devres_remove+0x44/0x130 [ 682.928527] Code: 49 89 f4 55 48 89 fd 4c 89 ff 53 48 83 ec 10 e8 92 b9 49 00 48 8b 9d a8 02 00 00 48 8d 8d a0 02 00 00 49 89 c2 48 39 cb 74 0f <4c> 3b 63 10 74 25 48 8b 5b 08 48 39 cb 75 f1 4c 89 ff 4c 89 d6 e8 [ 682.950237] RSP: 0018:ffffc90006a679f0 EFLAGS: 00010002 [ 682.956285] RAX: 0000000000000286 RBX: ffffffffffffffff RCX: ffff88908343a370 [ 682.964538] RDX: 0000000000000001 RSI: ffffffff81690d60 RDI: 0000000000000000 [ 682.972789] RBP: ffff88908343a0d0 R08: 0000000000000000 R09: 0000000000000000 [ 682.981040] R10: 0000000000000286 R11: 3fffffffffffffff R12: ffffffff81690d60 [ 682.989282] R13: ffffffff81690a00 R14: ffff8890819807a8 R15: ffff88908343a36c [ 682.997535] FS: 00007f08c7bfa740(0000) GS:ffff88a03fd00000(0000) knlGS:0000000000000000 [ 683.006910] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 683.013557] CR2: 000000000000000f CR3: 0000001080a66003 CR4: 00000000003706e0 [ 683.021819] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 683.030075] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 683.038336] Call Trace: [ 683.041167] devm_kfree+0x33/0x50 [ 683.045004] ice_vsi_free_arrays+0x5e/0xc0 [ice] [ 683.050380] ice_vsi_rebuild+0x4c8/0x750 [ice] [ 683.055543] ice_vsi_recfg_qs+0x9a/0x110 [ice] [ 683.060697] ice_set_channels+0x14f/0x290 [ice] [ 683.065962] ethnl_set_channels+0x333/0x3f0 [ 683.070807] genl_family_rcv_msg_doit+0xea/0x150 [ 683.076152] genl_rcv_msg+0xde/0x1d0 [ 683.080289] ? channels_prepare_data+0x60/0x60 [ 683.085432] ? genl_get_cmd+0xd0/0xd0 [ 683.089667] netlink_rcv_skb+0x50/0xf0 [ 683.094006] genl_rcv+0x24/0x40 [ 683.097638] netlink_unicast+0x239/0x340 [ 683.102177] netlink_sendmsg+0x22e/0x470 [ 683.106717] sock_sendmsg+0x5e/0x60 [ 683.110756] __sys_sendto+0xee/0x150 [ 683.114894] ? handle_mm_fault+0xd0/0x2a0 [ 683.119535] ? do_user_addr_fault+0x1f3/0x690 [ 683.134173] __x64_sys_sendto+0x25/0x30 [ 683.148231] do_syscall_64+0x3b/0xc0 [ 683.161992] entry_SYSCALL_64_after_hwframe+0x44/0xae Fix this by taking into account the value that num_possible_cpus() yields in addition to vsi->alloc_txq instead of doubling the latter. The Linux kernel CVE team has assigned CVE-2021-47562 to this issue. Affected and fixed versions =========================== Issue introduced in 5.5 with commit efc2214b6047 and fixed in 5.10.83 with commit 1eb5395add78 Issue introduced in 5.5 with commit efc2214b6047 and fixed in 5.15.6 with commit 992ba40a6763 Issue introduced in 5.5 with commit efc2214b6047 and fixed in 5.16 with commit 792b2086584f 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-2021-47562 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/intel/ice/ice_lib.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/1eb5395add786613c7c5579d3947aa0b8f0ec241 https://git.kernel.org/stable/c/992ba40a67638dfe2772b84dfc8168dc328d5c4c https://git.kernel.org/stable/c/792b2086584f25d84081a526beee80d103c2a913