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 6C9B72D8784 for ; Fri, 25 Jul 2025 12:55:37 +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=1753448137; cv=none; b=AzznTHBw9dEXzWeHJT+0F/UmZFL1XeRyzYrI6jSX7O9gCrf+K8W6TwDutR39XZbyL/DXbJWbf3V3w6PLPaHL7AgZcyqcJgXzkLEPdSyv3G+1vB/jNfDwiGc8sGO434Hv7LmbSwkxuDXVGLhTFFdeXGkUg9Xr5Gu0S+dBE8qIJNQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753448137; c=relaxed/simple; bh=VbkC0zh00lHoihZuDUzWur0vIlCe+cLT9IuASALDtnI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=V9r4b3aNGduqlaSG1yU5ZPu5hcVhqkXK+iCbom8og3pDFSTVLZuzPCBVpupcrQBZQ/vdW2FXfNEMu39TyoH1P46A3TD72tpPIPgiQGl2qNymM/20QjM3xso6IskNl4AzRAuJkxPhr50Ndw29BySIvm7N6/ztGA/T9r9wvd1ew9E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=xwnbBjBr; 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="xwnbBjBr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70CDEC4CEE7; Fri, 25 Jul 2025 12:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1753448136; bh=VbkC0zh00lHoihZuDUzWur0vIlCe+cLT9IuASALDtnI=; h=From:To:Cc:Subject:Date:Reply-to:From; b=xwnbBjBrndMkzj1tgpOUYsogOrlrR7oTBSX+hyQGjdSF9cikSQdxnQhcW3EHhD3q7 5UTSy1X84gLAmoKE1583kgFsil3xQrt1AHJmY+zjViE94ywJ1bQ+mK0ozW8WlHjtGg tXc68A1X7s0LHx7t/yoCgQSviL/4Hbcg8tqz2vtE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38384: mtd: spinand: fix memory leak of ECC engine conf Date: Fri, 25 Jul 2025 14:55:15 +0200 Message-ID: <2025072506-CVE-2025-38384-391e@gregkh> X-Mailer: git-send-email 2.50.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=3172; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=UJVnYpEVXsJ9BkZLK8P7n5JcKO4baD4zkTjqdIRyc7k=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnNdavs3LfM9wtKWmTJXx9ypHtLnECu2MOpl+XznDQ2P T+z+ej+jlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZhI8wGGBRsc5kdPm6fgL/Gw 6dS25hsxSipi/QwL+qU1WTNL41ep3rz2ceeHCzWW3dJvAQ== 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: mtd: spinand: fix memory leak of ECC engine conf Memory allocated for the ECC engine conf is not released during spinand cleanup. Below kmemleak trace is seen for this memory leak: unreferenced object 0xffffff80064f00e0 (size 8): comm "swapper/0", pid 1, jiffies 4294937458 hex dump (first 8 bytes): 00 00 00 00 00 00 00 00 ........ backtrace (crc 0): kmemleak_alloc+0x30/0x40 __kmalloc_cache_noprof+0x208/0x3c0 spinand_ondie_ecc_init_ctx+0x114/0x200 nand_ecc_init_ctx+0x70/0xa8 nanddev_ecc_engine_init+0xec/0x27c spinand_probe+0xa2c/0x1620 spi_mem_probe+0x130/0x21c spi_probe+0xf0/0x170 really_probe+0x17c/0x6e8 __driver_probe_device+0x17c/0x21c driver_probe_device+0x58/0x180 __device_attach_driver+0x15c/0x1f8 bus_for_each_drv+0xec/0x150 __device_attach+0x188/0x24c device_initial_probe+0x10/0x20 bus_probe_device+0x11c/0x160 Fix the leak by calling nanddev_ecc_engine_cleanup() inside spinand_cleanup(). The Linux kernel CVE team has assigned CVE-2025-38384 to this issue. Affected and fixed versions =========================== Fixed in 5.15.187 with commit 68d3417305ee100dcad90fd6e5846b22497aa394 Fixed in 6.1.144 with commit f99408670407abb6493780e38cb4ece3fbb52cfc Fixed in 6.6.97 with commit d5c1e3f32902ab518519d05515ee6030fd6c59ae Fixed in 6.12.37 with commit c40b207cafd006c610832ba52a81cedee77adcb9 Fixed in 6.15.6 with commit 93147abf80a831dd3b5660b3309b4f09546073b2 Fixed in 6.16-rc3 with commit 6463cbe08b0cbf9bba8763306764f5fd643023e1 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-38384 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/mtd/nand/spi/core.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/68d3417305ee100dcad90fd6e5846b22497aa394 https://git.kernel.org/stable/c/f99408670407abb6493780e38cb4ece3fbb52cfc https://git.kernel.org/stable/c/d5c1e3f32902ab518519d05515ee6030fd6c59ae https://git.kernel.org/stable/c/c40b207cafd006c610832ba52a81cedee77adcb9 https://git.kernel.org/stable/c/93147abf80a831dd3b5660b3309b4f09546073b2 https://git.kernel.org/stable/c/6463cbe08b0cbf9bba8763306764f5fd643023e1