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=1795154216; b=XbgceUC+3V/rXJvhbhk7XlqFW8y8r+EFwIDdBn6FCyI3Fb+/8Giw7aQ+Tpyv73CQYRAV TLS4a2JJ1X7MqVXXHLCoEl5k64szOpbmEPlWYO6i57gW4te9aI3ccq7oqag0lf6YzdZlk jqcNsy+qdV1VSigrf0h6SN+eF/EUAqA8VUoOguLBpElcjmzDU2MQ9yAYny08/ek77k+jM 9ELL06iMJm5WDIsF1aqisxls2NLTtVlC63lTEO8Hpwj2gdRFlTld2wYS6qGak08Y60tWj URaln8xkZtcZuneeHdfIFT7TzmOsQuNjXaVLkrH+boTD3w5IW1cInKnmexwFLPXTYVA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795154216; 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=4czAy0y7P+T7eYqmvm5CFis9P7LGazz9ZIrl9KjeYqA=; b=BsMeyrfI7IrLM/bGuZMyq5SklGwnEdT0/Md9LBGFmHMLLU+duonepnRvi/j5Wq4yevyv Rfyi0tkzU73pzf1HdMr5qo0bqxjOtBnb2VqjUHjfwV+svTSQmO7xjvwrFcBgnIF/qah82 BSr9mENfNg/v8DSSDLuh2TW3PMbqt32dMqbnf3Eavr9xcpTQxojNSc3nBiyvAkuxMJAGk 9veLhU7CtSm29vgUT5ScLCGtRMp6UgnlyrKQ3EBmKFuC31veI0s6CMwbpXYdz7MLkWHYx UT2CwQsASwYIU4TuFyFEP1peykqFm5GtVst11gsmFPUHdvp80I1N4Xw2lXuUToc9Sqw== 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="EU/AwTUY"; 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 AE28C60A2618 for ; Fri, 20 Nov 2026 05:56:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=EU/AwTUY Received: by smtp.kernel.org (Postfix) with ESMTPSA id BFDB71F000D1; Fri, 20 Nov 2026 05:56:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795154216; bh=4czAy0y7P+T7eYqmvm5CFis9P7LGazz9ZIrl9KjeYqA=; h=From:To:Cc:Subject:Date:Reply-To; b=EU/AwTUYn9PYxq3Z+ds2NiOcfuMbzBopoyT4yd7OAr0b5KQbtyLhTrf+gHpTZScVQ TSW7ckzieL0IY30dBBQBBBXvV3McuK4oOvfU6GfQLke8Px+DegMAPNFwqCFK3shDG5 pRKEfWW0MNa3jZrj/KD8p6mgYS2reEH9PFpa0AbM= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-99665: mm/khugepaged: preserve dirty bits when collapsing PTE-mapped THPs Date: Fri, 20 Nov 2026 06:50:51 +0100 Message-ID: <2026112049-CVE-2026-99665-8336@gregkh> X-Mailer: git-send-email 2.56.1 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=2899; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=0Z5Pcc9uYOHhM+oj4RCeII/PvzllCaVHlZrwxX/yIR4=; b=owGbwMvMwCRo6H6F97bub03G02pJDFn/79fuOXxYwc5I9u+mwC6dX7+WH3Bxq+798lZgokkBH +P+lCyXjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjISgmGucIRrn9kjl+5v3lD cbs0461D+5UfVzHMFTL5s/aX/rxpuspqU2VnhSl7i0xSAAA= 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/khugepaged: preserve dirty bits when collapsing PTE-mapped THPs try_collapse_pte_mapped_thp() clears PTEs without transferring their dirty bits to the folio. A shmem read fault can map a clean folio writable, so a later store only dirties the PTE. Losing that dirty bit allows reclaim to discard modified data. The assumption that regular files are read-only is also obsolete since commit 1b6444331bebb ("mm/khugepaged: enable clean pagecache folio collapse for writable files"). In any case, transferring PTE dirty bits to the folio when removing mappings (and while the folio is still mapped) is the right thing to do. Use get_and_clear_ptes() to collect the dirty bits and mark the folio dirty before unmapping it. Update the comment. This was reproduced with shmem using MADV_COLLAPSE followed by MADV_PAGEOUT. Fix generated by an LLM and sent by Chris Mason in private. [ david: adjust comment; simplify description; cover file-thp as well ] The Linux kernel CVE team has assigned CVE-2026-99665 to this issue. Affected and fixed versions =========================== Issue introduced in 5.4 with commit 27e1f8273113adec0e98bf513e4091636b27cc2a and fixed in 6.18.64 with commit 0af947ae4d91af0c6e9573220a1298cd8302b6c3 Issue introduced in 5.4 with commit 27e1f8273113adec0e98bf513e4091636b27cc2a and fixed in 7.3.5 with commit 1f54708f40b8dea6951426ca567fc96160693388 Issue introduced in 5.4 with commit 27e1f8273113adec0e98bf513e4091636b27cc2a and fixed in 7.4-rc2 with commit fe2817e3d5ea347214342c9a5cd8bcbff20c0574 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-99665 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/khugepaged.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/0af947ae4d91af0c6e9573220a1298cd8302b6c3 https://git.kernel.org/stable/c/1f54708f40b8dea6951426ca567fc96160693388 https://git.kernel.org/stable/c/fe2817e3d5ea347214342c9a5cd8bcbff20c0574