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 5E258331AE9 for ; Wed, 17 Sep 2025 14:58:12 +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=1758121092; cv=none; b=F50T/ngoR7eREMLHG+EV9wqKiwvinu5txf8DlfB6zbRqZaWFbYBh9pCsvNL/xZmV3jPlNUTlhDjJ5TCiDA0VtrCYBHzvf9hqMZQrTU59KFvpF1QH2FYlh2Hjcyd2EYAInx7lFAWQFY+2FFA/H8irnhSvKY8gNOc+vHUFddXSKGM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758121092; c=relaxed/simple; bh=w84S53Veqxy7tlC3NS8QueIGt5FceZgk8HiFn8E0EGI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=DqCJhqmiwfKeEIRc6249OTTNozszcYlot14J7t0bWhqO+CmZzbhpCpHJ17135c65CqOA9brNXvi8J1oTDn9rXzRHU4pWOhJJJrFiizGzMyn6435mtWjD8BduwUNX6CxzOGuPij0F9gFD8zWHsJTTdt5HOfTGW32nsynZSlly8ys= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=aXqaGqbf; 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="aXqaGqbf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D3BBC4CEE7; Wed, 17 Sep 2025 14:58:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1758121091; bh=w84S53Veqxy7tlC3NS8QueIGt5FceZgk8HiFn8E0EGI=; h=From:To:Cc:Subject:Date:Reply-to:From; b=aXqaGqbfw3IBWif25e9xdZbuJrjXvUq2Z2vjZneMGhbvS55NmsIyE/400Sz7b3CAe Mk0z554HH3lgwiJoiqIwTwdOmaY7hvj1SPMsEZHm60P1kNOAEwTXGzIjwRdYdho2Lr VRNPJUE3cETiKTMBTADHlkQ9Ea/objQOdIKYugnU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53347: net/mlx5: Handle pairing of E-switch via uplink un/load APIs Date: Wed, 17 Sep 2025 16:56:46 +0200 Message-ID: <2025091719-CVE-2023-53347-ed20@gregkh> X-Mailer: git-send-email 2.51.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=4997; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=ukq8h78nvfGwDCqYUdqQnEGF7pCQTiS2iQO7OlwqJhg=; b=owGbwMvMwCRo6H6F97bub03G02pJDBmnzgirrmz5tJST58Z9mUyOP1qbd7cxv43f+PXY5r6ns zJWdb1r7YhlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJ6OxnmMMr+/V91nefuedm TQvpCuLItvxxfCPDgrVSwfP639ucS9l166P2GoZFJ3xYdAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: net/mlx5: Handle pairing of E-switch via uplink un/load APIs In case user switch a device from switchdev mode to legacy mode, mlx5 first unpair the E-switch and afterwards unload the uplink vport. >From the other hand, in case user remove or reload a device, mlx5 first unload the uplink vport and afterwards unpair the E-switch. The latter is causing a bug[1], hence, handle pairing of E-switch as part of uplink un/load APIs. [1] In case VF_LAG is used, every tc fdb flow is duplicated to the peer esw. However, the original esw keeps a pointer to this duplicated flow, not the peer esw. e.g.: if user create tc fdb flow over esw0, the flow is duplicated over esw1, in FW/HW, but in SW, esw0 keeps a pointer to the duplicated flow. During module unload while a peer tc fdb flow is still offloaded, in case the first device to be removed is the peer device (esw1 in the example above), the peer net-dev is destroyed, and so the mlx5e_priv is memset to 0. Afterwards, the peer device is trying to unpair himself from the original device (esw0 in the example above). Unpair API invoke the original device to clear peer flow from its eswitch (esw0), but the peer flow, which is stored over the original eswitch (esw0), is trying to use the peer mlx5e_priv, which is memset to 0 and result in bellow kernel-oops. [ 157.964081 ] BUG: unable to handle page fault for address: 000000000002ce60 [ 157.964662 ] #PF: supervisor read access in kernel mode [ 157.965123 ] #PF: error_code(0x0000) - not-present page [ 157.965582 ] PGD 0 P4D 0 [ 157.965866 ] Oops: 0000 [#1] SMP [ 157.967670 ] RIP: 0010:mlx5e_tc_del_fdb_flow+0x48/0x460 [mlx5_core] [ 157.976164 ] Call Trace: [ 157.976437 ] [ 157.976690 ] __mlx5e_tc_del_fdb_peer_flow+0xe6/0x100 [mlx5_core] [ 157.977230 ] mlx5e_tc_clean_fdb_peer_flows+0x67/0x90 [mlx5_core] [ 157.977767 ] mlx5_esw_offloads_unpair+0x2d/0x1e0 [mlx5_core] [ 157.984653 ] mlx5_esw_offloads_devcom_event+0xbf/0x130 [mlx5_core] [ 157.985212 ] mlx5_devcom_send_event+0xa3/0xb0 [mlx5_core] [ 157.985714 ] esw_offloads_disable+0x5a/0x110 [mlx5_core] [ 157.986209 ] mlx5_eswitch_disable_locked+0x152/0x170 [mlx5_core] [ 157.986757 ] mlx5_eswitch_disable+0x51/0x80 [mlx5_core] [ 157.987248 ] mlx5_unload+0x2a/0xb0 [mlx5_core] [ 157.987678 ] mlx5_uninit_one+0x5f/0xd0 [mlx5_core] [ 157.988127 ] remove_one+0x64/0xe0 [mlx5_core] [ 157.988549 ] pci_device_remove+0x31/0xa0 [ 157.988933 ] device_release_driver_internal+0x18f/0x1f0 [ 157.989402 ] driver_detach+0x3f/0x80 [ 157.989754 ] bus_remove_driver+0x70/0xf0 [ 157.990129 ] pci_unregister_driver+0x34/0x90 [ 157.990537 ] mlx5_cleanup+0xc/0x1c [mlx5_core] [ 157.990972 ] __x64_sys_delete_module+0x15a/0x250 [ 157.991398 ] ? exit_to_user_mode_prepare+0xea/0x110 [ 157.991840 ] do_syscall_64+0x3d/0x90 [ 157.992198 ] entry_SYSCALL_64_after_hwframe+0x46/0xb0 The Linux kernel CVE team has assigned CVE-2023-53347 to this issue. Affected and fixed versions =========================== Issue introduced in 5.0 with commit 04de7dda7394fa9c2b0fc9cec65661d9b4f0d04d and fixed in 6.1.31 with commit b17294e7aa8c39dbb9c3e28e2d1983c88b94b387 Issue introduced in 5.0 with commit 04de7dda7394fa9c2b0fc9cec65661d9b4f0d04d and fixed in 6.3.5 with commit 10cbfecc0f99f579fb170feee866c9efaab7ee47 Issue introduced in 5.0 with commit 04de7dda7394fa9c2b0fc9cec65661d9b4f0d04d and fixed in 6.4 with commit 2be5bd42a5bba1a05daedc86cf0e248210009669 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-2023-53347 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/mellanox/mlx5/core/en_tc.c drivers/net/ethernet/mellanox/mlx5/core/eswitch.h drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.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/b17294e7aa8c39dbb9c3e28e2d1983c88b94b387 https://git.kernel.org/stable/c/10cbfecc0f99f579fb170feee866c9efaab7ee47 https://git.kernel.org/stable/c/2be5bd42a5bba1a05daedc86cf0e248210009669