comedi comedi3: c6xdigio: I/O port conflict (0x4f27,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 ffff88807ce74e30 by task syz.7.5280/21705 CPU: 1 UID: 0 PID: 21705 Comm: syz.7.5280 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/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: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:0x7fb2c1f8eec9 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:00007fb2c2e93038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fb2c21e5fa0 RCX: 00007fb2c1f8eec9 RDX: 00002000000000c0 RSI: 0000000040946400 RDI: 0000000000000003 RBP: 00007fb2c2011f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fb2c21e6038 R14: 00007fb2c21e5fa0 R15: 00007ffd05f56b58 Allocated by task 21470: 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] __do_kmalloc_node mm/slub.c:5604 [inline] __kmalloc_noprof+0x411/0x7f0 mm/slub.c:5616 kmalloc_noprof include/linux/slab.h:961 [inline] kzalloc_noprof include/linux/slab.h:1094 [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 mpls_dev_sysctl_register+0x188/0x270 net/mpls/af_mpls.c:1405 mpls_add_dev net/mpls/af_mpls.c:1460 [inline] mpls_dev_notify+0x357/0x7a0 net/mpls/af_mpls.c:1600 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:11332 tun_set_iff+0x844/0xf00 drivers/net/tun.c:2807 __tun_chr_ioctl+0x795/0x1e10 drivers/net/tun.c:3088 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 17772: 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:2515 [inline] slab_free_freelist_hook mm/slub.c:2544 [inline] slab_free_bulk mm/slub.c:6606 [inline] kmem_cache_free_bulk+0xb2c/0xdd0 mm/slub.c:7290 kfree_bulk include/linux/slab.h:830 [inline] kvfree_rcu_bulk+0xe5/0x1f0 mm/slab_common.c:1522 kfree_rcu_work+0xed/0x170 mm/slab_common.c:1600 process_one_work kernel/workqueue.c:3263 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3346 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3427 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Last potentially related work creation: kasan_save_stack+0x3e/0x60 mm/kasan/common.c:56 kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:559 kvfree_call_rcu+0x130/0x4c0 mm/slab_common.c:1995 drop_sysctl_table+0x385/0x510 fs/proc/proc_sysctl.c:1521 drop_sysctl_table+0x39c/0x510 fs/proc/proc_sysctl.c:1524 unregister_sysctl_table+0x41/0x60 fs/proc/proc_sysctl.c:1542 mpls_dev_sysctl_unregister+0x8b/0xc0 net/mpls/af_mpls.c:1429 mpls_dev_notify+0x533/0x7a0 net/mpls/af_mpls.c:1641 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] unregister_netdevice_many_notify+0x14d7/0x1ff0 net/core/dev.c:12268 unregister_netdevice_many net/core/dev.c:12331 [inline] unregister_netdevice_queue+0x33c/0x380 net/core/dev.c:12175 unregister_netdevice include/linux/netdevice.h:3392 [inline] __tun_detach+0x6d9/0x15d0 drivers/net/tun.c:621 tun_detach drivers/net/tun.c:637 [inline] tun_chr_close+0x10a/0x1c0 drivers/net/tun.c:3436 __fput+0x44c/0xa70 fs/file_table.c:468 task_work_run+0x1d4/0x260 kernel/task_work.c:227 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop+0xe9/0x130 kernel/entry/common.c:43 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline] do_syscall_64+0x2bd/0xfa0 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88807ce74e00 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 48 bytes inside of freed 256-byte region [ffff88807ce74e00, ffff88807ce74f00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88807ce75000 pfn:0x7ce74 head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88813fe26b40 ffffea0001e37080 dead000000000002 raw: ffff88807ce75000 000000000010000e 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88813fe26b40 ffffea0001e37080 dead000000000002 head: ffff88807ce75000 000000000010000e 00000000f5000000 0000000000000000 head: 00fff00000000001 ffffea0001f39d01 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 5829, tgid 5829 (syz-executor), ts 94493241980, free_ts 94486181394 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:3031 [inline] allocate_slab+0x96/0x3a0 mm/slub.c:3204 new_slab mm/slub.c:3258 [inline] ___slab_alloc+0xe94/0x18a0 mm/slub.c:4628 __slab_alloc+0x65/0x100 mm/slub.c:4747 __slab_alloc_node mm/slub.c:4823 [inline] slab_alloc_node mm/slub.c:5234 [inline] __do_kmalloc_node mm/slub.c:5603 [inline] __kmalloc_noprof+0x471/0x7f0 mm/slub.c:5616 kmalloc_noprof include/linux/slab.h:961 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] fib_create_info+0x172d/0x3210 net/ipv4/fib_semantics.c:1402 fib_table_insert+0xc6/0x1b50 net/ipv4/fib_trie.c:1212 fib_magic+0x2c4/0x390 net/ipv4/fib_frontend.c:1134 fib_add_ifaddr+0x3fb/0x5f0 net/ipv4/fib_frontend.c:1178 fib_netdev_event+0x382/0x490 net/ipv4/fib_frontend.c:1516 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] __dev_notify_flags+0x18d/0x2e0 net/core/dev.c:-1 netif_change_flags+0xe8/0x1a0 net/core/dev.c:9705 page last free pid 5829 tgid 5829 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2906 __slab_free+0x2e7/0x390 mm/slub.c:5924 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x97/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:352 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4947 [inline] slab_alloc_node mm/slub.c:5246 [inline] __do_kmalloc_node mm/slub.c:5603 [inline] __kmalloc_noprof+0x3c3/0x7f0 mm/slub.c:5616 kmalloc_noprof include/linux/slab.h:961 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] fib6_info_alloc+0x30/0xf0 net/ipv6/ip6_fib.c:155 ip6_route_info_create+0x142/0x860 net/ipv6/route.c:3809 ip6_route_add+0x49/0x1b0 net/ipv6/route.c:3938 addrconf_add_mroute net/ipv6/addrconf.c:2552 [inline] addrconf_add_dev+0x24f/0x340 net/ipv6/addrconf.c:2570 addrconf_dev_config net/ipv6/addrconf.c:3479 [inline] addrconf_init_auto_addrs+0x57c/0xa30 net/ipv6/addrconf.c:3567 addrconf_notify+0xacc/0x1010 net/ipv6/addrconf.c:3740 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] __dev_notify_flags+0x18d/0x2e0 net/core/dev.c:-1 netif_change_flags+0xe8/0x1a0 net/core/dev.c:9705 do_setlink+0xc55/0x41c0 net/core/rtnetlink.c:3151 Memory state around the buggy address: ffff88807ce74d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807ce74d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807ce74e00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807ce74e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807ce74f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================