Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 18933246768 for ; Mon, 27 Apr 2026 17:31:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777311061; cv=none; b=TRss/HF4wdi7rbXcSzUNPjpphjLlmkv62ohGyf2cfyxf3IxB1//p7s6NV04hOs7d2GB31KMw6HzeNaT1rngitKOHBXRuTdA7cgOCjcMdgqweSSXPsNmSDCMvULmEW8GF6Sah4JEcoC1LQuWZDYK/vmreRUNY5dXaK5VN+bJJg0o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777311061; c=relaxed/simple; bh=4MDa6TTYHeXNTeQRc4Npy19xLys0+fMoKI2R8FlA0Co=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=dvM4A7ju670j0iV7KD31f6sO8U4ZLeMiLys23kzeW4Mavzitskf9eFaoFamih2KosZsfL544MuyRffPh9seI4BiyDXxgzDZZ0E/OM63kXeAS9QFIxKMmAquxyTahY5MWNrT+5LpVVlzhgeSqArgum3TrUzqK40VJZ77EXOvPhaM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1B4htJj9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="1B4htJj9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83BDFC19425; Mon, 27 Apr 2026 17:31:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777311060; bh=4MDa6TTYHeXNTeQRc4Npy19xLys0+fMoKI2R8FlA0Co=; h=From:To:Cc:Subject:Date:Reply-To:From; b=1B4htJj90QltT/XR8YYCRZsg2avk0Mi4aruC7IeflLSqNysrn6hGYxAzQs7sHPjag fVrvuwJb2XFwrgO2X6QHE9bKsE/3gfrgC/uQBseOHwn8rZXKmTsapaNoBVNllIgRvs s97FDvhH/nzHmt5F/BKYOAAdIbV6CsVCC7U69xOM= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-31686: mm/kasan: fix double free for kasan pXds Date: Mon, 27 Apr 2026 11:30:23 -0600 Message-ID: <2026042722-CVE-2026-31686-df69@gregkh> X-Mailer: git-send-email 2.54.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=6421; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=znMw+BbgqS71+LOrP/i1S3LqLAUYtCfjl//FuqDyp38=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnv5+rtXfg0U0yWv9r/1KGqZTXqf+/+CQ1aw7L7ynvpa 6KM6hdmdsSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEMtoY5koYHXHXOXFUytJB xeXBpKK0sxPSjzLMz/l8JdZuz6lWD+n17P+ZN76+q7lvPgA= 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/kasan: fix double free for kasan pXds kasan_free_pxd() assumes the page table is always struct page aligned. But that's not always the case for all architectures. E.g. In case of powerpc with 64K pagesize, PUD table (of size 4096) comes from slab cache named pgtable-2^9. Hence instead of page_to_virt(pxd_page()) let's just directly pass the start of the pxd table which is passed as the 1st argument. This fixes the below double free kasan issue seen with PMEM: radix-mmu: Mapped 0x0000047d10000000-0x0000047f90000000 with 2.00 MiB pages ================================================================== BUG: KASAN: double-free in kasan_remove_zero_shadow+0x9c4/0xa20 Free of addr c0000003c38e0000 by task ndctl/2164 CPU: 34 UID: 0 PID: 2164 Comm: ndctl Not tainted 6.19.0-rc1-00048-gea1013c15392 #157 VOLUNTARY Hardware name: IBM,9080-HEX POWER10 (architected) 0x800200 0xf000006 of:IBM,FW1060.00 (NH1060_012) hv:phyp pSeries Call Trace: dump_stack_lvl+0x88/0xc4 (unreliable) print_report+0x214/0x63c kasan_report_invalid_free+0xe4/0x110 check_slab_allocation+0x100/0x150 kmem_cache_free+0x128/0x6e0 kasan_remove_zero_shadow+0x9c4/0xa20 memunmap_pages+0x2b8/0x5c0 devm_action_release+0x54/0x70 release_nodes+0xc8/0x1a0 devres_release_all+0xe0/0x140 device_unbind_cleanup+0x30/0x120 device_release_driver_internal+0x3e4/0x450 unbind_store+0xfc/0x110 drv_attr_store+0x78/0xb0 sysfs_kf_write+0x114/0x140 kernfs_fop_write_iter+0x264/0x3f0 vfs_write+0x3bc/0x7d0 ksys_write+0xa4/0x190 system_call_exception+0x190/0x480 system_call_vectored_common+0x15c/0x2ec ---- interrupt: 3000 at 0x7fff93b3d3f4 NIP: 00007fff93b3d3f4 LR: 00007fff93b3d3f4 CTR: 0000000000000000 REGS: c0000003f1b07e80 TRAP: 3000 Not tainted (6.19.0-rc1-00048-gea1013c15392) MSR: 800000000280f033 CR: 48888208 XER: 00000000 <...> NIP [00007fff93b3d3f4] 0x7fff93b3d3f4 LR [00007fff93b3d3f4] 0x7fff93b3d3f4 ---- interrupt: 3000 The buggy address belongs to the object at c0000003c38e0000 which belongs to the cache pgtable-2^9 of size 4096 The buggy address is located 0 bytes inside of 4096-byte region [c0000003c38e0000, c0000003c38e1000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3c38c head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:c0000003bfd63e01 flags: 0x63ffff800000040(head|node=6|zone=0|lastcpupid=0x7ffff) page_type: f5(slab) raw: 063ffff800000040 c000000140058980 5deadbeef0000122 0000000000000000 raw: 0000000000000000 0000000080200020 00000000f5000000 c0000003bfd63e01 head: 063ffff800000040 c000000140058980 5deadbeef0000122 0000000000000000 head: 0000000000000000 0000000080200020 00000000f5000000 c0000003bfd63e01 head: 063ffff800000002 c00c000000f0e301 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 page dumped because: kasan: bad access detected [ 138.953636] [ T2164] Memory state around the buggy address: [ 138.953643] [ T2164] c0000003c38dff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 138.953652] [ T2164] c0000003c38dff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 138.953661] [ T2164] >c0000003c38e0000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 138.953669] [ T2164] ^ [ 138.953675] [ T2164] c0000003c38e0080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 138.953684] [ T2164] c0000003c38e0100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 138.953692] [ T2164] ================================================================== [ 138.953701] [ T2164] Disabling lock debugging due to kernel taint The Linux kernel CVE team has assigned CVE-2026-31686 to this issue. Affected and fixed versions =========================== Issue introduced in 4.19 with commit 0207df4fa1a869281ddbf72db6203dbf036b3e1a and fixed in 6.6.136 with commit cec74b2ab7dff866b1d77eaa545b9e8fd14a1f87 Issue introduced in 4.19 with commit 0207df4fa1a869281ddbf72db6203dbf036b3e1a and fixed in 6.12.83 with commit a05f77cb227c39c5069aea6f12762a29d1e6c103 Issue introduced in 4.19 with commit 0207df4fa1a869281ddbf72db6203dbf036b3e1a and fixed in 6.18.24 with commit f6204f7ff6aff62ce6242a76982c5ba3a9ded707 Issue introduced in 4.19 with commit 0207df4fa1a869281ddbf72db6203dbf036b3e1a and fixed in 6.19.14 with commit 85d98614e089a67dc6faa8ca766fe10a639f82b4 Issue introduced in 4.19 with commit 0207df4fa1a869281ddbf72db6203dbf036b3e1a and fixed in 7.0.1 with commit b38237a2ea9c6c19836eee2c57037e1f9f103576 Issue introduced in 4.19 with commit 0207df4fa1a869281ddbf72db6203dbf036b3e1a and fixed in 7.1-rc1 with commit 51d8c78be0c27ddb91bc2c0263941d8b30a47d3b 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-31686 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/kasan/init.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/cec74b2ab7dff866b1d77eaa545b9e8fd14a1f87 https://git.kernel.org/stable/c/a05f77cb227c39c5069aea6f12762a29d1e6c103 https://git.kernel.org/stable/c/f6204f7ff6aff62ce6242a76982c5ba3a9ded707 https://git.kernel.org/stable/c/85d98614e089a67dc6faa8ca766fe10a639f82b4 https://git.kernel.org/stable/c/b38237a2ea9c6c19836eee2c57037e1f9f103576 https://git.kernel.org/stable/c/51d8c78be0c27ddb91bc2c0263941d8b30a47d3b