================================================================== BUG: KASAN: slab-use-after-free in sysfs_remove_file_ns+0x3d/0x70 fs/sysfs/file.c:510 Read of size 8 at addr ffff88802f34ba30 by task syz.1.1904/12965 CPU: 1 UID: 0 PID: 12965 Comm: syz.1.1904 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:643 [inline] bus_remove_driver+0x198/0x320 drivers/base/bus.c:781 comedi_device_detach_locked+0x178/0x750 drivers/comedi/drivers.c:207 do_devconfig_ioctl drivers/comedi/comedi_fops.c:848 [inline] comedi_unlocked_ioctl+0xcce/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:0x7fe56cb8f6c9 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:00007fe56da4c038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fe56cde6090 RCX: 00007fe56cb8f6c9 RDX: 0000000000000000 RSI: 0000000040946400 RDI: 0000000000000009 RBP: 00007fe56cc11f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fe56cde6128 R14: 00007fe56cde6090 R15: 00007fff59b80d28 Allocated by task 12924: 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:262 [inline] __kmalloc_cache_noprof+0x3e2/0x700 mm/slub.c:5775 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] vlan_info_alloc net/8021q/vlan_core.c:153 [inline] vlan_vid_add+0x145/0x760 net/8021q/vlan_core.c:329 register_vlan_dev+0x9c/0x820 net/8021q/vlan.c:157 register_vlan_device+0x3a8/0x4c0 net/8021q/vlan.c:279 vlan_ioctl_handler+0x281/0x650 net/8021q/vlan.c:647 sock_ioctl+0x610/0x790 net/socket.c:1343 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 12920: 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:584 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:2547 [inline] slab_free mm/slub.c:6642 [inline] kfree+0x19a/0x6d0 mm/slub.c:6849 rcu_do_batch kernel/rcu/tree.c:2605 [inline] rcu_core+0xcab/0x1770 kernel/rcu/tree.c:2861 handle_softirqs+0x286/0x870 kernel/softirq.c:626 __do_softirq kernel/softirq.c:660 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:727 irq_exit_rcu+0x9/0x30 kernel/softirq.c:743 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1052 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1052 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697 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:556 __call_rcu_common kernel/rcu/tree.c:3123 [inline] call_rcu+0x157/0x9c0 kernel/rcu/tree.c:3243 vlan_device_event+0xcfd/0x1ef0 net/8021q/vlan.c:511 notifier_call_chain+0x1b6/0x3e0 kernel/notifier.c:85 call_netdevice_notifiers_extack net/core/dev.c:2269 [inline] call_netdevice_notifiers net/core/dev.c:2283 [inline] unregister_netdevice_many_notify+0x1897/0x23d0 net/core/dev.c:12391 unregister_netdevice_many net/core/dev.c:12454 [inline] unregister_netdevice_queue+0x33c/0x380 net/core/dev.c:12268 unregister_netdevice include/linux/netdevice.h:3398 [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:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:44 [inline] exit_to_user_mode_loop+0xff/0x4f0 kernel/entry/common.c:75 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:159 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:194 [inline] do_syscall_64+0x2e9/0xfa0 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88802f34ba00 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 48 bytes inside of freed 256-byte region [ffff88802f34ba00, ffff88802f34bb00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2f34a 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 ffff88813fe26b40 ffffea0001e1c700 dead000000000005 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88813fe26b40 ffffea0001e1c700 dead000000000005 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000001 ffffea0000bcd281 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 5819, tgid 5819 (syz-executor), ts 83028693876, free_ts 82981521643 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+0x2365/0x2440 mm/page_alloc.c:3920 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5209 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2486 alloc_slab_page mm/slub.c:3063 [inline] allocate_slab+0x96/0x350 mm/slub.c:3236 new_slab mm/slub.c:3290 [inline] ___slab_alloc+0xf56/0x1990 mm/slub.c:4659 __slab_alloc+0x65/0x100 mm/slub.c:4782 __slab_alloc_node mm/slub.c:4858 [inline] slab_alloc_node mm/slub.c:5280 [inline] __do_kmalloc_node mm/slub.c:5653 [inline] __kmalloc_noprof+0x47d/0x800 mm/slub.c:5666 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+0xca/0x1b80 net/ipv4/fib_trie.c:1212 fib_magic+0x2c4/0x390 net/ipv4/fib_frontend.c:1134 fib_add_ifaddr+0x144/0x5f0 net/ipv4/fib_frontend.c:1156 fib_inetaddr_event+0x12e/0x190 net/ipv4/fib_frontend.c:1470 notifier_call_chain+0x1b6/0x3e0 kernel/notifier.c:85 blocking_notifier_call_chain+0x6a/0x90 kernel/notifier.c:380 __inet_insert_ifa+0xa13/0xbf0 net/ipv4/devinet.c:566 page last free pid 79 tgid 79 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0xbc8/0xd30 mm/page_alloc.c:2948 rcu_do_batch kernel/rcu/tree.c:2605 [inline] rcu_core+0xcab/0x1770 kernel/rcu/tree.c:2861 handle_softirqs+0x286/0x870 kernel/softirq.c:626 __do_softirq kernel/softirq.c:660 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:727 irq_exit_rcu+0x9/0x30 kernel/softirq.c:743 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1052 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1052 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697 Memory state around the buggy address: ffff88802f34b900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802f34b980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802f34ba00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802f34ba80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802f34bb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================