comedi comedi2: c6xdigio: I/O port conflict (0x3c4,3) ================================================================== BUG: KASAN: slab-use-after-free in sysfs_remove_file_ns+0x63/0x70 fs/sysfs/file.c:522 Read of size 8 at addr ffff88801f2cce30 by task syz.2.263/7088 CPU: 0 UID: 0 PID: 7088 Comm: syz.2.263 Not tainted 6.16.0-syzkaller-12187-g0227b49b5027 #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xcd/0x630 mm/kasan/report.c:482 kasan_report+0xe0/0x110 mm/kasan/report.c:595 sysfs_remove_file_ns+0x63/0x70 fs/sysfs/file.c:522 sysfs_remove_file include/linux/sysfs.h:777 [inline] driver_remove_file drivers/base/driver.c:201 [inline] driver_remove_file+0x4a/0x60 drivers/base/driver.c:197 remove_bind_files drivers/base/bus.c:605 [inline] bus_remove_driver+0x224/0x2c0 drivers/base/bus.c:743 driver_unregister+0x76/0xb0 drivers/base/driver.c:277 comedi_device_detach_locked+0x12c/0xa50 drivers/comedi/drivers.c:207 comedi_device_detach+0x67/0xb0 drivers/comedi/drivers.c:215 comedi_device_attach+0x43d/0x900 drivers/comedi/drivers.c:1010 do_devconfig_ioctl+0x1b1/0x710 drivers/comedi/comedi_fops.c:872 comedi_unlocked_ioctl+0x165d/0x2f00 drivers/comedi/comedi_fops.c:2173 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:598 [inline] __se_sys_ioctl fs/ioctl.c:584 [inline] __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:584 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fdabf58ebe9 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:00007fdac03a9038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fdabf7b6090 RCX: 00007fdabf58ebe9 RDX: 0000200000000080 RSI: 0000000040946400 RDI: 0000000000000009 RBP: 00007fdabf611e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fdabf7b6128 R14: 00007fdabf7b6090 R15: 00007fffc0556a38 Allocated by task 6997: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:388 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:405 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4365 [inline] __kmalloc_noprof+0x223/0x510 mm/slub.c:4377 kmalloc_noprof include/linux/slab.h:909 [inline] io_cache_alloc_new+0x45/0xf0 io_uring/alloc_cache.c:40 io_cache_alloc io_uring/alloc_cache.h:59 [inline] io_uring_alloc_async_data io_uring/io_uring.h:246 [inline] io_rw_alloc_async io_uring/rw.c:202 [inline] __io_prep_rw+0x21d/0x1000 io_uring/rw.c:261 io_prep_rw+0x24/0x220 io_uring/rw.c:320 io_prep_rwv io_uring/rw.c:342 [inline] io_prep_readv+0x20/0xa0 io_uring/rw.c:357 io_init_req io_uring/io_uring.c:2198 [inline] io_submit_sqe io_uring/io_uring.c:2245 [inline] io_submit_sqes+0x835/0x2590 io_uring/io_uring.c:2397 __do_sys_io_uring_enter+0xd6a/0x1630 io_uring/io_uring.c:3464 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6997: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:243 [inline] __kasan_slab_free+0x60/0x70 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+0x2b4/0x4d0 mm/slub.c:4879 io_clean_op io_uring/io_uring.c:400 [inline] io_free_batch_list io_uring/io_uring.c:1480 [inline] __io_submit_flush_completions+0x122d/0x1690 io_uring/io_uring.c:1518 io_submit_flush_completions io_uring/io_uring.h:164 [inline] ctx_flush_and_put+0x9a/0x410 io_uring/io_uring.c:1074 io_handle_tw_list+0x3c1/0x500 io_uring/io_uring.c:1114 tctx_task_work_run+0xac/0x380 io_uring/io_uring.c:1167 tctx_task_work+0x7a/0xd0 io_uring/io_uring.c:1185 task_work_run+0x150/0x240 kernel/task_work.c:227 get_signal+0x1d1/0x26d0 kernel/signal.c:2807 arch_do_signal_or_restart+0x8f/0x7d0 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop+0x84/0x110 kernel/entry/common.c:40 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+0x3f6/0x4c0 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88801f2cce00 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 48 bytes inside of freed 256-byte region [ffff88801f2cce00, ffff88801f2ccf00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1f2cc head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b841b40 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b841b40 0000000000000000 dead000000000001 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000001 ffffea00007cb301 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 6062, tgid 6059 (syz.0.17), ts 351004252148, free_ts 350997909476 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x132b/0x38e0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:5148 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:2487 [inline] allocate_slab mm/slub.c:2655 [inline] new_slab+0x247/0x330 mm/slub.c:2709 ___slab_alloc+0xcf2/0x1740 mm/slub.c:3891 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3981 __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+0x2f2/0x510 mm/slub.c:4377 kmalloc_noprof include/linux/slab.h:909 [inline] kmalloc_array_noprof include/linux/slab.h:948 [inline] __list_lru_init+0xe8/0x4c0 mm/list_lru.c:588 alloc_super+0x904/0xbd0 fs/super.c:391 sget_fc+0x116/0xc20 fs/super.c:761 vfs_get_super fs/super.c:1320 [inline] get_tree_nodev+0x28/0x190 fs/super.c:1344 fuse_get_tree+0x271/0x640 fs/fuse/inode.c:1985 vfs_get_tree+0x8e/0x340 fs/super.c:1815 do_new_mount fs/namespace.c:3805 [inline] path_mount+0x1482/0x1fd0 fs/namespace.c:4120 do_mount fs/namespace.c:4133 [inline] __do_sys_mount fs/namespace.c:4344 [inline] __se_sys_mount fs/namespace.c:4321 [inline] __x64_sys_mount+0x28d/0x310 fs/namespace.c:4321 page last free pid 6062 tgid 6059 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0x7d5/0x10f0 mm/page_alloc.c:2895 discard_slab mm/slub.c:2753 [inline] __put_partials+0x165/0x1c0 mm/slub.c:3218 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4d/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:340 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4180 [inline] slab_alloc_node mm/slub.c:4229 [inline] __do_kmalloc_node mm/slub.c:4364 [inline] __kmalloc_node_track_caller_noprof+0x1d3/0x510 mm/slub.c:4384 memdup_user+0x2a/0xe0 mm/util.c:221 strndup_user+0x78/0xe0 mm/util.c:280 copy_mount_string fs/namespace.c:4028 [inline] __do_sys_mount fs/namespace.c:4329 [inline] __se_sys_mount fs/namespace.c:4321 [inline] __x64_sys_mount+0x137/0x310 fs/namespace.c:4321 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88801f2ccd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801f2ccd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801f2cce00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801f2cce80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801f2ccf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================