syzbot


KASAN: use-after-free Read in remove_wait_queue

Status: upstream: reported C repro on 2025/08/03 00:30
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+ccf20f8a60140d349005@syzkaller.appspotmail.com
First crash: 26d, last: 4d18h
Bug presence (2)
Date Name Commit Repro Result
2025/08/08 linux-5.15.y (ToT) c79648372d02 syz [report] KASAN: use-after-free Read in remove_wait_queue
2025/08/08 upstream (ToT) 37816488247d syz Didn't crash
Similar bugs (11)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in remove_wait_queue (3) kernfs 19 C inconclusive 123 955d 1381d 22/29 fixed on 2023/02/24 13:50
linux-4.14 KASAN: use-after-free Read in remove_wait_queue (2) 19 C error 7 1273d 1969d 0/1 upstream: reported C repro on 2020/04/07 06:03
upstream KASAN: use-after-free Read in remove_wait_queue (2) fs 19 C 4 2728d 2738d 5/29 fixed on 2018/06/07 13:52
android-49 KASAN: use-after-free Read in remove_wait_queue 19 C 6 2745d 2755d 2/3 fixed on 2018/03/05 12:02
linux-6.1 KASAN: use-after-free Read in remove_wait_queue origin:lts-only 19 C inconclusive 24 4d15h 26d 0/3 upstream: reported C repro on 2025/08/03 01:02
linux-4.14 KASAN: use-after-free Read in remove_wait_queue 19 1 2194d 2194d 0/1 auto-closed as invalid on 2019/12/24 15:10
upstream KASAN: use-after-free Read in remove_wait_queue fs 19 C 7 2744d 2754d 4/29 fixed on 2018/02/26 20:04
linux-4.19 BUG: corrupted list in remove_wait_queue 8 C 31139 905d 2332d 0/1 upstream: reported C repro on 2019/04/10 16:06
upstream KASAN: slab-use-after-free Read in remove_wait_queue input usb 19 3 797d 798d 0/29 auto-obsoleted due to no activity on 2023/10/01 17:55
linux-6.6 KASAN: slab-use-after-free Read in remove_wait_queue 19 syz 13 14h54m 25d 0/2 upstream: reported syz repro on 2025/08/03 17:42
upstream BUG: corrupted list in remove_wait_queue (2) fs 19 C done 51 7d08h 218d 0/29 upstream: reported C repro on 2025/01/22 23:27

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __lock_acquire+0xf7/0x7c60 kernel/locking/lockdep.c:4882
Read of size 8 at addr ffff88802842f8b8 by task syz.0.17/4477

CPU: 0 PID: 4477 Comm: syz.0.17 Not tainted 5.15.189-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x230 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
 __lock_acquire+0xf7/0x7c60 kernel/locking/lockdep.c:4882
 lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162
 remove_wait_queue+0x20/0x120 kernel/sched/wait.c:55
 free_poll_entry fs/select.c:134 [inline]
 poll_freewait+0x99/0x210 fs/select.c:143
 do_sys_poll+0xda0/0x1100 fs/select.c:1015
 __do_sys_ppoll fs/select.c:1120 [inline]
 __se_sys_ppoll+0x1fc/0x260 fs/select.c:1100
 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:0x7f74527e4be9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f7451e54038 EFLAGS: 00000246 ORIG_RAX: 000000000000010f
RAX: ffffffffffffffda RBX: 00007f7452a0bfa0 RCX: 00007f74527e4be9
RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000200000000100
RBP: 00007f7452867e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f7452a0c038 R14: 00007f7452a0bfa0 R15: 00007ffd81b415e8
 </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+0xb5/0xf0 mm/kasan/common.c:522
 kmalloc include/linux/slab.h:604 [inline]
 kzalloc include/linux/slab.h:735 [inline]
 __comedi_device_postconfig_async drivers/comedi/drivers.c:664 [inline]
 __comedi_device_postconfig drivers/comedi/drivers.c:721 [inline]
 comedi_device_postconfig+0x496/0xc50 drivers/comedi/drivers.c:756
 comedi_auto_config+0x265/0x3a0 drivers/comedi/drivers.c:1069
 comedi_test_init+0x8f/0x130 drivers/comedi/drivers/comedi_test.c:834
 do_one_initcall+0x1ee/0x680 init/main.c:1302
 do_initcall_level+0x137/0x1f0 init/main.c:1375
 do_initcalls+0x4b/0x90 init/main.c:1391
 kernel_init_freeable+0x3ce/0x560 init/main.c:1615
 kernel_init+0x19/0x1b0 init/main.c:1506
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

Freed by task 4480:
 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:1705 [inline]
 slab_free_freelist_hook+0xea/0x170 mm/slub.c:1731
 slab_free mm/slub.c:3499 [inline]
 kfree+0xef/0x2a0 mm/slub.c:4559
 comedi_device_detach_cleanup drivers/comedi/drivers.c:172 [inline]
 comedi_device_detach+0x35f/0x6e0 drivers/comedi/drivers.c:208
 do_devconfig_ioctl drivers/comedi/comedi_fops.c:829 [inline]
 comedi_unlocked_ioctl+0xbd0/0xe90 drivers/comedi/comedi_fops.c:2131
 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

The buggy address belongs to the object at ffff88802842f800
 which belongs to the cache kmalloc-256 of size 256
The buggy address is located 184 bytes inside of
 256-byte region [ffff88802842f800, ffff88802842f900)
The buggy address belongs to the page:
page:ffffea0000a10b80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2842e
head:ffffea0000a10b80 order:1 compound_mapcount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888016841b40
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, ts 9700787042, free_ts 0
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192
 __alloc_pages+0x1e1/0x470 mm/page_alloc.c:5474
 alloc_page_interleave+0x24/0x1e0 mm/mempolicy.c:2031
 alloc_slab_page mm/slub.c:1775 [inline]
 allocate_slab mm/slub.c:1912 [inline]
 new_slab+0xc0/0x4b0 mm/slub.c:1975
 ___slab_alloc+0x81e/0xdf0 mm/slub.c:3008
 __slab_alloc mm/slub.c:3095 [inline]
 slab_alloc_node mm/slub.c:3186 [inline]
 slab_alloc mm/slub.c:3228 [inline]
 kmem_cache_alloc_trace+0x1a5/0x2a0 mm/slub.c:3245
 kmalloc include/linux/slab.h:604 [inline]
 kzalloc include/linux/slab.h:735 [inline]
 bus_add_driver+0xda/0x5a0 drivers/base/bus.c:604
 driver_register+0x32d/0x430 drivers/base/driver.c:240
 __hid_register_driver+0x126/0x170 drivers/hid/hid-core.c:2578
 cmedia_init+0x1c/0x80 drivers/hid/hid-cmedia.c:229
 do_one_initcall+0x1ee/0x680 init/main.c:1302
 do_initcall_level+0x137/0x1f0 init/main.c:1375
 do_initcalls+0x4b/0x90 init/main.c:1391
 kernel_init_freeable+0x3ce/0x560 init/main.c:1615
 kernel_init+0x19/0x1b0 init/main.c:1506
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
page_owner free stack trace missing

Memory state around the buggy address:
 ffff88802842f780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88802842f800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88802842f880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                        ^
 ffff88802842f900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88802842f980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (25):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/08/24 09:02 linux-5.15.y c79648372d02 bf27483f .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/03 10:13 linux-5.15.y c79648372d02 7368264b .config console log report syz / log [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/03 08:02 linux-5.15.y c79648372d02 7368264b .config console log report syz / log [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/03 06:15 linux-5.15.y c79648372d02 7368264b .config console log report syz / log [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/03 03:54 linux-5.15.y c79648372d02 7368264b .config console log report syz / log [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/03 02:46 linux-5.15.y c79648372d02 7368264b .config console log report syz / log [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/03 01:39 linux-5.15.y c79648372d02 7368264b .config console log report syz / log [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/24 08:43 linux-5.15.y c79648372d02 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/24 08:41 linux-5.15.y c79648372d02 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/20 11:20 linux-5.15.y c79648372d02 79512909 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/20 11:19 linux-5.15.y c79648372d02 79512909 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/20 10:24 linux-5.15.y c79648372d02 79512909 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/20 10:24 linux-5.15.y c79648372d02 79512909 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/19 21:52 linux-5.15.y c79648372d02 254a27c1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/19 21:32 linux-5.15.y c79648372d02 254a27c1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/19 21:31 linux-5.15.y c79648372d02 254a27c1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/19 11:33 linux-5.15.y c79648372d02 523f460e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/19 11:33 linux-5.15.y c79648372d02 523f460e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/15 14:00 linux-5.15.y c79648372d02 1804e95e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/15 13:59 linux-5.15.y c79648372d02 1804e95e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/12 23:22 linux-5.15.y c79648372d02 22ec1469 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/03 00:50 linux-5.15.y c79648372d02 7368264b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/03 00:50 linux-5.15.y c79648372d02 7368264b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/03 00:30 linux-5.15.y c79648372d02 7368264b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
2025/08/03 00:30 linux-5.15.y c79648372d02 7368264b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in remove_wait_queue
* Struck through repros no longer work on HEAD.