CVE-2026-31686

Source
https://cve.org/CVERecord?id=CVE-2026-31686
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-31686.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2026-31686
Downstream
Related
Published
2026-04-27T17:30:53.853Z
Modified
2026-05-18T05:59:54.099646301Z
Summary
mm/kasan: fix double free for kasan pXds
Details

In the Linux kernel, the following vulnerability has been resolved:

mm/kasan: fix double free for kasan pXds

kasanfreepxd() 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 pagetovirt(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 kasanremovezero_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 (NH1060012) hv:phyp pSeries Call Trace: dumpstacklvl+0x88/0xc4 (unreliable) printreport+0x214/0x63c kasanreportinvalidfree+0xe4/0x110 checkslaballocation+0x100/0x150 kmemcachefree+0x128/0x6e0 kasanremovezeroshadow+0x9c4/0xa20 memunmappages+0x2b8/0x5c0 devmactionrelease+0x54/0x70 releasenodes+0xc8/0x1a0 devresreleaseall+0xe0/0x140 deviceunbindcleanup+0x30/0x120 devicereleasedriverinternal+0x3e4/0x450 unbindstore+0xfc/0x110 drvattrstore+0x78/0xb0 sysfskfwrite+0x114/0x140 kernfsfopwriteiter+0x264/0x3f0 vfswrite+0x3bc/0x7d0 ksyswrite+0xa4/0x190 systemcallexception+0x190/0x480 systemcallvectoredcommon+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 <SF,VEC,VSX,EE,PR,FP,ME,IR,DR,RI,LE> 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 entiremapcount:0 nrpagesmapped:0 pincount:0 memcg:c0000003bfd63e01 flags: 0x63ffff800000040(head|node=6|zone=0|lastcpupid=0x7ffff) pagetype: 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

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31686.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0207df4fa1a869281ddbf72db6203dbf036b3e1a
Fixed
cec74b2ab7dff866b1d77eaa545b9e8fd14a1f87
Fixed
a05f77cb227c39c5069aea6f12762a29d1e6c103
Fixed
f6204f7ff6aff62ce6242a76982c5ba3a9ded707
Fixed
85d98614e089a67dc6faa8ca766fe10a639f82b4
Fixed
b38237a2ea9c6c19836eee2c57037e1f9f103576
Fixed
51d8c78be0c27ddb91bc2c0263941d8b30a47d3b

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-31686.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
4.19.0
Fixed
6.6.136
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.83
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.18.24
Type
ECOSYSTEM
Events
Introduced
6.19.0
Fixed
6.19.14
Type
ECOSYSTEM
Events
Introduced
6.20.0
Fixed
7.0.1

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-31686.json"