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 17089315D39 for ; Wed, 15 Oct 2025 07:57:22 +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=1760515043; cv=none; b=jGhjaLLmXlpWzLkvsM5fMn5T7yRsioRCC5jkzTm9rutVpcMD+xTH6MZ7RETNj1ZJWpgoRv77OrFdmZiL5uxvx8hinpJW4J17ENPcmANLdhPCuF1eNresCYa9bk5dzRxCsQTz49XKpWfuETpw+YbwEZAQcOI/ChzmnfzkyuzalU0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760515043; c=relaxed/simple; bh=uQv0+2IW8W5awakLakOBV8IMkFgHXKEMAnAekSMFN+E=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=j83cjGX6HdtIcjK0r1IzXeKMXA10s7BxV2AE+xUwqlmwO/mrzIxN+9OYz54JKJNy0EM7zqH2MKvCS4YX9b7uODXMYo1wqdDNKr21Yykr8/6fdqE0bbQa/T55eV+MJ6EWBxO4B7xBw6KDWpLVbvkBa5WVToCBS1Gr4hn/eeoMLVY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PeMLw+Wn; 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="PeMLw+Wn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 774C7C4CEF9; Wed, 15 Oct 2025 07:57:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1760515042; bh=uQv0+2IW8W5awakLakOBV8IMkFgHXKEMAnAekSMFN+E=; h=From:To:Cc:Subject:Date:Reply-to:From; b=PeMLw+Wnu1bhj2ILWwB/b6rZB05dLK5hn1aP9n1qEMqRoK0YuUlGjfjswdl370HF5 SZekrrSaqGihhpRmCnMZT8UiyF4KkOIArEO2/Wsho3ZTp5UqhjgxazKM0N/HWKdJze UvKA7QBtp5pqE5nn1yZJqMrE0DB1xGx1WxfFnO6M= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-39979: net/mlx5: fs, fix UAF in flow counter release Date: Wed, 15 Oct 2025 09:57:07 +0200 Message-ID: <2025101559-CVE-2025-39979-f1e9@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=3302; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=m32Jgs/qz3mcUfs0XLdA91oFSe9nm4DFPxwqw50OUj4=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnvg0+rO7yZcSRgArvixj8ckyOjjvlHHmT/Ncmqabb3e Z8vFu43OmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAivRsZ5nCbvmIQu7+nW1bs UuNFgYBvzlMMtjDMr478opC76u13LVbDoPNnX8i3PP7iAwA= 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: fs, fix UAF in flow counter release Fix a kernel trace [1] caused by releasing an HWS action of a local flow counter in mlx5_cmd_hws_delete_fte(), where the HWS action refcount and mutex were not initialized and the counter struct could already be freed when deleting the rule. Fix it by adding the missing initializations and adding refcount for the local flow counter struct. [1] Kernel log: Call Trace: dump_stack_lvl+0x34/0x48 mlx5_fs_put_hws_action.part.0.cold+0x21/0x94 [mlx5_core] mlx5_fc_put_hws_action+0x96/0xad [mlx5_core] mlx5_fs_destroy_fs_actions+0x8b/0x152 [mlx5_core] mlx5_cmd_hws_delete_fte+0x5a/0xa0 [mlx5_core] del_hw_fte+0x1ce/0x260 [mlx5_core] mlx5_del_flow_rules+0x12d/0x240 [mlx5_core] ? ttwu_queue_wakelist+0xf4/0x110 mlx5_ib_destroy_flow+0x103/0x1b0 [mlx5_ib] uverbs_free_flow+0x20/0x50 [ib_uverbs] destroy_hw_idr_uobject+0x1b/0x50 [ib_uverbs] uverbs_destroy_uobject+0x34/0x1a0 [ib_uverbs] uobj_destroy+0x3c/0x80 [ib_uverbs] ib_uverbs_run_method+0x23e/0x360 [ib_uverbs] ? uverbs_finalize_object+0x60/0x60 [ib_uverbs] ib_uverbs_cmd_verbs+0x14f/0x2c0 [ib_uverbs] ? do_tty_write+0x1a9/0x270 ? file_tty_write.constprop.0+0x98/0xc0 ? new_sync_write+0xfc/0x190 ib_uverbs_ioctl+0xd7/0x160 [ib_uverbs] __x64_sys_ioctl+0x87/0xc0 do_syscall_64+0x59/0x90 The Linux kernel CVE team has assigned CVE-2025-39979 to this issue. Affected and fixed versions =========================== Issue introduced in 6.14 with commit b581f4266928d3b5d1bbe711e39623d9a1696091 and fixed in 6.16.10 with commit 3c77f6d244188c3fb11f6aec40bbfe884f1803b5 Issue introduced in 6.14 with commit b581f4266928d3b5d1bbe711e39623d9a1696091 and fixed in 6.17 with commit 6043819e707cefb1c9e59d6e431dcfa735c4f975 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-2025-39979 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/fs_core.c drivers/net/ethernet/mellanox/mlx5/core/fs_core.h drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws_pools.c include/linux/mlx5/fs.h 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/3c77f6d244188c3fb11f6aec40bbfe884f1803b5 https://git.kernel.org/stable/c/6043819e707cefb1c9e59d6e431dcfa735c4f975