CVE-2026-98515: drm/nouveau: fix double-free in nvif_vmm_dtor
In the Linux kernel, the following vulnerability has been resolved:
drm/nouveau: fix double-free in nvifvmmdtor
On failure, nouveaucliinit() calls nouveauclifini() to tear the client down. Then, nouveaudrmopen() also enters into its cleanup path and calls nouveauclifini() AGAIN. nouveauclifini() calls nouveauvmmfini():
void nouveauvmmfini(struct nouveauvmm vmm) { nouveausvmmfini(&vmm->svmm); nvifvmmdtor(&vmm->vmm); vmm->cli = NULL; }
Inside nvifvmmdtor(), vmm->page is freed unconditionally:
void nvifvmmdtor(struct nvifvmm vmm) { kfree(vmm->page); nvifobjectdtor(&vmm->object); }
vmm->page is never cleared after being freed, so the second call of nvifvmmdtor() will cause a double-free.
Found by fuzzing the nouveau driver with a modified Syzkaller:
BUG: KASAN: double-free in nvifvmmdtor+0x31/0x50 drivers/gpu/drm/nouveau/nvif/vmm.c:194 Free of addr ffff888010fcdc30 by task syz.0.173/2567
CPU: 1 UID: 0 PID: 2567 Comm: syz.0.173 Not tainted 7.2.0 #24 PREEMPT(lazy) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: <TASK> dumpstack lib/dumpstack.c:94 [inline] dumpstacklvl+0x95/0xe0 lib/dumpstack.c:120 printaddressdescription mm/kasan/report.c:378 [inline] printreport+0xcb/0x5a0 mm/kasan/report.c:482 kasanreportinvalidfree+0xaa/0xd0 mm/kasan/report.c:557 checkslaballocation+0xe4/0x110 mm/kasan/common.c:235 kasanslabprefree include/linux/kasan.h:199 [inline] slabfreehook mm/slub.c:2622 [inline] slabfree mm/slub.c:6377 [inline] kfree+0x192/0x590 mm/slub.c:6692 nvifvmmdtor+0x31/0x50 drivers/gpu/drm/nouveau/nvif/vmm.c:194 nouveauvmmfini+0x16/0x50 drivers/gpu/drm/nouveau/nouveauvmm.c:127 nouveauclifini+0x10e/0x210 drivers/gpu/drm/nouveau/nouveaudrm.c:225 nouveaudrmopen+0x24e/0x740 drivers/gpu/drm/nouveau/nouveaudrm.c:1255 drmfilealloc+0x5f2/0xad0 drivers/gpu/drm/drmfile.c:176 drmopenhelper+0x1d7/0x4a0 drivers/gpu/drm/drmfile.c:335 drmopen+0x190/0x3d0 drivers/gpu/drm/drmfile.c:388 drmstubopen+0x1f2/0x460 drivers/gpu/drm/drmdrv.c:1211 chrdevopen+0x21c/0x660 fs/chardev.c:411 dodentryopen+0x59d/0x12b0 fs/open.c:947 vfsopen+0x82/0x390 fs/open.c:1052 doopen fs/namei.c:4700 [inline] pathopenat+0x2345/0x3420 fs/namei.c:4863 dofileopen+0x207/0x460 fs/namei.c:4892 dosysopenat2+0xd1/0x1d0 fs/open.c:1368 dosysopen fs/open.c:1374 [inline] dosysopenat fs/open.c:1390 [inline] sesysopenat fs/open.c:1385 [inline] x64sysopenat+0x144/0x200 fs/open.c:1385 dosyscallx64 arch/x86/entry/syscall64.c:63 [inline] dosyscall64+0x115/0x690 arch/x86/entry/syscall64.c:94 entrySYSCALL64afterhwframe+0x77/0x7f RIP: 0033:0x7fc6d687594d Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fc6d5295008 EFLAGS: 00000246 ORIGRAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fc6d6b06180 RCX: 00007fc6d687594d RDX: 0000000000022501 RSI: 0000200000000000 RDI: ffffffffffffff9c RBP: 00007fc6d691c303 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fc6d6b06218 R14: 00007fc6d6b06180 R15: 00007ffd9451d760 </TASK>
Allocated by task 2567 on cpu 1 at 163.593900s: kasansavestack+0x24/0x50 mm/kasan/common.c:57 kasansavetrack+0x17/0x60 mm/kasan/common.c:78 poisonkmallocredzone mm/kasan/common.c:398 [inline] kasankmalloc+0xaa/0xb0 mm/kasan/common.c:415 kasankmalloc include/linux/kasan.h:263 [inline] dokmallocnode mm/slub.c:5334 [inline] kmallocnoprof+0x304/0x7c0 mm/slub.c:5359 kmallocnoprof include/linux/slab.h:992 [inline] nvifvmmctor+0x3c0/0x7e0 drivers/gpu/drm/nouveau/nvif/vmm.c:237 nouveauvmminit+0x40/0x90 drivers/gpu/drm/nouveau/nouveauvmm.c:134 nouveaucliinit+0x7b9/0 ---truncated---