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 E299B31AA94 for ; Wed, 24 Dec 2025 10:57:46 +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=1766573868; cv=none; b=qgFJXWx7uYzmHwSn9aZtqx20F51A0X7IjqeM38LkjGEOs+WHemIAq0EW5oamnROIsfBRam74G50UVljd+GtgwNCID2o5AdVEeALSRcvuFCOxdBCtMB19ZxZvIHjPX3dKu4V87VMa0VM6M1tdDpDAGlGlUHR/tMd9x1zv/TkFwbw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766573868; c=relaxed/simple; bh=+13V6ML1VMgXEqaxniZKx86Ddk5spE2yEDz9mG/OPx4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MEYys0ifTd2pW/DwXcHWRHKnjlRFh02TN+eiaJdXTnXeY61tsflmllsfZ/QWVkgdxdUyevnRvijd/7qVBUb5Z27Yqtj7Rhrlqm0cCBtgpUlgXbyUNmRb+QhsEoiWKv3FFCmyK2MKf7r6WaFrmYa52wUPhuUTtlNgHQXoPGfaiG8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Vhn79afC; 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="Vhn79afC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24474C4CEFB; Wed, 24 Dec 2025 10:57:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1766573866; bh=+13V6ML1VMgXEqaxniZKx86Ddk5spE2yEDz9mG/OPx4=; h=From:To:Cc:Subject:Date:Reply-To:From; b=Vhn79afC72OLfpgXJr/mLqIVQGNQLqq9kCFcSWVoAF7UIOTOR42A0qbRkUAfWaVzZ g5EKYgStWd9gbLqxG8m+tz1dCBFgFR649CChSTjc8CvklF1iDZoP35+9lqMhtkEvPj 4SfcRIlIufEVI5takRLX9gFEqgNR0MzTrQHRLV5E= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53999: net/mlx5e: TC, Fix internal port memory leak Date: Wed, 24 Dec 2025 11:56:43 +0100 Message-ID: <2025122426-CVE-2023-53999-57a4@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3754; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=t3mktU5UsHqrG9oT2VxWg4K1Xvk8/52bO5I9SBT7Gfo=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnex249uHw5dcv8ntvzp/TPWP5cPO8sc/L8yl8vN2neO fQlYYfBhY5YFgZBJgZZMUWWL9t4ju6vOKToZWh7GmYOKxPIEAYuTgGYyHEOhvlVbSEr/2b6MZQn sunnTlG3cw+1ZGWYZy4cbLDDSb07ecqJzOM2japaotcDAQ== 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: TC, Fix internal port memory leak The flow rule can be splited, and the extra post_act rules are added to post_act table. It's possible to trigger memleak when the rule forwards packets from internal port and over tunnel, in the case that, for example, CT 'new' state offload is allowed. As int_port object is assigned to the flow attribute of post_act rule, and its refcnt is incremented by mlx5e_tc_int_port_get(), but mlx5e_tc_int_port_put() is not called, the refcnt is never decremented, then int_port is never freed. The kmemleak reports the following error: unreferenced object 0xffff888128204b80 (size 64): comm "handler20", pid 50121, jiffies 4296973009 (age 642.932s) hex dump (first 32 bytes): 01 00 00 00 19 00 00 00 03 f0 00 00 04 00 00 00 ................ 98 77 67 41 81 88 ff ff 98 77 67 41 81 88 ff ff .wgA.....wgA.... backtrace: [<00000000e992680d>] kmalloc_trace+0x27/0x120 [<000000009e945a98>] mlx5e_tc_int_port_get+0x3f3/0xe20 [mlx5_core] [<0000000035a537f0>] mlx5e_tc_add_fdb_flow+0x473/0xcf0 [mlx5_core] [<0000000070c2cec6>] __mlx5e_add_fdb_flow+0x7cf/0xe90 [mlx5_core] [<000000005cc84048>] mlx5e_configure_flower+0xd40/0x4c40 [mlx5_core] [<000000004f8a2031>] mlx5e_rep_indr_offload.isra.0+0x10e/0x1c0 [mlx5_core] [<000000007df797dc>] mlx5e_rep_indr_setup_tc_cb+0x90/0x130 [mlx5_core] [<0000000016c15cc3>] tc_setup_cb_add+0x1cf/0x410 [<00000000a63305b4>] fl_hw_replace_filter+0x38f/0x670 [cls_flower] [<000000008bc9e77c>] fl_change+0x1fd5/0x4430 [cls_flower] [<00000000e7f766e4>] tc_new_tfilter+0x867/0x2010 [<00000000e101c0ef>] rtnetlink_rcv_msg+0x6fc/0x9f0 [<00000000e1111d44>] netlink_rcv_skb+0x12c/0x360 [<0000000082dd6c8b>] netlink_unicast+0x438/0x710 [<00000000fc568f70>] netlink_sendmsg+0x794/0xc50 [<0000000016e92590>] sock_sendmsg+0xc5/0x190 So fix this by moving int_port cleanup code to the flow attribute free helper, which is used by all the attribute free cases. The Linux kernel CVE team has assigned CVE-2023-53999 to this issue. Affected and fixed versions =========================== Issue introduced in 5.18 with commit 8300f225268be9ee2c0daf5a3f23929fcdcbf213 and fixed in 6.4.11 with commit bc1918bac0f30e3f551ef5649b53062917db55fa Issue introduced in 5.18 with commit 8300f225268be9ee2c0daf5a3f23929fcdcbf213 and fixed in 6.5 with commit ac5da544a3c2047cbfd715acd9cec8380d7fe5c6 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-53999 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/bc1918bac0f30e3f551ef5649b53062917db55fa https://git.kernel.org/stable/c/ac5da544a3c2047cbfd715acd9cec8380d7fe5c6