================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline] BUG: KASAN: use-after-free in atomic_try_cmpxchg_acquire include/asm-generic/atomic-instrumented.h:705 [inline] BUG: KASAN: use-after-free in queued_spin_lock include/asm-generic/qspinlock.h:82 [inline] BUG: KASAN: use-after-free in do_raw_spin_lock include/linux/spinlock.h:183 [inline] BUG: KASAN: use-after-free in __raw_spin_lock_bh include/linux/spinlock_api_smp.h:136 [inline] BUG: KASAN: use-after-free in _raw_spin_lock_bh+0x81/0xe0 kernel/locking/spinlock.c:175 Write of size 4 at addr ffff8881085b5b14 by task kworker/u4:6/4197 CPU: 1 PID: 4197 Comm: kworker/u4:6 Tainted: G W 5.10.236-syzkaller-00012-gab07aeb2c93d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Workqueue: netns cleanup_net Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:77 dump_stack_lvl+0x169/0x1d8 lib/dump_stack.c:118 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0xe2/0x130 mm/kasan/report.c:452 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x280/0x290 mm/kasan/generic.c:189 __kasan_check_write+0x14/0x20 mm/kasan/shadow.c:37 instrument_atomic_read_write include/linux/instrumented.h:101 [inline] atomic_try_cmpxchg_acquire include/asm-generic/atomic-instrumented.h:705 [inline] queued_spin_lock include/asm-generic/qspinlock.h:82 [inline] do_raw_spin_lock include/linux/spinlock.h:183 [inline] __raw_spin_lock_bh include/linux/spinlock_api_smp.h:136 [inline] _raw_spin_lock_bh+0x81/0xe0 kernel/locking/spinlock.c:175 spin_lock_bh include/linux/spinlock.h:359 [inline] __ip6_del_rt+0x8f/0x150 net/ipv6/route.c:3791 ip6_del_rt+0xb0/0xf0 net/ipv6/route.c:3807 __remove_nexthop_fib+0x1e8/0x260 net/ipv4/nexthop.c:885 __remove_nexthop net/ipv4/nexthop.c:893 [inline] remove_nexthop+0x75/0x4d0 net/ipv4/nexthop.c:919 remove_nh_grp_entry net/ipv4/nexthop.c:797 [inline] remove_nexthop_from_groups+0x193/0xe40 net/ipv4/nexthop.c:846 __remove_nexthop net/ipv4/nexthop.c:904 [inline] remove_nexthop+0x38a/0x4d0 net/ipv4/nexthop.c:919 flush_all_nexthops net/ipv4/nexthop.c:1237 [inline] nexthop_net_exit+0x3a/0xa0 net/ipv4/nexthop.c:2012 ops_exit_list net/core/net_namespace.c:185 [inline] cleanup_net+0x586/0xb70 net/core/net_namespace.c:609 process_one_work+0x6e1/0xba0 kernel/workqueue.c:2301 worker_thread+0xa6a/0x13b0 kernel/workqueue.c:2447 kthread+0x346/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Allocated by task 6045: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:430 [inline] ____kasan_kmalloc mm/kasan/common.c:509 [inline] __kasan_kmalloc+0xda/0x110 mm/kasan/common.c:518 kasan_kmalloc include/linux/kasan.h:254 [inline] kmem_cache_alloc_trace+0x184/0x2e0 mm/slub.c:2974 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:664 [inline] fib6_net_init+0x217/0x880 net/ipv6/ip6_fib.c:2376 ops_init+0x1ba/0x4a0 net/core/net_namespace.c:144 setup_net+0x36d/0xb50 net/core/net_namespace.c:345 copy_net_ns+0x314/0x520 net/core/net_namespace.c:486 create_new_namespaces+0x3a2/0x650 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x120/0x170 kernel/nsproxy.c:231 ksys_unshare+0x4ac/0x7d0 kernel/fork.c:3080 __do_sys_unshare kernel/fork.c:3148 [inline] __se_sys_unshare kernel/fork.c:3146 [inline] __x64_sys_unshare+0x38/0x40 kernel/fork.c:3146 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 4197: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4a/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x125/0x160 mm/kasan/common.c:362 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370 kasan_slab_free include/linux/kasan.h:220 [inline] slab_free_hook mm/slub.c:1595 [inline] slab_free_freelist_hook+0xc5/0x190 mm/slub.c:1621 slab_free mm/slub.c:3203 [inline] kfree+0xc0/0x270 mm/slub.c:4191 fib6_free_table net/ipv6/ip6_fib.c:214 [inline] fib6_net_exit+0x270/0x300 net/ipv6/ip6_fib.c:2430 ops_exit_list net/core/net_namespace.c:185 [inline] cleanup_net+0x586/0xb70 net/core/net_namespace.c:609 process_one_work+0x6e1/0xba0 kernel/workqueue.c:2301 worker_thread+0xa6a/0x13b0 kernel/workqueue.c:2447 kthread+0x346/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Last potentially related work creation: kasan_save_stack+0x3a/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd2/0x100 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 kvfree_call_rcu+0x10c/0x620 kernel/rcu/tree.c:3535 drop_sysctl_table+0x2ef/0x410 fs/proc/proc_sysctl.c:1680 unregister_sysctl_table+0x75/0x120 fs/proc/proc_sysctl.c:1718 unregister_net_sysctl_table+0x15/0x20 net/sysctl_net.c:127 xfrm4_net_sysctl_exit net/ipv4/xfrm4_policy.c:207 [inline] xfrm4_net_exit+0x63/0xa0 net/ipv4/xfrm4_policy.c:241 ops_exit_list net/core/net_namespace.c:185 [inline] cleanup_net+0x586/0xb70 net/core/net_namespace.c:609 process_one_work+0x6e1/0xba0 kernel/workqueue.c:2301 worker_thread+0xa6a/0x13b0 kernel/workqueue.c:2447 kthread+0x346/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Second to last potentially related work creation: kasan_save_stack+0x3a/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd2/0x100 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 __call_rcu kernel/rcu/tree.c:2976 [inline] call_rcu+0x105/0x1040 kernel/rcu/tree.c:3050 inet_free_ifa net/ipv4/devinet.c:231 [inline] inetdev_destroy net/ipv4/devinet.c:321 [inline] inetdev_event+0x66d/0x1030 net/ipv4/devinet.c:1613 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0x90/0x100 kernel/notifier.c:410 call_netdevice_notifiers_info net/core/dev.c:2054 [inline] call_netdevice_notifiers_extack net/core/dev.c:2066 [inline] call_netdevice_notifiers net/core/dev.c:2080 [inline] unregister_netdevice_many+0xf8b/0x1980 net/core/dev.c:10766 default_device_exit_batch+0x330/0x390 net/core/dev.c:11286 ops_exit_list net/core/net_namespace.c:190 [inline] cleanup_net+0x5fb/0xb70 net/core/net_namespace.c:609 process_one_work+0x6e1/0xba0 kernel/workqueue.c:2301 worker_thread+0xa6a/0x13b0 kernel/workqueue.c:2447 kthread+0x346/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 The buggy address belongs to the object at ffff8881085b5b00 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 20 bytes inside of 128-byte region [ffff8881085b5b00, ffff8881085b5b80) The buggy address belongs to the page: page:ffffea0004216d40 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8881085b5000 pfn:0x1085b5 flags: 0x4000000000000200(slab) raw: 4000000000000200 ffffea000421e348 ffffea0004076088 ffff888100043500 raw: ffff8881085b5000 000000000010000f 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 1091266749, free_ts 0 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x179/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2235/0x23d0 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x268/0x5f0 mm/page_alloc.c:5349 alloc_slab_page mm/slub.c:-1 [inline] allocate_slab mm/slub.c:1808 [inline] new_slab+0x84/0x3f0 mm/slub.c:1869 new_slab_objects mm/slub.c:2627 [inline] ___slab_alloc+0x2a6/0x450 mm/slub.c:2791 __slab_alloc+0x63/0xa0 mm/slub.c:2831 slab_alloc_node mm/slub.c:2913 [inline] slab_alloc mm/slub.c:2955 [inline] __kmalloc_track_caller+0x1ef/0x320 mm/slub.c:4536 __do_krealloc mm/slab_common.c:1103 [inline] krealloc+0x6a/0x110 mm/slab_common.c:1136 add_sysfs_param+0xce/0x830 kernel/params.c:651 kernel_add_sysfs_param+0xb3/0x128 kernel/params.c:812 param_sysfs_builtin+0x164/0x1d9 kernel/params.c:851 param_sysfs_init+0x6a/0x6f kernel/params.c:972 do_one_initcall+0x187/0x510 init/main.c:1197 do_initcall_level+0x16f/0x2cf init/main.c:1270 do_initcalls+0x50/0x92 init/main.c:1286 do_basic_setup+0x88/0x8f init/main.c:1306 page_owner free stack trace missing Memory state around the buggy address: ffff8881085b5a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881085b5a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881085b5b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881085b5b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881085b5c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc ==================================================================