KASAN: use-after-free Read in __setup_irq

Status: upstream: reported on 2026/11/04 10:09
Reported-by: syzbot+8bcc3eabff28a4094eee@syzkaller.appspotmail.com
First crash: 8d04h, last: 9h12m
▶ ▼ Similar bugs (2)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.6 KASAN: slab-use-after-free Read in __setup_irq 19 4 12d 50d 0/2 upstream: reported on 2026/09/23 02:54
upstream KASAN: slab-use-after-free Read in __setup_irq prio:high kernel 19 13 32d 49d 26/29 upstream: reported on 2026/09/23 23:13

Sample crash report:
tmpfs: Bad value for 'mpol'
==================================================================
BUG: KASAN: use-after-free in string_nocheck lib/vsprintf.c:642 [inline]
BUG: KASAN: use-after-free in string+0x204/0x290 lib/vsprintf.c:724
Read of size 1 at addr ffff888147248898 by task syz.1.2/4355

CPU: 1 PID: 4355 Comm: syz.1.2 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
 print_address_description+0x60/0x2d0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0xdf/0x130 mm/kasan/report.c:451
 string_nocheck lib/vsprintf.c:642 [inline]
 string+0x204/0x290 lib/vsprintf.c:724
 vsnprintf+0x10db/0x1c20 lib/vsprintf.c:2811
 vprintk_store+0x378/0x11b0 kernel/printk/printk.c:2164
 vprintk_emit+0x85/0x150 kernel/printk/printk.c:2258
 _printk+0xda/0x130 kernel/printk/printk.c:2299
 __setup_irq+0xe7e/0x1d60 kernel/irq/manage.c:1833
 request_threaded_irq+0x2bd/0x3a0 kernel/irq/manage.c:2206
 request_irq include/linux/interrupt.h:168 [inline]
 pcl818_attach+0x180/0x1480 drivers/comedi/drivers/pcl818.c:1000
 comedi_device_attach+0x522/0x710 drivers/comedi/drivers.c:1015
 do_devconfig_ioctl drivers/comedi/comedi_fops.c:868 [inline]
 comedi_unlocked_ioctl+0x674/0x1240 drivers/comedi/comedi_fops.c:2173
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fd57fcb2fd9
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fd57dedf028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fd57ff30090 RCX: 00007fd57fcb2fd9
RDX: 00002000000028c0 RSI: 0000000040946400 RDI: 0000000000000008
RBP: 00007fd57fd41fed R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fd57ff30128 R14: 00007fd57ff30090 R15: 00007fff6111c888
 </TASK>

Allocated by task 1:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 ____kasan_kmalloc mm/kasan/common.c:513 [inline]
 __kasan_kmalloc+0xaf/0xe0 mm/kasan/common.c:522
 kvasprintf+0xe3/0x1a0 lib/kasprintf.c:25
 kasprintf+0xdf/0x130 lib/kasprintf.c:59
 uart_add_one_port+0x3af/0x1d10 drivers/tty/serial/serial_core.c:2962
 serial8250_register_8250_port+0x137f/0x1a80 drivers/tty/serial/8250/8250_core.c:1094
 serial_pnp_probe+0x569/0x740 drivers/tty/serial/8250/8250_pnp.c:482
 pnp_device_probe+0x2bc/0x470 drivers/pnp/driver.c:111
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x276/0xc70 drivers/base/dd.c:595
 __driver_probe_device+0x1f5/0x390 drivers/base/dd.c:775
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:805
 __driver_attach+0x45d/0x660 drivers/base/dd.c:1184
 bus_for_each_dev+0x182/0x1f0 drivers/base/bus.c:303
 bus_add_driver+0x324/0x5d0 drivers/base/bus.c:620
 driver_register+0x32d/0x430 drivers/base/driver.c:240
 serial8250_init+0x96/0x170 drivers/tty/serial/8250/8250_core.c:1190
 do_one_initcall+0x272/0x730 init/main.c:1276
 do_initcall_level+0x13d/0x1f0 init/main.c:1349
 do_initcalls+0x4b/0x90 init/main.c:1365
 kernel_init_freeable+0x3d5/0x560 init/main.c:1589
 kernel_init+0x19/0x1b0 init/main.c:1480
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

Freed by task 4323:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:46
 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
 ____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1710 [inline]
 slab_free_freelist_hook+0xec/0x170 mm/slub.c:1736
 slab_free mm/slub.c:3504 [inline]
 kfree+0xef/0x2a0 mm/slub.c:4564
 uart_remove_one_port+0x3b6/0x7c0 drivers/tty/serial/serial_core.c:3080
 serial8250_unregister_port+0xac/0x240 drivers/tty/serial/8250/8250_core.c:1153
 pnp_device_remove+0x78/0x250 drivers/pnp/driver.c:133
 __device_release_driver drivers/base/dd.c:1247 [inline]
 device_release_driver_internal+0x44c/0x710 drivers/base/dd.c:1282
 unbind_store+0x2e2/0x300 drivers/base/bus.c:193
 kernfs_fop_write_iter+0x3a8/0x500 fs/kernfs/file.c:296
 call_write_iter include/linux/fs.h:2179 [inline]
 new_sync_write fs/read_write.c:507 [inline]
 vfs_write+0x748/0xd70 fs/read_write.c:594
 ksys_write+0x153/0x260 fs/read_write.c:647
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

The buggy address belongs to the object at ffff888147248898
 which belongs to the cache kmalloc-8 of size 8
The buggy address is located 0 bytes inside of
 8-byte region [ffff888147248898, ffff8881472488a0)
The buggy address belongs to the page:
page:ffffea00051c9200 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888147248de8 pfn:0x147248
flags: 0x57ff00000000200(slab|node=1|zone=2|lastcpupid=0x7ff)
raw: 057ff00000000200 ffffea00050bf408 ffffea00051faa08 ffff888017841280
raw: ffff888147248de8 000000000066004b 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 6176496151, free_ts 0
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x24f6/0x2670 mm/page_alloc.c:4192
 __alloc_pages+0x1ee/0x480 mm/page_alloc.c:5501
 alloc_page_interleave+0x24/0x1e0 mm/mempolicy.c:2031
 alloc_slab_page mm/slub.c:1780 [inline]
 allocate_slab mm/slub.c:1917 [inline]
 new_slab+0xc0/0x4b0 mm/slub.c:1980
 ___slab_alloc+0x807/0xdd0 mm/slub.c:3013
 __slab_alloc mm/slub.c:3100 [inline]
 slab_alloc_node mm/slub.c:3191 [inline]
 slab_alloc mm/slub.c:3233 [inline]
 __kmalloc_track_caller+0x11b/0x330 mm/slub.c:4930
 kstrdup mm/util.c:60 [inline]
 kstrdup_const+0x51/0x90 mm/util.c:83
 __kernfs_new_node+0xa8/0x6b0 fs/kernfs/dir.c:589
 kernfs_new_node+0x148/0x250 fs/kernfs/dir.c:669
 kernfs_create_dir_ns+0x40/0x120 fs/kernfs/dir.c:1005
 sysfs_create_dir_ns+0x12c/0x290 fs/sysfs/dir.c:59
 create_dir lib/kobject.c:89 [inline]
 kobject_add_internal+0x5ba/0xcd0 lib/kobject.c:263
 kobject_add_varg lib/kobject.c:398 [inline]
 kobject_add+0x160/0x230 lib/kobject.c:450
 device_add+0x470/0x1050 drivers/base/core.c:3347
 tty_register_device_attr+0x42a/0x9a0 drivers/tty/tty_io.c:3278
 tty_register_device drivers/tty/tty_io.c:3213 [inline]
 tty_register_driver+0x5d4/0xb80 drivers/tty/tty_io.c:3471
page_owner free stack trace missing

Memory state around the buggy address:
 ffff888147248780: 06 fc fc fc fc 06 fc fc fc fc 06 fc fc fc fc 00
 ffff888147248800: fc fc fc fc 00 fc fc fc fc 04 fc fc fc fc fa fc
>ffff888147248880: fc fc fc fa fc fc fc fc fb fc fc fc fc fb fc fc
                            ^
 ffff888147248900: fc fc fb fc fc fc fc fb fc fc fc fc fb fc fc fc
 ffff888147248980: fc fb fc fc fc fc fb fc fc fc fc fb fc fc fc fc
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/11/12 05:49 linux-5.15.y 29c6cdaac04a 8d68b303 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in __setup_irq
2026/11/04 10:08 linux-5.15.y 700e62ea909a 5af5b6c6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in __setup_irq
* Struck through repros no longer work on HEAD.