From mboxrd@z Thu Jan 1 00:00:00 1970 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=1795154409; b=32LRLzePLrRNao746rFdr3/AVAw5H82+g9iUOd3hExeDv1zH+RTNUsojEs19MF7PVFrw VmeAAte3NEjeYDmQlp1xbfpOpOKibQWpE1SEevzpOgyeyxMtEubMpTTFRnxg1K+YGmZIg jYGEKzgp8GlB1LVDsJXSVYNVZLAQ2Tcc2+vDDx6cKV9X6HdFcDFe3HfDN69V6Sly4EWq9 na3Ns+zWRDPgIDaOjAAaqrFFRqr4LiC/syNjsT3lFET/alxU58PakmbvUjYcBuMTzK7h+ o/dXsnrdp1TESmqcgypYmSpFrQwROt3bhw/yUNMZNL2nTfgfyQEE9CKsleGGQkDr5ww== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795154409; 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=oOTWpRovxb8oTDScB+A46GWLlIrtUb5rlAFjiFEAhd4=; b=hB8fRil7iQTi/qQgwaybpMaORBBIzlAG1uOxTyzwIqJtd1hFLQTIE/2viQv4Z3JOv1Fm K6OQ2S+z/mDfvd9fL+E9smVpfxaOn1CDLlS63YsRzizzeV0qNlef9rkvV49K74AxzPKYm q38q3nV+s0yQNhSjf9FTRQqXd9Yx6A74EA4ibwUOOIjfAfCWE498CoxU7eTjSbevmcAfL HjsBwErAnOIY0VJ2BX3JfvCCdswrxZBQTOycN09PXUm64jGmNDDF2RDeSgPUlB0lmkGAt V+YDSASYM9CerRfFsEjhOYr/Diw7AXaIf9vBml9dsbw2i5ZjnIrv2q3Q5a5rX1CtIgw== 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="NA/Xxvxf"; 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 E9962606A51F for ; Fri, 20 Nov 2026 06:00:08 +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=NA/Xxvxf Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4410F1F000C4; Fri, 20 Nov 2026 06:00:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795154408; bh=oOTWpRovxb8oTDScB+A46GWLlIrtUb5rlAFjiFEAhd4=; h=From:To:Cc:Subject:Date:Reply-To; b=NA/XxvxfpU5HAMiVjDWJnPahoTIoTm/SbxH1OHqcLRIA9VXFv9gc3H8OpyskpJWRV WuFKN1tZ6Q/Tv2XAbBIhpv/kaFygFE8yOuebEhbelvGo6LcrTsxkxbfmDXBCldfdJb NYy5qtdQWUBusFlt+dcU+mAd7L+cTgEawW9IoQ7Y= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-99733: mm/truncate: look again if a folio left the mapping Date: Fri, 20 Nov 2026 06:51:59 +0100 Message-ID: <2026112014-CVE-2026-99733-9978@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=3500; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=YazXd/xC3MxZryLDLX74IlzU1wJ5wBRhK7TQo+ayF2A=; b=owGbwMvMwCRo6H6F97bub03G02pJDFn/7087eHzm6h1eWV6vEnwZunqu/r38PPrup6PHn2flN qyKKD+7rSOWhUGQiUFWTJHlyzaeo/srDil6GdqehpnDygQyhIGLUwAm8o6PYX582q25zz+8ZV01 lTWj4cEEHu+LF/4wLLixLkVw8rFbMy/1+8Q+4dhzoyOl/z8A 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/truncate: look again if a folio left the mapping invalidate_inode_pages2_range() skips a folio which no longer belongs to the mapping by the time it has got the folio lock, on the assumption that somebody else has removed it from the page cache. But the folio may have been replaced, and then there is a new folio with the same data at that index. For most cases, like folio migration, that is impossible. However, collapse_file() only checks the refcount of the old folios, under the i_pages lock, and relies on their folio locks from there on. That works for users which repeat the lookup when they find folio->mapping changed. The following scenario is, however, possible: CPU0 pwrite(O_DIRECT) CPU1 collapse_file() kiocb_invalidate_pages() read the folio (old data), lock it refcount check the write completes copy to new_folio kiocb_invalidate_post_direct_write() find_get_entries() -> old folio xas_store(new_folio) folio->mapping = NULL folio_unlock(folio) folio_lock() folio->mapping != mapping -> continue In that scenario, the collapsed folio with the data from before the write stays in the page cache after the write has returned. This used to be impossible, as khugepaged only collapsed files that nobody had open for writing. Restart the lookup at that index, like shmem_undo_range() does. The same problem seems to exist in truncate_inode_pages_range() as well when truncate_inode_folio() fails, so handle it there as well, but slightly differently: simply check once more through find_get_entries(). The Linux kernel CVE team has assigned CVE-2026-99733 to this issue. Affected and fixed versions =========================== Issue introduced in 7.2 with commit 1b6444331bebb4e586dab30b1fa0612ef482bab4 and fixed in 7.3.5 with commit f17044fee422605d19e07c4c9f5dc2be7abd7086 Issue introduced in 7.2 with commit 1b6444331bebb4e586dab30b1fa0612ef482bab4 and fixed in 7.4-rc2 with commit 9cf632e139737314afa889ca18122bc3fddb9120 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-99733 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/truncate.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/f17044fee422605d19e07c4c9f5dc2be7abd7086 https://git.kernel.org/stable/c/9cf632e139737314afa889ca18122bc3fddb9120