[v5.15] KASAN: use-after-free Read in bus_remove_driver

3 views
Skip to first unread message

syzbot

unread,
Oct 13, 2025, 1:49:30 PM (3 days ago) Oct 13
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 29e53a5b1c4f Linux 5.15.194
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1041c5e2580000
kernel config: https://syzkaller.appspot.com/x/.config?x=e1bb6d24ef2164eb
dashboard link: https://syzkaller.appspot.com/bug?extid=57a01880a1046e2afa63
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/8cd4e3ff852c/disk-29e53a5b.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/21e1f773622c/vmlinux-29e53a5b.xz
kernel image: https://storage.googleapis.com/syzbot-assets/8f418c0a25cc/bzImage-29e53a5b.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+57a018...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in sysfs_remove_file_ns+0x39/0x70 fs/sysfs/file.c:481
Read of size 8 at addr ffff8880775cb630 by task syz.1.1867/13659

CPU: 0 PID: 13659 Comm: syz.1.1867 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/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
sysfs_remove_file_ns+0x39/0x70 fs/sysfs/file.c:481
remove_bind_files drivers/base/bus.c:550 [inline]
bus_remove_driver+0x89/0x230 drivers/base/bus.c:674
comedi_device_detach_locked+0x16e/0x710 drivers/comedi/drivers.c:207
do_devconfig_ioctl drivers/comedi/comedi_fops.c:844 [inline]
comedi_unlocked_ioctl+0xd0b/0x1050 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:0x7fa1f7c69ec9
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:00007fa1f5ed1038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fa1f7ec0fa0 RCX: 00007fa1f7c69ec9
RDX: 0000000000000000 RSI: 0000000040946400 RDI: 0000000000000003
RBP: 00007fa1f7cecf91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fa1f7ec1038 R14: 00007fa1f7ec0fa0 R15: 00007fff9a276128
</TASK>

Allocated by task 6436:
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]
bus_add_driver+0xda/0x5a0 drivers/base/bus.c:604
driver_register+0x32d/0x430 drivers/base/driver.c:240
c6xdigio_attach+0x90/0x7d0 drivers/comedi/drivers/c6xdigio.c:254
comedi_device_attach+0x514/0x700 drivers/comedi/drivers.c:1007
do_devconfig_ioctl drivers/comedi/comedi_fops.c:868 [inline]
comedi_unlocked_ioctl+0x5a6/0x1050 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

Freed by task 13562:
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+0xea/0x170 mm/slub.c:1736
slab_free mm/slub.c:3504 [inline]
kfree+0xef/0x2a0 mm/slub.c:4564
kobject_cleanup lib/kobject.c:713 [inline]
kobject_release lib/kobject.c:744 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x21d/0x460 lib/kobject.c:761
bus_remove_driver+0x13c/0x230 drivers/base/bus.c:681
comedi_device_detach_locked+0x16e/0x710 drivers/comedi/drivers.c:207
do_devconfig_ioctl drivers/comedi/comedi_fops.c:844 [inline]
comedi_unlocked_ioctl+0xd0b/0x1050 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

Last potentially related work creation:
kasan_save_stack+0x35/0x60 mm/kasan/common.c:38
kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348
kvfree_call_rcu+0x10a/0x7c0 kernel/rcu/tree.c:3600
drop_sysctl_table+0x2fa/0x430 fs/proc/proc_sysctl.c:1685
drop_sysctl_table+0x2e9/0x430 fs/proc/proc_sysctl.c:1688
unregister_sysctl_table+0x87/0x130 fs/proc/proc_sysctl.c:1723
__addrconf_sysctl_unregister net/ipv6/addrconf.c:7130 [inline]
addrconf_sysctl_unregister net/ipv6/addrconf.c:7158 [inline]
addrconf_ifdown+0x15ed/0x1970 net/ipv6/addrconf.c:3928
addrconf_notify+0x445/0xf00 net/ipv6/addrconf.c:-1
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:391
call_netdevice_notifiers_extack net/core/dev.c:2061 [inline]
call_netdevice_notifiers net/core/dev.c:2075 [inline]
unregister_netdevice_many+0xf57/0x18f0 net/core/dev.c:11134
ieee80211_remove_interfaces+0x429/0x6d0 net/mac80211/iface.c:2160
ieee80211_unregister_hw+0x55/0x220 net/mac80211/main.c:1399
mac80211_hwsim_del_radio+0x26d/0x450 drivers/net/wireless/mac80211_hwsim.c:3473
hwsim_exit_net+0x581/0x640 drivers/net/wireless/mac80211_hwsim.c:4243
ops_exit_list net/core/net_namespace.c:172 [inline]
cleanup_net+0x6f0/0xb80 net/core/net_namespace.c:635
process_one_work+0x863/0x1000 kernel/workqueue.c:2310
worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

The buggy address belongs to the object at ffff8880775cb600
which belongs to the cache kmalloc-256 of size 256
The buggy address is located 48 bytes inside of
256-byte region [ffff8880775cb600, ffff8880775cb700)
The buggy address belongs to the page:
page:ffffea0001dd7280 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880775cbe00 pfn:0x775ca
head:ffffea0001dd7280 order:1 compound_mapcount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea00018ca588 ffffea00017e5688 ffff888016841b40
raw: ffff8880775cbe00 000000000010000b 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4186, ts 74626522284, free_ts 74562864558
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:5487
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+0x81e/0xdf0 mm/slub.c:3013
__slab_alloc mm/slub.c:3100 [inline]
slab_alloc_node mm/slub.c:3191 [inline]
__kmalloc_node+0x200/0x3b0 mm/slub.c:4456
kmalloc_node include/linux/slab.h:627 [inline]
kvmalloc_node+0x84/0x130 mm/util.c:619
kvmalloc include/linux/mm.h:816 [inline]
kvzalloc include/linux/mm.h:824 [inline]
allocate_hook_entries_size net/netfilter/core.c:61 [inline]
nf_hook_entries_grow+0x30e/0x750 net/netfilter/core.c:128
__nf_register_net_hook+0x238/0x850 net/netfilter/core.c:401
nf_register_net_hook+0xae/0x190 net/netfilter/core.c:536
nf_register_net_hooks+0x40/0x1a0 net/netfilter/core.c:552
ipt_register_table+0x4e6/0x7e0 net/ipv4/netfilter/ip_tables.c:1782
iptable_security_table_init+0x3d/0x60 net/ipv4/netfilter/iptable_security.c:53
xt_find_table_lock+0x220/0x360 net/netfilter/x_tables.c:1259
xt_request_find_table_lock+0x22/0x100 net/netfilter/x_tables.c:1284
get_info net/ipv4/netfilter/ip_tables.c:964 [inline]
do_ipt_get_ctl+0x6ed/0x1070 net/ipv4/netfilter/ip_tables.c:1660
nf_getsockopt+0x25e/0x280 net/netfilter/nf_sockopt.c:116
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1340 [inline]
free_pcp_prepare mm/page_alloc.c:1391 [inline]
free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317
free_unref_page+0x94/0x280 mm/page_alloc.c:3396
free_slab mm/slub.c:2020 [inline]
discard_slab mm/slub.c:2026 [inline]
__unfreeze_partials+0x1a5/0x200 mm/slub.c:2512
put_cpu_partial+0x12d/0x190 mm/slub.c:2592
qlist_free_all+0x35/0x90 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x150/0x160 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0x2f/0xd0 mm/kasan/common.c:444
kasan_slab_alloc include/linux/kasan.h:254 [inline]
slab_post_alloc_hook+0x4c/0x380 mm/slab.h:519
slab_alloc_node mm/slub.c:3225 [inline]
kmem_cache_alloc_node+0x12d/0x2d0 mm/slub.c:3261
__alloc_skb+0xf4/0x750 net/core/skbuff.c:415
alloc_skb include/linux/skbuff.h:1162 [inline]
netlink_alloc_large_skb net/netlink/af_netlink.c:1182 [inline]
netlink_sendmsg+0x645/0xbc0 net/netlink/af_netlink.c:1893
sock_sendmsg_nosec net/socket.c:704 [inline]
__sock_sendmsg net/socket.c:716 [inline]
____sys_sendmsg+0x5a2/0x8c0 net/socket.c:2436
___sys_sendmsg+0x1f0/0x260 net/socket.c:2490
__sys_sendmsg net/socket.c:2519 [inline]
__do_sys_sendmsg net/socket.c:2528 [inline]
__se_sys_sendmsg+0x190/0x250 net/socket.c:2526
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

Memory state around the buggy address:
ffff8880775cb500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880775cb580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880775cb600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880775cb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880775cb700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages