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 16CE326ED33 for ; Thu, 4 Dec 2025 14:50:59 +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=1764859860; cv=none; b=Q64U5Aw8Dp1ih8t4uRRBwBI6kDMsN+JCdyACMwL/xZpdc7uUNeh+jJfjnt4Yj5yVimM7rKfFW/mvKNxPV8c2Gcskr6lZjDkqcrkaBmeZa1RBWfzwqAFJO51OCXihCXmbFF0cJkh71T9gOBa4vTlUD2yJNZTAmm0ib6auh4DuC0s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764859860; c=relaxed/simple; bh=X/Zb6cwvRMLLqFay1ztF5oNcG5FrwOAcWLVfmyU2+Fw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=drR19t/1FpDIsTzBdLNNOn6B4bdkj4iME8cJGxX4jIlzDKBvDkr3ASX1vLKxoBD0BJeMdtEzfZ5eRzpr5KNQfaNcJQu7NAfPigtsKuu0HU3kHCSu1olyyVIEsLLIjgOnvo4VoG4lfTF5e9+arpZtg4ehCZGfF4cGht9HV/43l18= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=r+eQCwqx; 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="r+eQCwqx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0146AC116C6; Thu, 4 Dec 2025 14:50:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1764859859; bh=X/Zb6cwvRMLLqFay1ztF5oNcG5FrwOAcWLVfmyU2+Fw=; h=From:To:Cc:Subject:Date:Reply-To:From; b=r+eQCwqxNxDJGNr5PdjONEvgVfEe5B4UbX+R9dQLh6csLQxqBGO3vUFyDZgoV1j+i PTLrizXyeLdNwYsPdLQ/ROC9tu3W9ZCLQI+Ubhj5D1va0wyhUEDw9ADZ0+ROofn4uC Vl+htQ9fqKi01NhVvT+CZWgCi9mczCEXhXWBXtPc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-40218: mm/damon/vaddr: do not repeat pte_offset_map_lock() until success Date: Thu, 4 Dec 2025 15:50:52 +0100 Message-ID: <2025120452-CVE-2025-40218-d4dc@gregkh> X-Mailer: git-send-email 2.52.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=3016; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=rrui3WxRp/KiILthctEEtW1JsUfv+HyMJw8pmgfWObc=; b=owGbwMvMwCRo6H6F97bub03G02pJDJmG888m9+y4wblxhfIZjR09cxiK9YT2t3+O5nmjkiL1z 2LHA62qjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiIlTnDgo5VZjnNh3g+eD/t OfA7/YnbFfVrLxkWnNy0rtlFRi84t2zjRs2bM0xcg1n3AAA= 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/vaddr: do not repeat pte_offset_map_lock() until success DAMON's virtual address space operation set implementation (vaddr) calls pte_offset_map_lock() inside the page table walk callback function. This is for reading and writing page table accessed bits. If pte_offset_map_lock() fails, it retries by returning the page table walk callback function with ACTION_AGAIN. pte_offset_map_lock() can continuously fail if the target is a pmd migration entry, though. Hence it could cause an infinite page table walk if the migration cannot be done until the page table walk is finished. This indeed caused a soft lockup when CPU hotplugging and DAMON were running in parallel. Avoid the infinite loop by simply not retrying the page table walk. DAMON is promising only a best-effort accuracy, so missing access to such pages is no problem. The Linux kernel CVE team has assigned CVE-2025-40218 to this issue. Affected and fixed versions =========================== Issue introduced in 6.5 with commit 7780d04046a2288ab85d88bedacc60fa4fad9971 and fixed in 6.6.113 with commit 677ebfe5d00f94adec0c0204f6e6e2a82d3f77bf Issue introduced in 6.5 with commit 7780d04046a2288ab85d88bedacc60fa4fad9971 and fixed in 6.12.54 with commit ac42320ec873bfe726141069cfdd90ee5bc4e885 Issue introduced in 6.5 with commit 7780d04046a2288ab85d88bedacc60fa4fad9971 and fixed in 6.17.4 with commit 0ccd91cf749536d41307a07e60ec14ab0dbf21f5 Issue introduced in 6.5 with commit 7780d04046a2288ab85d88bedacc60fa4fad9971 and fixed in 6.18 with commit b93af2cc8e036754c0d9970d9ddc47f43cc94b9f 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-40218 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/vaddr.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/677ebfe5d00f94adec0c0204f6e6e2a82d3f77bf https://git.kernel.org/stable/c/ac42320ec873bfe726141069cfdd90ee5bc4e885 https://git.kernel.org/stable/c/0ccd91cf749536d41307a07e60ec14ab0dbf21f5 https://git.kernel.org/stable/c/b93af2cc8e036754c0d9970d9ddc47f43cc94b9f