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 C56FB28DB7A for ; Wed, 9 Jul 2025 10:44:16 +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=1752057856; cv=none; b=A5ggm6Cxk0t3H/Aoo8CN/Nd3tB2ibKdxwSQZKo8ziMuM7z9q2iB2YAKOo1tnAE0X32nqRzS2AEvqAhCk6Nl4fE6kz4FDlyZVTmGKgj0bKW4lAx0d/PVYATUwfHwSD0ZnjeIKIbY3jjp32jVNx3XRUjL0Vg9CnJpvGEA8LF/9WCA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752057856; c=relaxed/simple; bh=JOMpuHDRoVM40muQpSdmD9gcqFty/N+IbotxH50532I=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XRwQfARMNA/6Ktb1Gw7CZ83XRvb/NgczvuBG1mPmmldBmyXOs+V4/3hKJSDJYaf5vYFBQ0ZTU6gd3DjnBbNc3Ie+Vp+rpGnPV9wddm3oW4RATc4r3RczJv/vmgyigKiNbxkPLLuKLfqBcCM1WDRqSieFr+b2ntSPgdBGqfLFeDc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=bJoNfdGb; 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="bJoNfdGb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F7FBC4CEEF; Wed, 9 Jul 2025 10:44:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1752057856; bh=JOMpuHDRoVM40muQpSdmD9gcqFty/N+IbotxH50532I=; h=From:To:Cc:Subject:Date:Reply-to:From; b=bJoNfdGbfzAAQHcVdYv+8LxXgE2g30uImxldi5tCvy0XKoVNWY2G830M31b7bBhgx 0MuP0hAvc1X0+CO7YrB8M3OuY/+EuhdRdshqE92x/kxxBUvF74SzFlh/bK6ehrnewS QaAFEF8yip9oYCz1ho+4BGw2YPeq+kbeaMGS7aSc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38258: mm/damon/sysfs-schemes: free old damon_sysfs_scheme_filter->memcg_path on write Date: Wed, 9 Jul 2025 12:42:50 +0200 Message-ID: <2025070936-CVE-2025-38258-4e00@gregkh> X-Mailer: git-send-email 2.50.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=2573; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=8Cabz2pd//EN8kwXRFDfJxsdkZKd9elM3Fu77nBgGSI=; b=owGbwMvMwCRo6H6F97bub03G02pJDBl57nPWiL56MdXQper7B/Mpn5s2/blhVKgneu7R1L97H 996tfP8xI5YFgZBJgZZMUWWL9t4ju6vOKToZWh7GmYOKxPIEAYuTgGYyMFchvnpqvxn7y3YsnHR 5w/fw9fv1vrssXEtw4K1Vxc9Lz7wm6M1eu2pw9d9T/N/5+gDAA== 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: mm/damon/sysfs-schemes: free old damon_sysfs_scheme_filter->memcg_path on write memcg_path_store() assigns a newly allocated memory buffer to filter->memcg_path, without deallocating the previously allocated and assigned memory buffer. As a result, users can leak kernel memory by continuously writing a data to memcg_path DAMOS sysfs file. Fix the leak by deallocating the previously set memory buffer. The Linux kernel CVE team has assigned CVE-2025-38258 to this issue. Affected and fixed versions =========================== Issue introduced in 6.3 with commit 7ee161f18b5da5170b5d6a51aace49d312099128 and fixed in 6.6.96 with commit 490a43d07f1663d827e802720d30cbc0494e4f81 Issue introduced in 6.3 with commit 7ee161f18b5da5170b5d6a51aace49d312099128 and fixed in 6.12.36 with commit c5d5b0047b0c0f304608f3824139f7bd34c48413 Issue introduced in 6.3 with commit 7ee161f18b5da5170b5d6a51aace49d312099128 and fixed in 6.15.5 with commit 4a158ac0538dd5695eeaa00aa0720d711f3e4ef1 Issue introduced in 6.3 with commit 7ee161f18b5da5170b5d6a51aace49d312099128 and fixed in 6.16-rc4 with commit 4f489fe6afb395dbc79840efa3c05440b760d883 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-38258 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: mm/damon/sysfs-schemes.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/490a43d07f1663d827e802720d30cbc0494e4f81 https://git.kernel.org/stable/c/c5d5b0047b0c0f304608f3824139f7bd34c48413 https://git.kernel.org/stable/c/4a158ac0538dd5695eeaa00aa0720d711f3e4ef1 https://git.kernel.org/stable/c/4f489fe6afb395dbc79840efa3c05440b760d883