================================================================== 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 ffff888105ff1b14 by task kworker/u4:5/392 CPU: 1 PID: 392 Comm: kworker/u4:5 Not tainted 5.10.237-syzkaller-00309-g7e2543346ff7 #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 1617: 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 392: 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 __call_rcu kernel/rcu/tree.c:2976 [inline] call_rcu+0x105/0x1040 kernel/rcu/tree.c:3050 tnode_free net/ipv4/fib_trie.c:495 [inline] replace+0x1a1/0x450 net/ipv4/fib_trie.c:521 inflate net/ipv4/fib_trie.c:623 [inline] resize+0x10ec/0x2450 net/ipv4/fib_trie.c:868 trie_rebalance net/ipv4/fib_trie.c:1059 [inline] fib_insert_node net/ipv4/fib_trie.c:1103 [inline] fib_insert_alias+0x98f/0x1020 net/ipv4/fib_trie.c:1117 fib_trie_unmerge+0x5ba/0x14c0 net/ipv4/fib_trie.c:1887 fib_unmerge+0xc5/0x360 net/ipv4/fib_frontend.c:160 fib4_rule_delete+0x48/0x390 net/ipv4/fib_rules.c:293 fib_nl_delrule+0x1564/0x1cb0 net/core/fib_rules.c:907 rtnetlink_rcv_msg+0x9db/0xb90 net/core/rtnetlink.c:5610 netlink_rcv_skb+0x1e0/0x430 net/netlink/af_netlink.c:2485 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5628 netlink_unicast_kernel net/netlink/af_netlink.c:1307 [inline] netlink_unicast+0x87c/0xa40 net/netlink/af_netlink.c:1333 netlink_sendmsg+0x88d/0xb30 net/netlink/af_netlink.c:1901 sock_sendmsg_nosec net/socket.c:652 [inline] __sock_sendmsg net/socket.c:664 [inline] ____sys_sendmsg+0x5a2/0x8c0 net/socket.c:2376 ___sys_sendmsg+0x1f0/0x260 net/socket.c:2430 __sys_sendmsg net/socket.c:2459 [inline] __do_sys_sendmsg net/socket.c:2468 [inline] __se_sys_sendmsg net/socket.c:2466 [inline] __x64_sys_sendmsg+0x1e2/0x2a0 net/socket.c:2466 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff888105ff1b00 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 20 bytes inside of 128-byte region [ffff888105ff1b00, ffff888105ff1b80) The buggy address belongs to the page: page:ffffea000417fc40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105ff1 flags: 0x4000000000000200(slab) raw: 4000000000000200 ffffea0004217f40 0000000300000003 ffff888100043500 raw: 0000000000000000 0000000000100010 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 1323866612, 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] kmem_cache_alloc_trace+0x1b3/0x2e0 mm/slub.c:2972 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:664 [inline] call_usermodehelper_setup+0x71/0x1d0 kernel/umh.c:363 kobject_uevent_env+0x639/0x700 lib/kobject_uevent.c:629 kobject_uevent+0x1d/0x30 lib/kobject_uevent.c:657 device_add+0x7bb/0xbf0 drivers/base/core.c:3254 pci_device_add+0x11bf/0x19f0 drivers/pci/probe.c:2515 pci_scan_single_device+0x36b/0x440 drivers/pci/probe.c:2533 pci_scan_slot+0x19b/0x780 drivers/pci/probe.c:2608 pci_scan_child_bus_extend+0x7c/0x820 drivers/pci/probe.c:2825 pci_scan_child_bus+0x17/0x20 drivers/pci/probe.c:2955 page_owner free stack trace missing Memory state around the buggy address: ffff888105ff1a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888105ff1a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888105ff1b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888105ff1b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888105ff1c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc ==================================================================