Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 EE49839A060 for ; Fri, 26 Jun 2026 19:42:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782502961; cv=none; b=toaWiuRhVjNh8bUd350WgF6QUZZPbChzV6DYPA2bqy+jNhR2ufLZY7h0duN19Cn6UD7OJyfKxO235/QhcmRIolDWADZt3ZTpPyuPNMJ2jBrfEMkki66mJhgFKIXXmnAiYDHEEJElrI85hOcOGimpZZvWo/PxFnkxJt9n8CWb59s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782502961; c=relaxed/simple; bh=bgIQK38P81u4tYjgEWL1hgL3hvvJ4hbDgLFizBPl4jI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IHtHK2i+IySCiTMuYYWZUtakJC/BOw5522uqWfRlgFt/8u/xg1nCJsWH/ogA1fbxLG7NM8xLS2lzUMBQLgIpdUYGp5WaRW/yk6grhxjtIa8Q4vwfBM5urnoVwsVTaSgPAsJ3vAScsDB1X4GfNXCDpoxcGUzU1JRiOLxhCVxPrm0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0f3D0rzk; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="0f3D0rzk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDDBF1F000E9; Fri, 26 Jun 2026 19:42:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1782502959; bh=HKLMyjyi8ScO0dv+vN1hr6KIAqLBsNc61LI1y/iM6aA=; h=From:To:Cc:Subject:Date:Reply-To; b=0f3D0rzkqvC1DZ7ZJ0dMs0sk3At+kOco+nIKyZvPR3+NbEjFKw+pdN9w0L8qVwnhM 9B//7aKRfegDFmoK0CUqM1UhXqJlfuKnpFyR2C1+l6g3M/+g/8mGDhsxVWijRjOitW crAX3z8za/a8Zupfx4jMcSlUgMbPtWzMcyqYV060= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-53300: net: enetc: fix NTMP DMA use-after-free issue Date: Fri, 26 Jun 2026 20:40:33 +0100 Message-ID: <2026062618-CVE-2026-53300-0fc9@gregkh> X-Mailer: git-send-email 2.54.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=4275; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=mL7BUG+Nzzp/6/BV9b8sNOPwgHaaP/LBm2h7AcbWIh0=; b=owGbwMvMwCRo6H6F97bub03G02pJDFl2Vxc9es45y+/YeSlmUVaPD2ktJ6c67LT7YuXR/2niy m8ers/ZO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiv24yzHe7pJPZ/IXjXf8r 3cmtKU5PtJ23L2VYcMRUt8xJ6dThW/xl864dCX3/csrukwA= 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: enetc: fix NTMP DMA use-after-free issue The AI-generated review reported a potential DMA use-after-free issue [1]. If netc_xmit_ntmp_cmd() times out and returns an error, the pending command is not explicitly aborted, while ntmp_free_data_mem() unconditionally frees the DMA buffer. If the buffer has already been reallocated elsewhere, this may lead to silent memory corruption. Because the hardware eventually processes the pending command and perform a DMA write of the response to the physical address of the freed buffer. To resolve this issue, this patch does the following modifications: 1. Convert cbdr->ring_lock from a spinlock to a mutex The lock was originally a spinlock in case NTMP operations might be invoked from atomic context. After downstream support for all NTMP tables, no such usage has materialized. A mutex lock is now required because the driver now needs to reclaim used BDs and release associated DMA memory within the lock's context, while dma_free_coherent() might sleep. 2. Introduce software command BD (struct netc_swcbd) The hardware write-back overwrites the addr and len fields of the BD, so the driver cannot rely on the hardware BD to free the associated DMA memory. The driver now maintains a software shadow BD storing the DMA buffer pointer, DMA address, and size. And netc_xmit_ntmp_cmd() only reclaims older BDs when the number of used BDs reaches NETC_CBDR_CLEAN_WORK (16). The software BD enables correct DMA memory release. With this, struct ntmp_dma_buf and ntmp_free_data_mem() are no longer needed and are removed. 3. Require callers to hold ring_lock across netc_xmit_ntmp_cmd() netc_xmit_ntmp_cmd() releases the ring_lock before the caller finishes consuming the response. At this point, if a concurrent thread submits a new command, it may trigger ntmp_clean_cbdr() and free the DMA buffer while it is still in use. Move ring_lock ownership to the caller to ensure the response buffer cannot be reclaimed prematurely. So the helpers ntmp_select_and_lock_cbdr() and ntmp_unlock_cbdr() are added. These changes eliminate the DMA use-after-free condition and ensure safe and consistent BD reclamation and DMA buffer lifecycle management. The Linux kernel CVE team has assigned CVE-2026-53300 to this issue. Affected and fixed versions =========================== Issue introduced in 6.16 with commit 4701073c3debd16d7f534f3eb808bd9b50601c0c and fixed in 6.18.33 with commit 37c8933064be714ee672b0a0523c2fd045b73b3d Issue introduced in 6.16 with commit 4701073c3debd16d7f534f3eb808bd9b50601c0c and fixed in 7.0.10 with commit 655d9ce9b1d3db0aa5271acb5e5101c66bd0d58b Issue introduced in 6.16 with commit 4701073c3debd16d7f534f3eb808bd9b50601c0c and fixed in 7.1 with commit 3cade698881eb238f88cbbfec82acc2110440a3f 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-2026-53300 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/freescale/enetc/ntmp.c drivers/net/ethernet/freescale/enetc/ntmp_private.h include/linux/fsl/ntmp.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/37c8933064be714ee672b0a0523c2fd045b73b3d https://git.kernel.org/stable/c/655d9ce9b1d3db0aa5271acb5e5101c66bd0d58b https://git.kernel.org/stable/c/3cade698881eb238f88cbbfec82acc2110440a3f