================================================================== BUG: KASAN: use-after-free in fib_flush+0x77/0x120 net/ipv4/fib_frontend.c:193 Read of size 8 at addr ffff888124812000 by task kworker/u4:4/469 CPU: 0 PID: 469 Comm: kworker/u4:4 Not tainted 5.10.240-syzkaller-00213-gad9a98ef27a4 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/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 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:309 fib_flush+0x77/0x120 net/ipv4/fib_frontend.c:193 __remove_nexthop_fib+0xab/0x260 net/ipv4/nexthop.c:879 __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 276: 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] ip_fib_net_init net/ipv4/fib_frontend.c:1547 [inline] fib_net_init+0xe0/0x2c0 net/ipv4/fib_frontend.c:1606 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:3156 __do_sys_unshare kernel/fork.c:3224 [inline] __se_sys_unshare kernel/fork.c:3222 [inline] __x64_sys_unshare+0x38/0x40 kernel/fork.c:3222 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 469: 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 ip_fib_net_exit+0x32f/0x350 net/ipv4/fib_frontend.c:1595 fib_net_exit+0x6c/0x80 net/ipv4/fib_frontend.c:1629 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 The buggy address belongs to the object at ffff888124812000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 0 bytes inside of 2048-byte region [ffff888124812000, ffff888124812800) The buggy address belongs to the page: page:ffffea0004920400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x124810 head:ffffea0004920400 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100042d80 raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 276, ts 25183036444, 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:5357 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+0x201/0x330 mm/slub.c:4029 kmalloc include/linux/slab.h:557 [inline] sk_prot_alloc+0xb2/0x340 net/core/sock.c:1716 sk_alloc+0x38/0x4e0 net/core/sock.c:1774 __netlink_create net/netlink/af_netlink.c:621 [inline] __netlink_kernel_create+0x186/0x940 net/netlink/af_netlink.c:2040 netlink_kernel_create include/linux/netlink.h:60 [inline] uevent_net_init+0xe1/0x2b0 lib/kobject_uevent.c:785 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 page_owner free stack trace missing Memory state around the buggy address: ffff888124811f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888124811f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888124812000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888124812080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888124812100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== general protection fault, probably for non-canonical address 0xfd90650a6a882aa8: 0000 [#1] PREEMPT SMP KASAN KASAN: maybe wild-memory-access in range [0xec83485354415540-0xec83485354415547] CPU: 0 PID: 469 Comm: kworker/u4:4 Tainted: G B 5.10.240-syzkaller-00213-gad9a98ef27a4 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Workqueue: netns cleanup_net RIP: 0010:fib_table_flush+0x31a/0x1330 net/ipv4/fib_trie.c:1992 Code: 38 c1 0f 8c 71 ff ff ff 48 89 df e8 50 aa c0 fd e9 64 ff ff ff 4c 89 6c 24 38 48 89 44 24 20 48 8d 58 05 48 89 d8 48 c1 e8 03 <42> 0f b6 04 20 84 c0 0f 85 99 0d 00 00 0f b6 1b 31 ff 89 de e8 ed RSP: 0018:ffffc90000d97840 EFLAGS: 00010a03 RAX: 1d90690a6a882aa8 RBX: ec83485354415546 RCX: ffff88811450a780 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000 RBP: ffffc90000d979c0 R08: 0000000000000004 R09: 0000000000000003 R10: fffffbfff0d8e848 R11: 1ffffffff0d8e848 R12: dffffc0000000000 R13: 0000000000000001 R14: ffffffff83d81b90 R15: ffff88811dd6c000 FS: 0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 000000010d104000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: fib_flush+0xb5/0x120 net/ipv4/fib_frontend.c:194 __remove_nexthop_fib+0xab/0x260 net/ipv4/nexthop.c:879 __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 Modules linked in: ---[ end trace d3ba80ce618755e5 ]--- RIP: 0010:fib_table_flush+0x31a/0x1330 net/ipv4/fib_trie.c:1992 Code: 38 c1 0f 8c 71 ff ff ff 48 89 df e8 50 aa c0 fd e9 64 ff ff ff 4c 89 6c 24 38 48 89 44 24 20 48 8d 58 05 48 89 d8 48 c1 e8 03 <42> 0f b6 04 20 84 c0 0f 85 99 0d 00 00 0f b6 1b 31 ff 89 de e8 ed RSP: 0018:ffffc90000d97840 EFLAGS: 00010a03 RAX: 1d90690a6a882aa8 RBX: ec83485354415546 RCX: ffff88811450a780 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000 RBP: ffffc90000d979c0 R08: 0000000000000004 R09: 0000000000000003 R10: fffffbfff0d8e848 R11: 1ffffffff0d8e848 R12: dffffc0000000000 R13: 0000000000000001 R14: ffffffff83d81b90 R15: ffff88811dd6c000 FS: 0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 000000000620f000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 38 c1 cmp %al,%cl 2: 0f 8c 71 ff ff ff jl 0xffffff79 8: 48 89 df mov %rbx,%rdi b: e8 50 aa c0 fd call 0xfdc0aa60 10: e9 64 ff ff ff jmp 0xffffff79 15: 4c 89 6c 24 38 mov %r13,0x38(%rsp) 1a: 48 89 44 24 20 mov %rax,0x20(%rsp) 1f: 48 8d 58 05 lea 0x5(%rax),%rbx 23: 48 89 d8 mov %rbx,%rax 26: 48 c1 e8 03 shr $0x3,%rax * 2a: 42 0f b6 04 20 movzbl (%rax,%r12,1),%eax <-- trapping instruction 2f: 84 c0 test %al,%al 31: 0f 85 99 0d 00 00 jne 0xdd0 37: 0f b6 1b movzbl (%rbx),%ebx 3a: 31 ff xor %edi,%edi 3c: 89 de mov %ebx,%esi 3e: e8 .byte 0xe8 3f: ed in (%dx),%eax