syzbot


KASAN: slab-use-after-free Read in bus_remove_driver

Status: upstream: reported C repro on 2025/09/24 06:31
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+f6a9069da61d382bf085@syzkaller.appspotmail.com
First crash: 81d, last: 8h18m
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [fs?] KASAN: slab-use-after-free Read in bus_remove_driver 1 (3) 2025/09/24 08:04
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 bus_remove_driver 19 5 35d 67d 0/2 upstream: reported on 2025/07/18 15:51
linux-6.1 KASAN: use-after-free Read in bus_remove_driver 19 4 37d 68d 0/3 upstream: reported on 2025/07/18 14:32
Last patch testing requests (1)
Created Duration User Patch Repo Result
2025/09/24 07:23 33m eadavis@qq.com patch linux-next OK log

Sample crash report:
comedi comedi1: c6xdigio: I/O port conflict (0x401,3)
==================================================================
BUG: KASAN: slab-use-after-free in sysfs_remove_file_ns+0x3d/0x70 fs/sysfs/file.c:510
Read of size 8 at addr ffff88814c9b5030 by task syz.0.18/6068

CPU: 0 UID: 0 PID: 6068 Comm: syz.0.18 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:378 [inline]
 print_report+0xca/0x240 mm/kasan/report.c:482
 kasan_report+0x118/0x150 mm/kasan/report.c:595
 sysfs_remove_file_ns+0x3d/0x70 fs/sysfs/file.c:510
 remove_bind_files drivers/base/bus.c:605 [inline]
 bus_remove_driver+0x198/0x2f0 drivers/base/bus.c:743
 comedi_device_detach_locked+0x178/0x750 drivers/comedi/drivers.c:207
 comedi_device_detach drivers/comedi/drivers.c:215 [inline]
 comedi_device_attach+0x5d4/0x720 drivers/comedi/drivers.c:1011
 do_devconfig_ioctl drivers/comedi/comedi_fops.c:872 [inline]
 comedi_unlocked_ioctl+0x5ff/0x1020 drivers/comedi/comedi_fops.c:2178
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]
 __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:583
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f9aee78eec9
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:00007ffe7540fbc8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f9aee9e5fa0 RCX: 00007f9aee78eec9
RDX: 0000200000000080 RSI: 0000000040946400 RDI: 0000000000000004
RBP: 00007f9aee811f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f9aee9e5fa0 R14: 00007f9aee9e5fa0 R15: 0000000000000003
 </TASK>

Allocated by task 6067:
 kasan_save_stack mm/kasan/common.c:56 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:77
 poison_kmalloc_redzone mm/kasan/common.c:400 [inline]
 __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:417
 kasan_kmalloc include/linux/kasan.h:262 [inline]
 __kmalloc_cache_noprof+0x3d5/0x6f0 mm/slub.c:5723
 kmalloc_noprof include/linux/slab.h:957 [inline]
 kzalloc_noprof include/linux/slab.h:1094 [inline]
 bus_add_driver+0x162/0x640 drivers/base/bus.c:662
 driver_register+0x23a/0x320 drivers/base/driver.c:249
 c6xdigio_attach+0x94/0x890 drivers/comedi/drivers/c6xdigio.c:253
 comedi_device_attach+0x51f/0x720 drivers/comedi/drivers.c:1007
 do_devconfig_ioctl drivers/comedi/comedi_fops.c:872 [inline]
 comedi_unlocked_ioctl+0x5ff/0x1020 drivers/comedi/comedi_fops.c:2178
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]
 __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:583
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 6067:
 kasan_save_stack mm/kasan/common.c:56 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:77
 __kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:587
 kasan_save_free_info mm/kasan/kasan.h:406 [inline]
 poison_slab_object mm/kasan/common.c:252 [inline]
 __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:284
 kasan_slab_free include/linux/kasan.h:234 [inline]
 slab_free_hook mm/slub.c:2507 [inline]
 slab_free mm/slub.c:6557 [inline]
 kfree+0x19a/0x6d0 mm/slub.c:6765
 kobject_cleanup lib/kobject.c:689 [inline]
 kobject_release lib/kobject.c:720 [inline]
 kref_put include/linux/kref.h:65 [inline]
 kobject_put+0x22b/0x480 lib/kobject.c:737
 bus_remove_driver+0x245/0x2f0 drivers/base/bus.c:749
 comedi_device_detach_locked+0x178/0x750 drivers/comedi/drivers.c:207
 comedi_device_detach drivers/comedi/drivers.c:215 [inline]
 comedi_device_attach+0x5d4/0x720 drivers/comedi/drivers.c:1011
 do_devconfig_ioctl drivers/comedi/comedi_fops.c:872 [inline]
 comedi_unlocked_ioctl+0x5ff/0x1020 drivers/comedi/comedi_fops.c:2178
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]
 __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:583
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff88814c9b5000
 which belongs to the cache kmalloc-256 of size 256
The buggy address is located 48 bytes inside of
 freed 256-byte region [ffff88814c9b5000, ffff88814c9b5100)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x14c9b4
head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0x57ff00000000040(head|node=1|zone=2|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 057ff00000000040 ffff88813fe26b40 0000000000000000 0000000000000001
raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
head: 057ff00000000040 ffff88813fe26b40 0000000000000000 0000000000000001
head: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
head: 057ff00000000001 ffffea0005326d01 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000002
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, tgid 1 (swapper/0), ts 27843801833, free_ts 0
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850
 prep_new_page mm/page_alloc.c:1858 [inline]
 get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3884
 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5183
 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416
 alloc_slab_page mm/slub.c:3023 [inline]
 allocate_slab+0x96/0x3a0 mm/slub.c:3196
 new_slab mm/slub.c:3250 [inline]
 ___slab_alloc+0xe94/0x1920 mm/slub.c:4626
 __slab_alloc+0x65/0x100 mm/slub.c:4745
 __slab_alloc_node mm/slub.c:4821 [inline]
 slab_alloc_node mm/slub.c:5232 [inline]
 __do_kmalloc_node mm/slub.c:5601 [inline]
 __kmalloc_node_track_caller_noprof+0x5c7/0x800 mm/slub.c:5711
 __do_krealloc mm/slub.c:6907 [inline]
 krealloc_node_align_noprof+0x140/0x390 mm/slub.c:6966
 add_sysfs_param+0xd4/0xa30 kernel/params.c:655
 kernel_add_sysfs_param+0x7f/0xe0 kernel/params.c:812
 param_sysfs_builtin+0x18a/0x230 kernel/params.c:851
 param_sysfs_builtin_init+0x23/0x30 kernel/params.c:987
 do_one_initcall+0x236/0x820 init/main.c:1283
 do_initcall_level+0x104/0x190 init/main.c:1345
 do_initcalls+0x59/0xa0 init/main.c:1361
page_owner free stack trace missing

Memory state around the buggy address:
 ffff88814c9b4f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88814c9b4f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88814c9b5000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                     ^
 ffff88814c9b5080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88814c9b5100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (44):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/24 06:30 linux-next ce7f1a983b07 0abd0691 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce KASAN: slab-use-after-free Read in bus_remove_driver
2025/09/22 18:17 upstream 07e27ad16399 0ac7291c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/09/22 18:16 upstream 07e27ad16399 0ac7291c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/09/17 11:12 upstream 5aca7966d2a7 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/09/13 14:14 upstream 22f20375f5b7 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/09/08 13:52 upstream 76eeb9b8de98 d291dd2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/09/08 13:43 upstream 76eeb9b8de98 d291dd2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/08/24 18:44 upstream c330cb607721 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/08/19 11:18 upstream 038d61fd6422 523f460e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/08/04 01:31 upstream 038d61fd6422 7368264b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/08/04 01:11 upstream 038d61fd6422 7368264b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/08/03 17:44 upstream 038d61fd6422 7368264b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/08/03 09:43 upstream 038d61fd6422 7368264b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/08/02 15:40 upstream 038d61fd6422 7368264b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/07/30 05:52 upstream 86aa72182095 f8f2b4da .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/07/26 02:21 upstream 327579671a9b fb8f743d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/09/23 11:59 linux-next 846bd2225ec3 0ac7291c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/09/22 22:42 linux-next 846bd2225ec3 0ac7291c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/09/22 19:32 linux-next 846bd2225ec3 0ac7291c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/09/20 19:09 linux-next 846bd2225ec3 67c37560 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/09/20 19:09 linux-next 846bd2225ec3 67c37560 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/09/20 19:09 linux-next 846bd2225ec3 67c37560 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/09/20 19:09 linux-next 846bd2225ec3 67c37560 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/09/20 19:08 linux-next 846bd2225ec3 67c37560 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/09/20 19:08 linux-next 846bd2225ec3 67c37560 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/09/17 13:58 linux-next 05af76471921 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/09/10 22:53 linux-next 5f540c4aade9 fdeaa69b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/09/10 22:53 linux-next 5f540c4aade9 fdeaa69b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/09/10 00:13 linux-next 65dd046ef558 fdeaa69b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce KASAN: slab-use-after-free Read in bus_remove_driver
2025/08/18 00:56 linux-next 931e46dcbc7e 1804e95e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce KASAN: slab-use-after-free Read in bus_remove_driver
2025/08/16 18:37 linux-next 931e46dcbc7e 1804e95e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce KASAN: slab-use-after-free Read in bus_remove_driver
2025/08/14 08:39 linux-next 931e46dcbc7e 22ec1469 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/08/10 21:42 linux-next b1549501188c 32a0e5ed .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce KASAN: slab-use-after-free Read in bus_remove_driver
2025/08/10 06:45 linux-next b1549501188c 32a0e5ed .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/08/10 06:44 linux-next b1549501188c 32a0e5ed .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/08/07 13:38 linux-next 442d93313cae 04cffc22 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/08/04 15:24 linux-next 5c5a10f0be96 7368264b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce KASAN: slab-use-after-free Read in bus_remove_driver
2025/08/03 16:51 linux-next 84b92a499e7e 7368264b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/08/03 16:44 linux-next 84b92a499e7e 7368264b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/07/18 07:55 linux-next 024e09e444bd 0d1223f1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/07/05 18:54 linux-next 26ffb3d6f02c 4f67c4ae .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in bus_remove_driver
2025/07/05 13:53 linux-next 26ffb3d6f02c 4f67c4ae .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce KASAN: slab-use-after-free Read in bus_remove_driver
2025/07/05 13:53 linux-next 26ffb3d6f02c 4f67c4ae .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce KASAN: slab-use-after-free Read in bus_remove_driver
2025/09/22 20:41 upstream 07e27ad16399 0ac7291c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: use-after-free Read in bus_remove_driver
* Struck through repros no longer work on HEAD.