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=1795100360; b=bHjQ+AnWiXUs3MxmzvVSPxGmMK9Jx1Q7ZXLnyHL+MLBWh7DxteOw02cZOb0eGW1yBrwI BAvj4pzYjR6qjJAlfmkcuMkH/Qcgj9IisckzPgIusg1bnlKi5o/tZTKqxvmgPGcWPZ4HN WLzgWuFykTUTsetGzsAwiLDlDt3CgGCdIx1bKqkBWHeZYQfnPdS/kXiOPLJWy4+GLBmRS ll7OX+EwPlRbG/6uj8GyUjbX44Vt9lKgcCJ4VQU/q+WBSrj1cJIqrBrYjIkWH5XQ3EbGO lPcXj9oKUMMNpv1hQ21HgqMC1EJxN1o/4Mn0lzLI2+iddnAWx/tglkSSSn0Qr3acmJQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795100360; 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=NuXFyhLwA6VpGFNGVkuZcGmA0tGJFNcEgaobPSkPSvI=; b=BpmYVCRgGfKO0FT4C1J0wd4lJmEomw3/F+UZIZKj4cLznhYtwuIQo8IE+vERaYk/34S1 JTaU+f/jupgmzmeyvupfHc0pG5lGKEg8hXZdCTL9OfVWhzj0ovecAHVc3FB0cqka8ya4m US329ijgv6rIpyXoy5ts26eaXEyIdRhKC/YKLrG8grcWMcRbgAbeq2QrCO6AW106jZuW/ 1D/XGzUXkYdK00p5ESS2cOvgrF1msfKP5+Co2tZcuGvSjzJ0GCXcZNItIwrGrt9NyZwNm x3LUGj6viPugrYs2bNy00TtAeo+SEGu04fGxfRW8rVj8NOL1ou8Nc1il3lAdrCcCNDA== 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=rHh49c4G; 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 EED29606A320 for ; Thu, 19 Nov 2026 14:59:19 +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=rHh49c4G Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDA701F000C5; Thu, 19 Nov 2026 14:59:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795100359; bh=NuXFyhLwA6VpGFNGVkuZcGmA0tGJFNcEgaobPSkPSvI=; h=From:To:Cc:Subject:Date:Reply-To; b=rHh49c4GuNXH7zgM/LMVyLcAQcoD+AC0cBP0M2z63fZA5yc3ZlXU752nzPzL6LGdM ZztnXSKDVRIeliWokgJFF7x5+baTjiFvurZxSkYROm3g7xhN0Jjn2BrpkqQlQZ5suN bx3RdgWnJuhLYJ0JAebX6JXLdEp29lDwXbKuCSi0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-99461: mm: khugepaged: fix swap entry value to folio_pfn() Date: Thu, 19 Nov 2026 15:25:59 +0100 Message-ID: <2026111908-CVE-2026-99461-5ce5@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=3832; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=O8jqLAsGxreqjfJZt32SCW/JY3xpKp9X1BCBf0Js5Vo=; b=owGbwMvMwCRo6H6F97bub03G02pJDFn/2TrK1VLffrvs3LHtlFJzm7u+w9X9vHb3L2ZK+LDs0 Y+frr+gI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACYy4yzDPLvgdKVMeZfixYtn GFb9XS26+JY4F8P89NBTjXMfmzUGsP/Y/lYh6ZVY9IpEAA== 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: fix swap entry value to folio_pfn() Patch series "mm: khugepaged: fix tracepoint UAF", v5. The khugepaged tracepoints take a folio pointer and call folio_pfn(), but by then the folio may no longer be valid: freed after folio_put(), folio_unlock() or pte_unmap_unlock(), or not a folio at all but an xarray-encoded swap entry. On classic SPARSEMEM, dereferencing it oopses khugepaged as soon as the trace event is enabled; on other memory models it merely prints a bogus pfn. Pass the pfn to the tracepoints directly, captured while the folio is still pinned, closing the use-after-free windows in mm_khugepaged_scan_file(), mm_khugepaged_scan_pmd() and mm_khugepaged_collapse_file(). This patch (of 3): When the swap entries found exceed max_ptes_swap, the loop is left via break with folio still holding the xarray value that encodes the swap entry, not valid folio pointer. That value is passed to trace_mm_khugepaged_scan_file(), which feeds it to folio_pfn(). On FLATMEM and SPARSEMEM_VMEMMAP, the page_to_pfn() is plain pointer arithmetic, so the trace event merely prints bogus scan_pfn. On classic SPARSEMEM, the page_to_pfn() reads page->flags, dereferencing the tiny encoded integer and oopsing khugepaged whenever the trace event is enabled. So when folio is the swap entry value, simply set pfn to -1, just like exhausted scan naturally. And the folio_put() has maybe dropped the last reference of folio. The trace_mm_khugepaged_scan_file() is left with a dangling folio pointer. so using the folio_pfn() before dropping the reference, closing use-after-free window. The Linux kernel CVE team has assigned CVE-2026-99461 to this issue. Affected and fixed versions =========================== Issue introduced in 6.1 with commit d41fd2016ed07a630da2817b76c98eeab7931e1e and fixed in 6.12.117 with commit 384c524e066459c91a8750a055fe70d56b334437 Issue introduced in 6.1 with commit d41fd2016ed07a630da2817b76c98eeab7931e1e and fixed in 6.18.63 with commit c4252273ead984541eb9313667f2924f2ff8d0e0 Issue introduced in 6.1 with commit d41fd2016ed07a630da2817b76c98eeab7931e1e and fixed in 7.3.2 with commit 9efc8d0c9c81094cfa99667154f5682d487e9b63 Issue introduced in 6.1 with commit d41fd2016ed07a630da2817b76c98eeab7931e1e and fixed in 7.4-rc1 with commit 942c8ec27aa4ffc587511650718349964e1696e6 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-99461 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: include/trace/events/huge_memory.h 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/384c524e066459c91a8750a055fe70d56b334437 https://git.kernel.org/stable/c/c4252273ead984541eb9313667f2924f2ff8d0e0 https://git.kernel.org/stable/c/9efc8d0c9c81094cfa99667154f5682d487e9b63 https://git.kernel.org/stable/c/942c8ec27aa4ffc587511650718349964e1696e6