comedi comedi3: c6xdigio: I/O port conflict (0x2,3) ================================================================== BUG: KASAN: slab-use-after-free in sysfs_remove_file_ns+0x3d/0x70 fs/sysfs/file.c:522 Read of size 8 at addr ffff88805c4eba30 by task syz.6.7308/11180 CPU: 1 UID: 0 PID: 11180 Comm: syz.6.7308 Not tainted 6.16.0-next-20250804-syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: 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:522 remove_bind_files drivers/base/bus.c:605 [inline] bus_remove_driver+0x198/0x2f0 drivers/base/bus.c:743 comedi_device_detach_locked+0x175/0x750 drivers/comedi/drivers.c:207 comedi_device_detach drivers/comedi/drivers.c:215 [inline] comedi_device_attach+0x5d4/0x720 drivers/comedi/drivers.c:1010 do_devconfig_ioctl drivers/comedi/comedi_fops.c:872 [inline] comedi_unlocked_ioctl+0x5ff/0x1020 drivers/comedi/comedi_fops.c:2173 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:598 [inline] __se_sys_ioctl+0xf9/0x170 fs/ioctl.c:584 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f721df8eb69 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:00007f721ed8a038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f721e1b5fa0 RCX: 00007f721df8eb69 RDX: 00002000000000c0 RSI: 0000000040946400 RDI: 0000000000000006 RBP: 00007f721e011df1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f721e1b5fa0 R15: 00007ffecfddfc08 Allocated by task 11082: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:388 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:405 kasan_kmalloc include/linux/kasan.h:260 [inline] __kmalloc_cache_noprof+0x230/0x3d0 mm/slub.c:4396 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [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:1006 do_devconfig_ioctl drivers/comedi/comedi_fops.c:872 [inline] comedi_unlocked_ioctl+0x5ff/0x1020 drivers/comedi/comedi_fops.c:2173 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:598 [inline] __se_sys_ioctl+0xf9/0x170 fs/ioctl.c:584 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 11180: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:243 [inline] __kasan_slab_free+0x5b/0x80 mm/kasan/common.c:275 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2417 [inline] slab_free mm/slub.c:4680 [inline] kfree+0x18e/0x440 mm/slub.c:4879 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+0x175/0x750 drivers/comedi/drivers.c:207 do_devconfig_ioctl drivers/comedi/comedi_fops.c:848 [inline] comedi_unlocked_ioctl+0xcde/0x1020 drivers/comedi/comedi_fops.c:2173 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:598 [inline] __se_sys_ioctl+0xf9/0x170 fs/ioctl.c:584 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88805c4eba00 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 48 bytes inside of freed 256-byte region [ffff88805c4eba00, ffff88805c4ebb00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88805c4eac00 pfn:0x5c4ea head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801a841b40 ffffea00016d6410 ffffea000167f610 raw: ffff88805c4eac00 000000000010000d 00000000f5000000 0000000000000000 head: 00fff00000000240 ffff88801a841b40 ffffea00016d6410 ffffea000167f610 head: ffff88805c4eac00 000000000010000d 00000000f5000000 0000000000000000 head: 00fff00000000001 ffffea0001713a81 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 5862, tgid 5862 (syz-executor), ts 80885746236, free_ts 25807527633 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:2487 [inline] allocate_slab+0x8a/0x370 mm/slub.c:2655 new_slab mm/slub.c:2709 [inline] ___slab_alloc+0xbeb/0x1410 mm/slub.c:3891 __slab_alloc mm/slub.c:3981 [inline] __slab_alloc_node mm/slub.c:4056 [inline] slab_alloc_node mm/slub.c:4217 [inline] __do_kmalloc_node mm/slub.c:4364 [inline] __kmalloc_noprof+0x305/0x4f0 mm/slub.c:4377 kmalloc_noprof include/linux/slab.h:909 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] new_dir fs/proc/proc_sysctl.c:966 [inline] get_subdir fs/proc/proc_sysctl.c:1010 [inline] sysctl_mkdir_p fs/proc/proc_sysctl.c:1320 [inline] __register_sysctl_table+0xba1/0x1340 fs/proc/proc_sysctl.c:1395 __addrconf_sysctl_register+0x328/0x4c0 net/ipv6/addrconf.c:7321 addrconf_sysctl_register+0x168/0x1c0 net/ipv6/addrconf.c:7369 ipv6_add_dev+0xd46/0x1370 net/ipv6/addrconf.c:460 addrconf_notify+0x794/0x1010 net/ipv6/addrconf.c:3650 notifier_call_chain+0x1b6/0x3e0 kernel/notifier.c:85 call_netdevice_notifiers_extack net/core/dev.c:2267 [inline] call_netdevice_notifiers net/core/dev.c:2281 [inline] register_netdevice+0x1608/0x1ae0 net/core/dev.c:11235 veth_newlink+0x5cc/0xa50 drivers/net/veth.c:1884 rtnl_newlink_create+0x310/0xb00 net/core/rtnetlink.c:3825 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2895 __free_pages mm/page_alloc.c:5260 [inline] free_contig_range+0x1bd/0x4a0 mm/page_alloc.c:7091 destroy_args+0x69/0x660 mm/debug_vm_pgtable.c:958 debug_vm_pgtable+0x39f/0x3b0 mm/debug_vm_pgtable.c:1345 do_one_initcall+0x233/0x820 init/main.c:1269 do_initcall_level+0x104/0x190 init/main.c:1331 do_initcalls+0x59/0xa0 init/main.c:1347 kernel_init_freeable+0x334/0x4b0 init/main.c:1579 kernel_init+0x1d/0x1d0 init/main.c:1469 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff88805c4eb900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805c4eb980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88805c4eba00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805c4eba80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805c4ebb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================