From mboxrd@z Thu Jan 1 00:00:00 1970 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 C527A493D37 for ; Fri, 25 Sep 2026 10:30:17 +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=1790332219; cv=none; b=b7+JTqy03BMgOooWCauwmlqPsQ0K8csIrvkmT+B3ZLSoGhdGqia58mYQ4VKIHZ4TJkpyqSZn9a/swq5uUzPr6WSHz68wvBo+eAwMC7TmrnwyA90/3sN6OhX847v1IPd/KOfXF/jJdSkYc7G1fFdf+RAw4ZQ5WX/1MGN7kFeV5NA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790332219; c=relaxed/simple; bh=t+qj707M3nWB70l9rENbZvMp2OI4mmLzyaIGQISnU7w=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=L8XkMNEIx1zzwWd2vorEkCKJa0uRqnZkpzuW5xbW6T407VqCFhSdSCyY5d5vhGw+Zq1jpcVdSU3xeIr4mcdDvHbb3cuxInieNPEZ4tcHtPn/hF5qwxtYwkNt5cZYIX8dQ9G7ei+wVBMiU8odbGjoQCAne+Y0azgXgjkgR+gAr4E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=e9ru0vOW; 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="e9ru0vOW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A8271F00899; Fri, 25 Sep 2026 10:30:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790332217; bh=laT5/TC8iNRf6ym4RYjqJbxQmdipm/w+9Oz+Id5/m1E=; h=From:To:Cc:Subject:Date:Reply-To; b=e9ru0vOWv9GHeCdVZoa/aRxgcmSn8hOqTF5zMHKpbxtrhrcU5k6MX0YhknlvteePJ c49EpMCO98TPfVaLSBpISwaj8xeSf2Ki+Q3abHhE+/mvdFdYzUrgYGPQw4FUu8VyRi UY69848TrJAV5JmMJfvZSd8zk9uZLk5eNFwNhi4g= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-97943: x86/mm/pat: Acquire init_mm write lock on collapse to avoid UAF Date: Fri, 25 Sep 2026 12:24:06 +0200 Message-ID: <2026092512-CVE-2026-97943-e827@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=3574; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=yqPvbd3DdJOTS/hcQ4RnAbyEoVNf29X0Yz4MhaE0dXs=; b=owGbwMvMwCRo6H6F97bub03G02pJDFnbvEMsy9n3eBb8CrzecKp86fadfx82a52p79S5q/J5d 8RmKe6jHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRDVkM89M5n24/91mpaNZl tp8eRxmbXl9838WwYBvLfpbVfwSXTma9tjbGqDEu5nXUDQA= 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 write lock on collapse to avoid UAF x86 implements page attribute modification using its Change Page Attributes (CPA) mechanism. This tracks properties of ranges such as cache mode through x86 page attributes, and as part of that logic manipulates kernel page tables. Since commit: 41d88484c71c ("x86/mm/pat: restore large ROX pages after fragmentation") ranges of kernel page table entries can be collapsed into huge page table entries as part of this logic. As part of this collapse, it frees the page tables which the collapsed entries previously pointed to, and it does so without any relevant locks being held to preclude concurrent kernel page table walkers. The only way this code can be reached is if CPA_COLLAPSE is specified, and this is only set in set_memory_rox() via: set_memory_rox() -> change_page_attr_set_clr() -> cpa_flush() -> cpa_collapse_large_pages() Notable users of this are execmem and BPF when manipulating executable mappings. However, this is problematic for ptdump as it walks ranges it does not own and thus runs the risk of a use-after-free on page tables freed underneath it. In addition, concurrent CPA collapse operations are possible which can also cause races. Resolve the issue by acquiring the mmap write lock on init_mm across the whole operation. It is safe to acquire a sleeping lock as all the callers invoke set_memory_rox() from process context and in any case, change_page_attr_set_clr() calls vm_unmap_alias() which ultimately takes a mutex, disallowing atomic context here. The Linux kernel CVE team has assigned CVE-2026-97943 to this issue. Affected and fixed versions =========================== Issue introduced in 6.15 with commit 41d88484c71cd4f659348da41b7b5b3dbd3be1f6 and fixed in 6.18.53 with commit 35820cf8dd521f5a651e221483015b0586794516 Issue introduced in 6.15 with commit 41d88484c71cd4f659348da41b7b5b3dbd3be1f6 and fixed in 7.2.7 with commit 93b98882198b15bd482da1fe8e84b05c7c3b3d83 Issue introduced in 6.15 with commit 41d88484c71cd4f659348da41b7b5b3dbd3be1f6 and fixed in 7.3-rc4 with commit a1c7570cedd03372812a5b693732880867babbca 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-97943 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 include/linux/mmap_lock.h 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/35820cf8dd521f5a651e221483015b0586794516 https://git.kernel.org/stable/c/93b98882198b15bd482da1fe8e84b05c7c3b3d83 https://git.kernel.org/stable/c/a1c7570cedd03372812a5b693732880867babbca