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 9F0C6257435 for ; Fri, 2 May 2025 15:59:53 +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=1746201593; cv=none; b=A7ugpTL33kJPTyP1tcWkJEnT+ATEyNd7ccpFJDts606XdLpmjo7TrIcGxHi9PlwraBbKO3otsuSHkcQvrCU0l2FQwbWdiwg+/UFB+ahD33vCj2LZ1PDzbE6kgnI7Iz2hjTQA/4MxGzpGpnl42/YFL6haSB9v9aiMr7ZGZ4KGFo0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746201593; c=relaxed/simple; bh=DXv3QAkMuxuz6FrwzYyJbvH60/P89eOwFy3dmGanYzg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=dLpgdZj1qZPTDepYMZ3FC5CfLpyXRHn+FC8sHKReZDA/9vb2RxzDnTG5pKkFBy+xiK/5YMo2iuiplhrs344WNIJm5twrG6nKiewgZ6tvGX0la97eWkGGyKlzQIkGP+gG5nw318mQyJDbJ67XRGm8O8yJRFhYa10+hSGSoa/jqOs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=LSjIhekY; 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="LSjIhekY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26104C4CEE4; Fri, 2 May 2025 15:59:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746201593; bh=DXv3QAkMuxuz6FrwzYyJbvH60/P89eOwFy3dmGanYzg=; h=From:To:Cc:Subject:Date:Reply-to:From; b=LSjIhekYKvy6KGj/1JOwt4CH2GSlNTr/sT8hZwdZuoibTll8I3LW4/KkNsxk3wnEi R0XN/Xv9+av+y9FOo4z/W5OA3a/+xynutr/nedPXPfh7WOZkjTmD3wd0rAKC6FhxsS h5oYmoNGYs56mZVHa9ICA9yCIhUJkFCq5YOf5VAc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53105: net/mlx5e: Fix cleanup null-ptr deref on encap lock Date: Fri, 2 May 2025 17:56:10 +0200 Message-ID: <2025050225-CVE-2023-53105-7c94@gregkh> X-Mailer: git-send-email 2.49.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=3660; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=odHy9P5gJhHqJ57W9bIo86nmVqQJxLp0GNBSkr1ocJk=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkir97yVATduX/owdypM88deipRMS+cz9hG2Kv0EusaD d1VlgVXO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiSX8Y5lfN/fHj5E2eBRp5 t4VM9hXNeH71HxfDgkW7jvLaTTVZW/tj8t93Tm158pvqSwA= 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/mlx5e: Fix cleanup null-ptr deref on encap lock During module is unloaded while a peer tc flow is still offloaded, first the peer uplink rep profile is changed to a nic profile, and so neigh encap lock is destroyed. Next during unload, the VF reps netdevs are unregistered which causes the original non-peer tc flow to be deleted, which deletes the peer flow. The peer flow deletion detaches the encap entry and try to take the already destroyed encap lock, causing the below trace. Fix this by clearing peer flows during tc eswitch cleanup (mlx5e_tc_esw_cleanup()). Relevant trace: [ 4316.837128] BUG: kernel NULL pointer dereference, address: 00000000000001d8 [ 4316.842239] RIP: 0010:__mutex_lock+0xb5/0xc40 [ 4316.851897] Call Trace: [ 4316.852481] [ 4316.857214] mlx5e_rep_neigh_entry_release+0x93/0x790 [mlx5_core] [ 4316.858258] mlx5e_rep_encap_entry_detach+0xa7/0xf0 [mlx5_core] [ 4316.859134] mlx5e_encap_dealloc+0xa3/0xf0 [mlx5_core] [ 4316.859867] clean_encap_dests.part.0+0x5c/0xe0 [mlx5_core] [ 4316.860605] mlx5e_tc_del_fdb_flow+0x32a/0x810 [mlx5_core] [ 4316.862609] __mlx5e_tc_del_fdb_peer_flow+0x1a2/0x250 [mlx5_core] [ 4316.863394] mlx5e_tc_del_flow+0x(/0x630 [mlx5_core] [ 4316.864090] mlx5e_flow_put+0x5f/0x100 [mlx5_core] [ 4316.864771] mlx5e_delete_flower+0x4de/0xa40 [mlx5_core] [ 4316.865486] tc_setup_cb_reoffload+0x20/0x80 [ 4316.865905] fl_reoffload+0x47c/0x510 [cls_flower] [ 4316.869181] tcf_block_playback_offloads+0x91/0x1d0 [ 4316.869649] tcf_block_unbind+0xe7/0x1b0 [ 4316.870049] tcf_block_offload_cmd.isra.0+0x1ee/0x270 [ 4316.879266] tcf_block_offload_unbind+0x61/0xa0 [ 4316.879711] __tcf_block_put+0xa4/0x310 The Linux kernel CVE team has assigned CVE-2023-53105 to this issue. Affected and fixed versions =========================== Issue introduced in 5.0 with commit 04de7dda7394fa9c2b0fc9cec65661d9b4f0d04d and fixed in 6.1.21 with commit b7350f8dbe0c2a1d4d3ad7c35b610abd3cb91750 Issue introduced in 5.0 with commit 04de7dda7394fa9c2b0fc9cec65661d9b4f0d04d and fixed in 6.2.8 with commit 01fdaea410787fe372daeaeda93a29ed0606d334 Issue introduced in 5.0 with commit 04de7dda7394fa9c2b0fc9cec65661d9b4f0d04d and fixed in 6.3 with commit c9668f0b1d28570327dbba189f2c61f6f9e43ae7 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-53105 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 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/b7350f8dbe0c2a1d4d3ad7c35b610abd3cb91750 https://git.kernel.org/stable/c/01fdaea410787fe372daeaeda93a29ed0606d334 https://git.kernel.org/stable/c/c9668f0b1d28570327dbba189f2c61f6f9e43ae7