================================================================== BUG: KASAN: use-after-free in __fib6_clean_all+0x296/0x2a0 net/ipv6/ip6_fib.c:2254 Read of size 8 at addr ffff88814b5f1000 by task syz-executor.0/8907 CPU: 1 PID: 8907 Comm: syz-executor.0 Not tainted 6.1.0-rc5-syzkaller-01349-ga6e3d86ece0b #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15e/0x45d mm/kasan/report.c:395 kasan_report+0xbf/0x1f0 mm/kasan/report.c:495 __fib6_clean_all+0x296/0x2a0 net/ipv6/ip6_fib.c:2254 rt6_sync_down_dev net/ipv6/route.c:4894 [inline] rt6_disable_ip+0x807/0xa00 net/ipv6/route.c:4899 addrconf_ifdown.isra.0+0x11a/0x1920 net/ipv6/addrconf.c:3750 addrconf_notify+0x104/0x1c80 net/ipv6/addrconf.c:3673 notifier_call_chain+0xb5/0x200 kernel/notifier.c:87 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1944 call_netdevice_notifiers_extack net/core/dev.c:1982 [inline] call_netdevice_notifiers net/core/dev.c:1996 [inline] netdev_wait_allrefs_any net/core/dev.c:10227 [inline] netdev_run_todo+0xbc6/0x1100 net/core/dev.c:10341 tun_detach drivers/net/tun.c:704 [inline] tun_chr_close+0xe4/0x190 drivers/net/tun.c:3460 __fput+0x27c/0xa90 fs/file_table.c:320 task_work_run+0x16f/0x270 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xb3d/0x2a30 kernel/exit.c:820 do_group_exit+0xd4/0x2a0 kernel/exit.c:950 get_signal+0x21b1/0x2440 kernel/signal.c:2858 arch_do_signal_or_restart+0x86/0x2300 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:203 irqentry_exit_to_user_mode+0x9/0x40 kernel/entry/common.c:309 exc_page_fault+0xc0/0x170 arch/x86/mm/fault.c:1578 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0033:0x7fcf2d089e2e Code: Unable to access opcode bytes at 0x7fcf2d089e04. RSP: 002b:00007fff34f9d540 EFLAGS: 00010202 RAX: 00007fcf2dcd5720 RBX: 0000000000000000 RCX: 00007fcf2d089e0b RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011 RBP: 0000000000000001 R08: 0000000000000000 R09: 00005555572fd400 R10: 00005555572fd6d0 R11: 0000000000000246 R12: 0000000000000001 R13: 0000000000000000 R14: 0000000000000001 R15: 00007fff34f9d620 Allocated by task 3658: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] ____kasan_kmalloc mm/kasan/common.c:330 [inline] __kasan_kmalloc+0xa5/0xb0 mm/kasan/common.c:380 kmalloc include/linux/slab.h:553 [inline] kzalloc include/linux/slab.h:689 [inline] fib6_net_init net/ipv6/ip6_fib.c:2375 [inline] fib6_net_init+0x1db/0xa20 net/ipv6/ip6_fib.c:2350 ops_init+0xb9/0x680 net/core/net_namespace.c:135 setup_net+0x793/0xe60 net/core/net_namespace.c:333 copy_net_ns+0x31b/0x6b0 net/core/net_namespace.c:483 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc5/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x449/0x920 kernel/fork.c:3188 __do_sys_unshare kernel/fork.c:3259 [inline] __se_sys_unshare kernel/fork.c:3257 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:3257 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 102: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x40 mm/kasan/generic.c:511 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1750 slab_free mm/slub.c:3661 [inline] __kmem_cache_free+0xaf/0x3b0 mm/slub.c:3674 fib6_net_exit+0x1cd/0x280 net/ipv6/ip6_fib.c:2437 ops_exit_list+0xb0/0x170 net/core/net_namespace.c:169 cleanup_net+0x4ee/0xb10 net/core/net_namespace.c:606 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 The buggy address belongs to the object at ffff88814b5f1000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 0 bytes inside of 2048-byte region [ffff88814b5f1000, ffff88814b5f1800) The buggy address belongs to the physical page: page:ffffea00052d7c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88814b5f2000 pfn:0x14b5f0 head:ffffea00052d7c00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x57ff00000010200(slab|head|node=1|zone=2|lastcpupid=0x7ff) raw: 057ff00000010200 ffffea0005170a08 ffffea00051e4608 ffff888012042000 raw: ffff88814b5f2000 0000000000080007 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 1, tgid 1 (swapper/0), ts 11284277249, free_ts 0 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4288 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5555 alloc_page_interleave+0x1e/0x200 mm/mempolicy.c:2118 alloc_pages+0x233/0x270 mm/mempolicy.c:2280 alloc_slab_page mm/slub.c:1794 [inline] allocate_slab+0x213/0x300 mm/slub.c:1939 new_slab mm/slub.c:1992 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3180 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3279 slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x199/0x3e0 mm/slub.c:3437 kmalloc_trace+0x26/0x60 mm/slab_common.c:1045 kmalloc include/linux/slab.h:553 [inline] kzalloc include/linux/slab.h:689 [inline] btf_parse kernel/bpf/btf.c:5064 [inline] btf_new_fd+0x261/0x1ec0 kernel/bpf/btf.c:6981 bpf_btf_load kernel/bpf/syscall.c:4290 [inline] __sys_bpf+0x18f2/0x4ff0 kernel/bpf/syscall.c:4976 ____bpf_sys_bpf kernel/bpf/syscall.c:5066 [inline] bpf_sys_bpf+0x60/0x80 kernel/bpf/syscall.c:5050 0xffffffffa000074b bpf_dispatcher_nop_func include/linux/bpf.h:1016 [inline] __bpf_prog_run include/linux/filter.h:600 [inline] bpf_prog_run include/linux/filter.h:607 [inline] kern_sys_bpf+0x41b/0x660 kernel/bpf/syscall.c:5107 skel_sys_bpf tools/lib/bpf/skel_internal.h:75 [inline] bpf_load_and_run.constprop.0+0x381/0x48a tools/lib/bpf/skel_internal.h:352 iterators_bpf__load kernel/bpf/preload/iterators/iterators.lskel.h:400 [inline] load_skel kernel/bpf/preload/bpf_preload_kern.c:41 [inline] load+0x234/0x727 kernel/bpf/preload/bpf_preload_kern.c:74 page_owner free stack trace missing Memory state around the buggy address: ffff88814b5f0f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88814b5f0f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88814b5f1000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88814b5f1080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88814b5f1100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================