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 C642948EBEF for ; Fri, 25 Sep 2026 10:23:02 +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=1790331784; cv=none; b=FgkgRciy1+YC3b3SaplWn7AtFCGhQJX50NinlqEAQMqTmpJBgrQDVJpN1YbyeznSHnCPVBoyJMpnn2KDlTZDC3SzpTpJ17AHLy3GpKtL9yrHEz7PHZZErHGtJzqSd2pYedR3m+j1HZ+/Lj2mmu8hOg+cEWBHKdV3yO/Z/LCUCV4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790331784; c=relaxed/simple; bh=2D4OwpjXqdASTEPLhtC98k8I4/JpCK0i/CTUdirlqRU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FEz68xAV7JFF6Zutlk+MKbUPPDZ42mibdQPLlv0gAYuJ/EZxpZXdnh+VNLtFMftSmirR9v1Rb77a5D41iUS7SYIi5/ToImrmyUTRrTihTh44cQb+RsvHKcWt6Gs5yfhYmenwjE/zz50D+wLOMvxCu7elQkByXlgWAR5uIWroKro= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=aDczG0g6; 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="aDczG0g6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C97E01F000FF; Fri, 25 Sep 2026 10:23:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790331782; bh=+qa4CnK9GOG3ch6FW2tkLL0fD3PJ0SgRyMwE/uXyuWw=; h=From:To:Cc:Subject:Date:Reply-To; b=aDczG0g6KkkNVCaqXDfbTA/OeCTkCz2OUitDZNvKZdxjrhIn0aeXjVwnb6V7l3VDm cYzqTCXyrI+bMe3Zt5GVklf/8Qa+SjUmgv0VX5Atx4e4DHVvKbXZ+dbw+81eGqCX9u uPae3qCzas23D0ehg/Pbm+iWf4VX2X1z/TKZWaNE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-97533: x86/mm/pat: Acquire init_mm read lock on attribute changes to avoid UAF Date: Fri, 25 Sep 2026 12:21:53 +0200 Message-ID: <2026092547-CVE-2026-97533-621e@gregkh> X-Mailer: git-send-email 2.55.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=5069; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=UZbFzFD8Qan3mFSODgjusGRlVNOQ58rYQXf48EvZJA8=; b=owGbwMvMwCRo6H6F97bub03G02pJDFnbvK2dn290NhKVmSLw6O4XX6kbnKc2JbJt1t4h++tpM 1/e1MWSHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRJ3EMC2Z+U74VyMvfKG8p rnZpZv921lfvihkW7Of63crn/q1qw/X9d0RcFU6cDuueCgA= 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: x86/mm/pat: Acquire init_mm read lock on attribute changes to avoid UAF A previous commit protected against races between ptdump and CPA collapse, however one still exists between attribute changes and collapse as reported by Denis V. Lunev (linked). When an attribute change arises, a lockless page table walker obtains a PTE entry, which is later written to via set_pte_atomic(): ... -> change_page_attr_set_clr() -> __change_page_attr_set_clr() -> __change_page_attr() -> _lookup_address_cpa() -> lookup_address_in_pgd_attr() -> [ lockless page table walker ] -> set_pte_atomic() There is nothing preventing a concurrent CPA collapse which can free the PTE that was retrieved here, resulting in a use-after-free. With the mmap write lock taken on init_mm over CPA collapse, resolve this race by acquiring an mmap read lock on init_mm over __change_page_attr_set_clr(). This locks across the whole operation over which the walk and the PTE entry write occurs, solving the race. It is safe to do this here, as no spinlocks are held upon entry to __change_page_attr_set_clr(). However, the lock must not be held over an allocation, as allocation can trigger reclaim and shrinkers may call into CPA recursively, making deadlocks possible (init_mm -> ... -> fs_reclaim -> init_mm). A page table is allocated when a huge page needs to be split: -> change_page_attr_set_clr() -> __change_page_attr_set_clr() -> __change_page_attr() -> split_large_page() [ pagetable_alloc() ] -> __split_large_page() Avoid deadlocks by dropping the mmap lock across pagetable_alloc() in split_large_page() and track whether this is needed by adding a new 'init_mm_read_locked' flag to struct cpa_data. This is safe as __split_large_page() (called with locks re-established) revalidates that the page table entry is the same as it was prior to the locks being dropped and __change_page_attr() repeats the entire page table walk whenever a split occurs, so concurrent split and collapse are accounted for. Concurrent ptdump is also safe as the lock is only dropped over page table allocation during which time the page table has not yet been modified. The CPA_COLLAPSE flag is only set by set_memory_rox(), which exclusively operates upon vmalloc ranges, and on x86 only within the module mapping space. This is important, because some callers directly invoke __change_page_attr_set_clr(), bypassing this lock. However, none of these operate within the module mapping space. * cpa_process_alias() - a recursive helper called by __change_page_attr_set_clr(). * __set_memory_enc_pgtable() - operates on the direct mapping and (via __vmbus_establish_gpadl()) the vmalloc mapping space. * __set_pages_[n]p() - called by set_direct_map_[invalid, default, valid]_noflush(), __kernel_map_pages() - operates on the direct map. * kernel_[un]map_pages_in_pgd() - operates on EFI ranges. This work is based upon Denis V. Lunev's excellent analysis of the bug with gratitude. [ dhansen: move to imperative voice in changelog ] The Linux kernel CVE team has assigned CVE-2026-97533 to this issue. Affected and fixed versions =========================== Issue introduced in 6.15 with commit 41d88484c71cd4f659348da41b7b5b3dbd3be1f6 and fixed in 6.18.53 with commit e21a9ea81426a85fdb0cdcfcc99d5d9c16b402ab Issue introduced in 6.15 with commit 41d88484c71cd4f659348da41b7b5b3dbd3be1f6 and fixed in 7.2.7 with commit cc73b2043d106b467accd38e9b1fc09e0607c056 Issue introduced in 6.15 with commit 41d88484c71cd4f659348da41b7b5b3dbd3be1f6 and fixed in 7.3-rc4 with commit d5d8b8662e6e5a565b47a0388640e88402f23274 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-97533 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: arch/x86/mm/pat/set_memory.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/e21a9ea81426a85fdb0cdcfcc99d5d9c16b402ab https://git.kernel.org/stable/c/cc73b2043d106b467accd38e9b1fc09e0607c056 https://git.kernel.org/stable/c/d5d8b8662e6e5a565b47a0388640e88402f23274