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 DE5C123C8AE for ; Fri, 24 Apr 2026 14:48:02 +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=1777042082; cv=none; b=sigYcnbk6ulmM8z0N0p0ye7RjqBVIFBrWV81lt36cS98dMqT19ueb/m7CMmhZUhtiRaMKeb/xSD9s/Mwiprd+FM0RkqrTh2vv869lMjSA75fJ6nc1QS0Q57H2G4/O7CavuRTtd73FeqvPPUzOJicjdLbxU1t/QVrEP0bCIzmVOY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777042082; c=relaxed/simple; bh=CAxGQn8UQgIM3FtI8SVMta/59jQA+Fl9+8GIWY3dQj8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=dZklZK7Fr5szlvFuAGfvVewfqoQku5m67vjiadLPxTXJ/tBeVUaWYyEfd8nj/ER9ksRz88nJabBTWNGJvLv9mP6JjovWfNpc4/CiPDkPeRcen0NbxfxSjz2IRON4LxNrW2O+qsCv3yzBlMD2V4UngbjQzGlyJuSygDSnwnbvbZM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uz7YuzaD; 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="uz7YuzaD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45E45C19425; Fri, 24 Apr 2026 14:48:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777042082; bh=CAxGQn8UQgIM3FtI8SVMta/59jQA+Fl9+8GIWY3dQj8=; h=From:To:Cc:Subject:Date:Reply-To:From; b=uz7YuzaDV0Excu247WLIUe7iH0MZQ2VNpNC11kUHdMd1VZe7mMx/MTWFKgGaJtdon 5bROKnv5eFz17yBWs+hB/VkSWy6cuu+L8ctsbpyTMaJV9dqcXsmLSUwDicfcIG0NTs Tmn1r25lel4wW46evxhkVwSRrr0R+3QOaBipqaF8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-31652: mm/damon/stat: deallocate damon_call() failure leaking damon_ctx Date: Fri, 24 Apr 2026 16:46:14 +0200 Message-ID: <2026042400-CVE-2026-31652-e967@gregkh> X-Mailer: git-send-email 2.53.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=3140; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=ajAv8XMxSeHeRKB05YrEumGM4bOMTANsPXN0FpePJ90=; b=owGbwMvMwCRo6H6F97bub03G02pJDJmvmzSbHuU5bS1dFZ3FzzZh4ftlZ9Ycn6j23JBxk0Cd3 sqk/nmPO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAi6joMc/h3XV+Y6HxXiVf5 WZ9h15RX+s4P7zLMs/SfLW1g8lLQ5ehf+0Psy/WrZ9kaAgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: mm/damon/stat: deallocate damon_call() failure leaking damon_ctx damon_stat_start() always allocates the module's damon_ctx object (damon_stat_context). Meanwhile, if damon_call() in the function fails, the damon_ctx object is not deallocated. Hence, if the damon_call() is failed, and the user writes Y to “enabled” again, the previously allocated damon_ctx object is leaked. This cannot simply be fixed by deallocating the damon_ctx object when damon_call() fails. That's because damon_call() failure doesn't guarantee the kdamond main function, which accesses the damon_ctx object, is completely finished. In other words, if damon_stat_start() deallocates the damon_ctx object after damon_call() failure, the not-yet-terminated kdamond could access the freed memory (use-after-free). Fix the leak while avoiding the use-after-free by keeping returning damon_stat_start() without deallocating the damon_ctx object after damon_call() failure, but deallocating it when the function is invoked again and the kdamond is completely terminated. If the kdamond is not yet terminated, simply return -EAGAIN, as the kdamond will soon be terminated. The issue was discovered [1] by sashiko. The Linux kernel CVE team has assigned CVE-2026-31652 to this issue. Affected and fixed versions =========================== Issue introduced in 6.17 with commit 405f61996d9d2e9d497cd9f6b66f41dc28d3d1d8 and fixed in 6.18.23 with commit 447f8870b484f6596d7a7130e72bd0a3f1e037bb Issue introduced in 6.17 with commit 405f61996d9d2e9d497cd9f6b66f41dc28d3d1d8 and fixed in 6.19.13 with commit 16c92e9bf55fa049ddb5e894dc0623dacd46a620 Issue introduced in 6.17 with commit 405f61996d9d2e9d497cd9f6b66f41dc28d3d1d8 and fixed in 7.0 with commit 4c04c6b47c361612b1d70cec8f7a60b1482d1400 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-31652 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/stat.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/447f8870b484f6596d7a7130e72bd0a3f1e037bb https://git.kernel.org/stable/c/16c92e9bf55fa049ddb5e894dc0623dacd46a620 https://git.kernel.org/stable/c/4c04c6b47c361612b1d70cec8f7a60b1482d1400