================================================================== BUG: KASAN: slab-use-after-free in sysfs_remove_file_ns+0x3d/0x70 fs/sysfs/file.c:510 Read of size 8 at addr ffff88805cc4d830 by task syz.9.5029/22637 CPU: 1 UID: 0 PID: 22637 Comm: syz.9.5029 Not tainted syzkaller #0 PREEMPT_{RT,(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+0x19b/0x300 drivers/base/bus.c:743 comedi_device_detach_locked+0x178/0x750 drivers/comedi/drivers.c:207 do_devconfig_ioctl drivers/comedi/comedi_fops.c:848 [inline] comedi_unlocked_ioctl+0xce4/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:0x7fc6d25deec9 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:00007fc6d07fc038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fc6d2836180 RCX: 00007fc6d25deec9 RDX: 0000000000000000 RSI: 0000000040946400 RDI: 0000000000000009 RBP: 00007fc6d2661f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fc6d2836218 R14: 00007fc6d2836180 R15: 00007ffe23ca6068 Allocated by task 20696: 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+0x233/0x7d0 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 addrconf_f6i_alloc+0x1d2/0x450 net/ipv6/route.c:4678 ipv6_add_addr+0x56e/0x10e0 net/ipv6/addrconf.c:1126 add_addr+0x8b/0x2f0 net/ipv6/addrconf.c:3201 add_v4_addrs+0x70c/0xbd0 net/ipv6/addrconf.c:3263 addrconf_sit_config net/ipv6/addrconf.c:3516 [inline] addrconf_init_auto_addrs+0x2c4/0xa30 net/ipv6/addrconf.c:3554 addrconf_notify+0xacc/0x1010 net/ipv6/addrconf.c:3740 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:9705 do_setlink+0xc55/0x41c0 net/core/rtnetlink.c:3151 rtnl_changelink net/core/rtnetlink.c:3769 [inline] __rtnl_newlink net/core/rtnetlink.c:3928 [inline] rtnl_newlink+0x1619/0x1c80 net/core/rtnetlink.c:4065 rtnetlink_rcv_msg+0x7cc/0xb70 net/core/rtnetlink.c:6954 netlink_rcv_skb+0x208/0x470 net/netlink/af_netlink.c:2552 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x846/0xa10 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1896 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:742 __sys_sendto+0x3c7/0x520 net/socket.c:2244 __do_sys_sendto net/socket.c:2251 [inline] __se_sys_sendto net/socket.c:2247 [inline] __x64_sys_sendto+0xde/0x100 net/socket.c:2247 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 20: 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 mm/slub.c:6574 [inline] kfree+0x197/0x950 mm/slub.c:6781 rcu_do_batch kernel/rcu/tree.c:2605 [inline] rcu_core kernel/rcu/tree.c:2861 [inline] rcu_cpu_kthread+0xbf6/0x1b50 kernel/rcu/tree.c:2949 smpboot_thread_fn+0x53f/0xa60 kernel/smpboot.c:160 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x4b9/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 __call_rcu_common kernel/rcu/tree.c:3123 [inline] call_rcu+0x157/0x9c0 kernel/rcu/tree.c:3243 call_rcu_hurry include/linux/rcupdate.h:115 [inline] fib6_info_release include/net/ip6_fib.h:344 [inline] __ip6_del_rt+0x132/0x1a0 net/ipv6/route.c:3969 ip6_del_rt+0xb3/0x100 net/ipv6/route.c:3980 __ipv6_ifa_notify+0x5c7/0xac0 net/ipv6/addrconf.c:6310 addrconf_ifdown+0xfb0/0x18c0 net/ipv6/addrconf.c:3977 addrconf_notify+0x1bc/0x1010 net/ipv6/addrconf.c:-1 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] netif_close_many+0x29c/0x410 net/core/dev.c:1784 unregister_netdevice_many_notify+0x7b9/0x1fe0 net/core/dev.c:12224 ops_exit_rtnl_list net/core/net_namespace.c:187 [inline] ops_undo_list+0x3dc/0x990 net/core/net_namespace.c:248 cleanup_net+0x4de/0x820 net/core/net_namespace.c:695 process_one_work kernel/workqueue.c:3263 [inline] process_scheduled_works+0xade/0x17b0 kernel/workqueue.c:3346 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3427 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x4b9/0x870 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff88805cc4d800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 48 bytes inside of freed 512-byte region [ffff88805cc4d800, ffff88805cc4da00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5cc4c head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0x80000000000040(head|node=0|zone=1) page_type: f5(slab) raw: 0080000000000040 ffff88813ff26c80 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 0080000000000040 ffff88813ff26c80 0000000000000000 dead000000000001 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 0080000000000002 ffffea0001731301 00000000ffffffff 00000000ffffffff head: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000004 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 9, tgid 9 (kworker/0:0), ts 91110410014, free_ts 0 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+0x28c0/0x2960 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5183 alloc_pages_mpol+0xd1/0x380 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+0xb12/0x13f0 mm/slub.c:4628 __slab_alloc+0xc6/0x1f0 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+0x14b/0x7d0 mm/slub.c:5616 kmalloc_noprof include/linux/slab.h:961 [inline] switchdev_deferred_enqueue+0x2d/0x260 net/switchdev/switchdev.c:117 br_switchdev_host_mdb_one net/bridge/br_switchdev.c:567 [inline] br_switchdev_host_mdb net/bridge/br_switchdev.c:582 [inline] br_switchdev_mdb_notify+0x25e/0x410 net/bridge/br_switchdev.c:657 __br_mdb_notify+0x73/0x970 net/bridge/br_mdb.c:532 br_multicast_host_join net/bridge/br_multicast.c:1482 [inline] __br_multicast_add_group+0x84f/0xa30 net/bridge/br_multicast.c:1525 br_multicast_add_group net/bridge/br_multicast.c:1569 [inline] br_ip6_multicast_add_group net/bridge/br_multicast.c:1621 [inline] br_ip6_multicast_mld2_report net/bridge/br_multicast.c:3047 [inline] br_multicast_ipv6_rcv net/bridge/br_multicast.c:3985 [inline] br_multicast_rcv+0x3a5f/0x74b0 net/bridge/br_multicast.c:4043 br_dev_xmit+0xaf7/0x1840 net/bridge/br_device.c:98 __netdev_start_xmit include/linux/netdevice.h:5248 [inline] netdev_start_xmit include/linux/netdevice.h:5257 [inline] xmit_one net/core/dev.c:3845 [inline] dev_hard_start_xmit+0x2ed/0x870 net/core/dev.c:3861 __dev_queue_xmit+0x1b50/0x3b70 net/core/dev.c:4763 page_owner free stack trace missing Memory state around the buggy address: ffff88805cc4d700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805cc4d780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88805cc4d800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805cc4d880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805cc4d900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================