Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792758002; b=pQbeoEQskyAZVzWJlWbjmc4Oa5AmuBdS/CVN141AbadKTq8MB0rsFIyqSw1h+3zXB8I8 YmFsrHE+abN1e6EwZ8UrIaonuccly6NfMpUoI6F/s9GwWKf1QKOnxyjHZDl+iBL5ASEgU gk0iaZFoDcez+O8g33vtVlxLQ8cB0bLK0r9QwWq5EnszAxM4qSqYz8BWdJ/4vuZoaGLT3 Crar4mACe332rd+UMjy1+iKkScGNM+RBdsOIwhV5GwGRROyOUPqhUf4C594UaELRng8zI LAIkNnwQqBrvEB5mPv/fA6MuVObGkKf5+Ier7Cqqqc0yIKwuA8HxHSPuYOFFuODFZYg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792758002; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: Reply-To:MIME-Version:Lines:X-Developer-Signature:X-Developer-Key: Content-Transfer-Encoding; bh=vBv3w/NVV0nY7kVFpATmFcKykOrsFDHFBSzoxGZTkWE=; b=Pnt2tkcEay5/mBi21ETusLKTwBEMD+amjXqR5HA8Q3qujREA7Uw90DOW1qVvb4+2GZdr p6iysXW52YmUmQVi7hGTRHwxDJ43kBoTcFnva8H9sMfM2YnOcSdjLwsrgtsD/nSomAHwf 5cB1iu1TxKslXJi4Xm/aRSqBqFRZczNk6iFuAHZ2xhtLLFbv40+3IzTvHn4HlH2Ptzn98 vMdzpUXq6Q+A9LpQ2YaJdaESjecTdRy4ab1R43f4Dh+Nx/teafehXZBijpOHgXGHwxW5r jRmXy/0i2cqO457wRtrXrfSB16kEt0aU84MEX0pCA/lE2oUsLmLqkdlPIf3XLSBtzUQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=NJG8QOPp; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1D3C606A32D for ; Fri, 23 Oct 2026 12:20:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=NJG8QOPp Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7C621F01828; Fri, 23 Oct 2026 12:20:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792758001; bh=vBv3w/NVV0nY7kVFpATmFcKykOrsFDHFBSzoxGZTkWE=; h=From:To:Cc:Subject:Date:Reply-To; b=NJG8QOPpqNNSVMlzunYCEyINUzwjX6h6/qJ2zgRULJrasOjBWmW8PaYDYX4Wf55r6 DR63w2r+2Y3+wh41/3XWYbL19vayDWsBnfbuFhNFKTyl9+BsCgfjvBPHM+oUCCQL3T PgyU3PGUtd6YH0vrahc4VLk6//glWWlJ6Y60T904= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-98918: mm/damon/ops-common: use a page-aligned address in damon_ptep_mkold() Date: Fri, 23 Oct 2026 14:01:39 +0200 Message-ID: <2026102338-CVE-2026-98918-9815@gregkh> X-Mailer: git-send-email 2.56.0 Reply-To: , X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4905; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=SHa7GqjrjtnSIlkez5x1BcKA6Tcuwe6XBHMfGsnz6EU=; b=owGbwMvMwCRo6H6F97bub03G02pJDFm3fRY53v5/SdlZMHRzN+N6/smLlv/5e2WVwF+nfecZM 7gOv+4y6IhlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJlBgzzLNxnmGakP4nKF2K i2u3J4Pk/pBd5xjmCvaF+FtcmOG67lIIr6/O/5Rtz79/BAA= 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/ops-common: use a page-aligned address in damon_ptep_mkold() __damon_va_prepare_access_check() picks a random byte address within the region and stores it in r->sampling_addr. damon_va_mkold() passes it into a page table walk, which hands it to damon_ptep_mkold() as the address of the page to sample: damon_va_mkold(mm, r->sampling_addr) damon_va_walk_page_range(mm, addr, addr + 1) damon_mkold_pmd_entry() damon_ptep_mkold(pte, vma, addr) ptep_test_and_clear_young(vma, addr, pte) mmu_notifier_clear_young(mm, addr, addr + PAGE_SIZE) For arm64, before commit 6f0e1142173a ("arm64: mm: support batch clearing of the young flag for large folios"), the contpte helper walked exactly CONT_PTES entries from the aligned-down page table pointer and used @addr only to pass down to each entry, so an unaligned value was harmless: ptep = contpte_align_down(ptep); addr = ALIGN_DOWN(addr, CONT_PTE_SIZE); for (i = 0; i < CONT_PTES; i++, ptep++, addr += PAGE_SIZE) Now the range to walk is derived from @addr instead: end = addr + nr * PAGE_SIZE, rounded up to CONT_PTE_SIZE. For a sample in the last page of a contpte block, the sub-page offset puts end just past the block boundary, so the round-up lands a whole block further and the walk clears PTE_AF in CONT_PTES entries beyond the sampled block. For the last block in a page table page, those entries are past the end of that page, so the walk writes into the page that follows. Triggered by the full 7.1/7.2 kernel selftest suite on arm64 (EC2 c/m6g.4xlarge). The kernel sometimes crashes at or shortly after the DAMON test. What the overrun does depends on the page that happens to follow the page table, so there is no single signature. If that page is read-only, the write faults in the sampling path itself: Unable to handle kernel write to read-only memory at virtual address ffff0003c5d2d000 FSC = 0x0f: level 3 permission fault CM = 0, WnR = 1, TnD = 0, TagAccess = 0 CPU: 10 UID: 0 PID: 3487 Comm: kdamond.2 pc : contpte_test_and_clear_young_ptes+0x70/0xc0 lr : damon_ptep_mkold+0x1e8/0x1f8 Call trace: contpte_test_and_clear_young_ptes+0x70/0xc0 (P) damon_mkold_pmd_entry+0x150/0x170 walk_pmd_range+0x110/0x2b0 walk_pud_range+0x10c/0x208 walk_pgd_range+0x134/0x258 __walk_page_range+0x98/0x1b0 walk_page_range_vma_unsafe+0x90/0x148 walk_page_range_vma+0x28/0x40 damon_va_walk_page_range+0x114/0x2b8 damon_va_prepare_access_checks+0xec/0x1a8 kdamond_fn+0x534/0x770 kthread+0x128/0x138 ret_from_fork+0x10/0x20 Otherwise the page is writable, the PTE_AF clearing succeeds silently and the damage only surfaces later, in whatever happened to own the page, so the backtrace is unrelated to DAMON and differs between runs. Pass a page-aligned address to the ptep_test_and_clear_young() call in damon_ptep_mkold(), which is the only place DAMON can reach contpte_test_and_clear_young_ptes() from. Nothing else sees the aligned address, and r->sampling_addr itself is left as is, so the sampling and region bookkeeping semantics are unchanged. The Linux kernel CVE team has assigned CVE-2026-98918 to this issue. Affected and fixed versions =========================== Issue introduced in 7.0 with commit 6f0e1142173a54b8a18c59fc3cbae3b31ee423d9 and fixed in 7.2.9 with commit d5208de0799c506d3315b6f96d034c38e4509dbb Issue introduced in 7.0 with commit 6f0e1142173a54b8a18c59fc3cbae3b31ee423d9 and fixed in 7.3 with commit f166586f74dd5d9cbadaabf86ef81c8ddf6cafa7 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-98918 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/ops-common.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/d5208de0799c506d3315b6f96d034c38e4509dbb https://git.kernel.org/stable/c/f166586f74dd5d9cbadaabf86ef81c8ddf6cafa7