================================================================== BUG: KASAN: slab-use-after-free in sysfs_remove_file_ns+0x3d/0x70 fs/sysfs/file.c:510 Read of size 8 at addr ffff88802b3a3030 by task syz.0.182/6710 CPU: 0 UID: 0 PID: 6710 Comm: syz.0.182 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/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+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: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:0x7fc0d558eba9 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:00007fc0d640f038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fc0d57d6180 RCX: 00007fc0d558eba9 RDX: 0000000000000000 RSI: 0000000040946400 RDI: 0000000000000005 RBP: 00007fc0d5611e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fc0d57d6218 R14: 00007fc0d57d6180 R15: 00007ffe26f225a8 Allocated by task 6484: 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:397 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:414 kasan_kmalloc include/linux/kasan.h:260 [inline] __kmalloc_cache_noprof+0x3d5/0x6f0 mm/slub.c:5397 kmalloc_noprof include/linux/slab.h:956 [inline] kzalloc_noprof include/linux/slab.h:1090 [inline] snd_seq_timer_new+0x55/0x730 sound/core/seq/seq_timer.c:46 queue_new sound/core/seq/seq_queue.c:104 [inline] snd_seq_queue_alloc+0x19c/0x790 sound/core/seq/seq_queue.c:164 snd_seq_ioctl_create_queue+0x7f/0x3d0 sound/core/seq/seq_clientmgr.c:1523 alloc_seq_queue sound/core/seq/oss/seq_oss_init.c:351 [inline] snd_seq_oss_open+0x5e0/0xea0 sound/core/seq/oss/seq_oss_init.c:209 odev_open+0x67/0xd0 sound/core/seq/oss/seq_oss.c:128 chrdev_open+0x4c9/0x5e0 fs/char_dev.c:414 do_dentry_open+0x953/0x13f0 fs/open.c:965 vfs_open+0x3b/0x340 fs/open.c:1095 do_open fs/namei.c:3895 [inline] path_openat+0x2ee5/0x3830 fs/namei.c:4054 do_filp_open+0x1fa/0x410 fs/namei.c:4081 do_sys_openat2+0x121/0x1c0 fs/open.c:1435 do_sys_open fs/open.c:1450 [inline] __do_sys_openat fs/open.c:1466 [inline] __se_sys_openat fs/open.c:1461 [inline] __x64_sys_openat+0x138/0x170 fs/open.c:1461 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 6483: 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+0x5b/0x80 mm/kasan/common.c:284 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2484 [inline] slab_free mm/slub.c:6121 [inline] kfree+0x199/0x6d0 mm/slub.c:6329 queue_delete sound/core/seq/seq_queue.c:133 [inline] snd_seq_queue_delete+0xca/0xf0 sound/core/seq/seq_queue.c:188 delete_seq_queue sound/core/seq/oss/seq_oss_init.c:371 [inline] snd_seq_oss_release+0x1bc/0x2e0 sound/core/seq/oss/seq_oss_init.c:416 odev_release+0x4e/0xa0 sound/core/seq/oss/seq_oss.c:141 __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+0xec/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 ffff88802b3a3000 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 48 bytes inside of freed 256-byte region [ffff88802b3a3000, ffff88802b3a3100) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88802b3a3000 pfn:0x2b3a2 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 ffffea0001f87610 ffffea0000cfaa10 raw: ffff88802b3a3000 000000000010000e 00000000f5000000 0000000000000000 head: 00fff00000000240 ffff88801a841b40 ffffea0001f87610 ffffea0000cfaa10 head: ffff88802b3a3000 000000000010000e 00000000f5000000 0000000000000000 head: 00fff00000000001 ffffea0000ace881 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 5863, tgid 5863 (syz-executor), ts 95641663206, free_ts 95613785933 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+0x21e4/0x22c0 mm/page_alloc.c:3854 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5144 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:2996 [inline] allocate_slab+0x8a/0x330 mm/slub.c:3164 new_slab mm/slub.c:3218 [inline] ___slab_alloc+0xbd1/0x13f0 mm/slub.c:4420 __slab_alloc+0x55/0xa0 mm/slub.c:4511 __slab_alloc_node mm/slub.c:4586 [inline] slab_alloc_node mm/slub.c:4996 [inline] __kmalloc_cache_noprof+0x411/0x6f0 mm/slub.c:5392 kmalloc_noprof include/linux/slab.h:956 [inline] kzalloc_noprof include/linux/slab.h:1090 [inline] ____ip_mc_inc_group+0x528/0xde0 net/ipv4/igmp.c:1535 __ip_mc_inc_group net/ipv4/igmp.c:1573 [inline] ip_mc_inc_group net/ipv4/igmp.c:1579 [inline] ip_mc_up+0x125/0x300 net/ipv4/igmp.c:1880 inetdev_event+0xfb3/0x15b0 net/ipv4/devinet.c:1630 notifier_call_chain+0x1b3/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:9666 dev_change_flags+0x130/0x260 net/core/dev_api.c:68 vlan_device_event+0x1bc2/0x1ef0 net/8021q/vlan.c:492 page last free pid 5862 tgid 5862 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:2891 pagetable_free include/linux/mm.h:2986 [inline] pagetable_dtor_free+0x2d2/0x3b0 include/linux/mm.h:3084 mm_free_pgd kernel/fork.c:556 [inline] __mmdrop+0xb5/0x570 kernel/fork.c:698 mmdrop include/linux/sched/mm.h:55 [inline] mmdrop_sched include/linux/sched/mm.h:83 [inline] mmdrop_lazy_tlb_sched include/linux/sched/mm.h:110 [inline] finish_task_switch+0x3ee/0x950 kernel/sched/core.c:5253 context_switch kernel/sched/core.c:5363 [inline] __schedule+0x17a0/0x4cc0 kernel/sched/core.c:6964 preempt_schedule_common+0x83/0xd0 kernel/sched/core.c:7148 preempt_schedule+0xae/0xc0 kernel/sched/core.c:7172 preempt_schedule_thunk+0x16/0x30 arch/x86/entry/thunk.S:12 vprintk_emit+0x561/0x590 kernel/printk/printk.c:2424 _printk+0xcf/0x120 kernel/printk/printk.c:2448 vlan_vid0_add net/8021q/vlan.c:368 [inline] vlan_device_event+0x1cb1/0x1ef0 net/8021q/vlan.c:411 notifier_call_chain+0x1b3/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:9666 do_setlink+0xc55/0x41c0 net/core/rtnetlink.c:3143 rtnl_changelink net/core/rtnetlink.c:3761 [inline] __rtnl_newlink net/core/rtnetlink.c:3920 [inline] rtnl_newlink+0x160b/0x1c70 net/core/rtnetlink.c:4057 Memory state around the buggy address: ffff88802b3a2f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802b3a2f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802b3a3000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802b3a3080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802b3a3100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================