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 E8087405C32 for ; Wed, 27 May 2026 13:01:56 +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=1779886918; cv=none; b=AoHeKdWJNvKrUUEOabMTvOypDNMWdnDnj4K3ZnZhg7LwEG4UkCuApSH5JgvI0uWIKRdw1l7E/e6s5VmhZC8pw3rhH+Yk56a+l3tT20X7lbffEtUobG3eNlxlHJtLDlvhEIANBxsHp1nkH26DHpbSiC9I14wHo/+w7F+y4WK5z+E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779886918; c=relaxed/simple; bh=dCutFWqke/Zc7KT/ddb3T+HURosqVZYi4C+uwmJlJd0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=F66s2gmJ2xhJCydbqkHayMMZp494GrOR7ccviTzA/IwJvxkkBkmPVN58CnQ+TZtW4qMGTfCRdR0M8O1yHRFknQoCStaKxWyZ5AJ3tHobxfWc4Wsqzi9x/ZcKwCYAGhaEVJ0v4d9pe3Rw3QxWewN1BjC7xxToBAqbemhkWqb+4Hs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ebyZYXUO; 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="ebyZYXUO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F78B1F000E9; Wed, 27 May 2026 13:01:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779886916; bh=HOSombIeYU1Em2yHBpDGNWCE+VviEztSLxuWiG6oNIg=; h=From:To:Cc:Subject:Date:Reply-To; b=ebyZYXUOYcqpfMaRRav6NMI7NaEGDCAt/cHBmN+0o4q8LLGRgmGBdm7a1j1AmQESD xWjXORrIAObLLPMCtrV/o+mIxaeOjX1NuzhChwE2dR7A1duM1ER8CMV8uWxhXscu12 v3RcQNKTP/x/kcxFbToi+ZBXoldv5k9IBjDFZqFc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-46025: mm/damon/core: fix damon_call() vs kdamond_fn() exit race Date: Wed, 27 May 2026 14:59:16 +0200 Message-ID: <2026052747-CVE-2026-46025-cae8@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=4488; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=hlwVAHrasQdB2R334KuuaOQnxWXSoKlDrmrm941R7qE=; b=owGbwMvMwCRo6H6F97bub03G02pJDFlir9r/xIY69HS3HHCSOnx3+4GlUsEeC1cVzTrm0Cqzc Fri5VXNHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRrqMM89O2776+7PdaQ9tb XpMK1M8/ZjGaaMswV5LXUKrnyLKTohfkOz7PP9DS4/VxIQA= 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/core: fix damon_call() vs kdamond_fn() exit race Patch series "mm/damon/core: fix damon_call()/damos_walk() vs kdmond exit race". damon_call() and damos_walk() can leak memory and/or deadlock when they race with kdamond terminations. Fix those. This patch (of 2); When kdamond_fn() main loop is finished, the function cancels all remaining damon_call() requests and unset the damon_ctx->kdamond so that API callers and API functions themselves can know the context is terminated. damon_call() adds the caller's request to the queue first. After that, it shows if the kdamond of the damon_ctx is still running (damon_ctx->kdamond is set). Only if the kdamond is running, damon_call() starts waiting for the kdamond's handling of the newly added request. The damon_call() requests registration and damon_ctx->kdamond unset are protected by different mutexes, though. Hence, damon_call() could race with damon_ctx->kdamond unset, and result in deadlocks. For example, let's suppose kdamond successfully finished the damon_call() requests cancelling. Right after that, damon_call() is called for the context. It registers the new request, and shows the context is still running, because damon_ctx->kdamond unset is not yet done. Hence the damon_call() caller starts waiting for the handling of the request. However, the kdamond is already on the termination steps, so it never handles the new request. As a result, the damon_call() caller threads infinitely waits. Fix this by introducing another damon_ctx field, namely call_controls_obsolete. It is protected by the damon_ctx->call_controls_lock, which protects damon_call() requests registration. Initialize (unset) it in kdamond_fn() before letting damon_start() returns and set it just before the cancelling of remaining damon_call() requests is executed. damon_call() reads the obsolete field under the lock and avoids adding a new request. After this change, only requests that are guaranteed to be handled or cancelled are registered. Hence the after-registration DAMON context termination check is no longer needed. Remove it together. Note that the deadlock will not happen when damon_call() is called for repeat mode request. In tis case, damon_call() returns instead of waiting for the handling when the request registration succeeds and it shows the kdamond is running. However, if the request also has dealloc_on_cancel, the request memory would be leaked. The issue is found by sashiko [1]. The Linux kernel CVE team has assigned CVE-2026-46025 to this issue. Affected and fixed versions =========================== Issue introduced in 6.14 with commit 42b7491af14cbba2393329ce43d508a957bd94fa and fixed in 6.18.27 with commit 2691332ad88b57179c38653e2cd613d5820a52cf Issue introduced in 6.14 with commit 42b7491af14cbba2393329ce43d508a957bd94fa and fixed in 7.0.4 with commit e6a053a6f4b5048746c49432a5cc5b79fe4695fe Issue introduced in 6.14 with commit 42b7491af14cbba2393329ce43d508a957bd94fa and fixed in 7.1-rc1 with commit 55da81663b9642dd046b26dd6f1baddbcf337c1e 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-46025 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: include/linux/damon.h mm/damon/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/2691332ad88b57179c38653e2cd613d5820a52cf https://git.kernel.org/stable/c/e6a053a6f4b5048746c49432a5cc5b79fe4695fe https://git.kernel.org/stable/c/55da81663b9642dd046b26dd6f1baddbcf337c1e