From mboxrd@z Thu Jan 1 00:00:00 1970 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 30F3C1494A9 for ; Thu, 27 Feb 2025 02:13:27 +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=1740622408; cv=none; b=VVFI41jU9dMIlY6SDedpn4Ir/HPMHGJGpho+SU5Nu3knvei37iIVTXKMqUFdsTItmX1rUirhal17Evwq9bayR+CxOV8gf9y9O8ieHYTqDkVmBios8jT2IWaKB8W9R+/Fwa1SYqDNC5/4ug0xP22Nccm52eEMqrTJ51l+tKS2MKg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740622408; c=relaxed/simple; bh=1rzu/b+HIAOfyLOt+dWysa5xjAgbi089PLdEA95mfRI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=fhmuO7JPhnQIas13vfo7sQEmvb+5x92WJmAWc48q6O/cM4RJJwCHgfU9WCmPGzITVO4oeZi3cwdEMUqlpY4cHkyPqZ1EghQ3eJ23iZyHNKqaZ4r0h5ctpIxTbaLdaCUu7IU8C6armL7mw7NQifVxJxWg3iWcx4oknHNJhZSWZVI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=mWO+Ijfa; 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="mWO+Ijfa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FA3EC4CED6; Thu, 27 Feb 2025 02:13:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740622407; bh=1rzu/b+HIAOfyLOt+dWysa5xjAgbi089PLdEA95mfRI=; h=From:To:Cc:Subject:Date:Reply-to:From; b=mWO+Ijfa61K0Nq9tglUJMV76hx8enslM1sSpafArxKOE6kKIIGAmQs6mbJ+87yCiJ ZjZ+zyvT9llUJbRjJfOgpDxOsnXt+sw1oF3o/xhnlKtnAGhGuj2PI97PazXS2NQxKz HQtDjly+HnvaYWPgyV8APERegXOo/qyNX4Q2ca1o= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-21751: net/mlx5: HWS, change error flow on matcher disconnect Date: Wed, 26 Feb 2025 18:11:33 -0800 Message-ID: <2025022601-CVE-2025-21751-101c@gregkh> X-Mailer: git-send-email 2.48.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=2544; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=1rzu/b+HIAOfyLOt+dWysa5xjAgbi089PLdEA95mfRI=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7T257JLzpV+Nj3wOzLjHY3JsfruGwXcpV4Mv1dZWxO zpm3i152RHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATOTCfYb6r8Swbk2ZhBa8d k9J9zc7ss/CQk2aYK6B/ru6wWhP/4fKtDLtb7SSbex7VAQA= 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: net/mlx5: HWS, change error flow on matcher disconnect Currently, when firmware failure occurs during matcher disconnect flow, the error flow of the function reconnects the matcher back and returns an error, which continues running the calling function and eventually frees the matcher that is being disconnected. This leads to a case where we have a freed matcher on the matchers list, which in turn leads to use-after-free and eventual crash. This patch fixes that by not trying to reconnect the matcher back when some FW command fails during disconnect. Note that we're dealing here with FW error. We can't overcome this problem. This might lead to bad steering state (e.g. wrong connection between matchers), and will also lead to resource leakage, as it is the case with any other error handling during resource destruction. However, the goal here is to allow the driver to continue and not crash the machine with use-after-free error. The Linux kernel CVE team has assigned CVE-2025-21751 to this issue. Affected and fixed versions =========================== Fixed in 6.13.3 with commit 23a86c76a1a197e8fbbbd0ce3e826eb58c471624 Fixed in 6.14-rc1 with commit 1ce840c7a659aa53a31ef49f0271b4fd0dc10296 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-21751 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/steering/hws/matcher.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/23a86c76a1a197e8fbbbd0ce3e826eb58c471624 https://git.kernel.org/stable/c/1ce840c7a659aa53a31ef49f0271b4fd0dc10296