================================================================== BUG: KASAN: use-after-free in __fib6_clean_all+0x296/0x2a0 net/ipv6/ip6_fib.c:2255 Read of size 8 at addr ffff888067149000 by task syz-executor.3/5781 CPU: 0 PID: 5781 Comm: syz-executor.3 Not tainted 5.18.0-rc7-syzkaller-00164-g6c3f5bec9b40 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xeb/0x467 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 __fib6_clean_all+0x296/0x2a0 net/ipv6/ip6_fib.c:2255 rt6_sync_down_dev net/ipv6/route.c:4883 [inline] rt6_disable_ip+0x7b7/0x9a0 net/ipv6/route.c:4888 addrconf_ifdown.isra.0+0xf6/0x16b0 net/ipv6/addrconf.c:3738 addrconf_notify+0xeb/0x1ba0 net/ipv6/addrconf.c:3662 notifier_call_chain+0xb5/0x200 kernel/notifier.c:84 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1938 call_netdevice_notifiers_extack net/core/dev.c:1976 [inline] call_netdevice_notifiers net/core/dev.c:1990 [inline] netdev_wait_allrefs_any net/core/dev.c:10141 [inline] netdev_run_todo+0xb90/0x10b0 net/core/dev.c:10253 tun_detach drivers/net/tun.c:696 [inline] tun_chr_close+0xe0/0x180 drivers/net/tun.c:3445 __fput+0x277/0x9d0 fs/file_table.c:317 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:37 [inline] do_exit+0xaff/0x2a00 kernel/exit.c:795 do_group_exit+0xd2/0x2f0 kernel/exit.c:925 get_signal+0x22df/0x24c0 kernel/signal.c:2864 arch_do_signal_or_restart+0x82/0x20f0 arch/x86/kernel/signal.c:867 exit_to_user_mode_loop kernel/entry/common.c:166 [inline] exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:294 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fec21cade11 Code: Unable to access opcode bytes at RIP 0x7fec21cadde7. RSP: 002b:00007fec22d4d0b0 EFLAGS: 00000293 ORIG_RAX: 00000000000000e6 RAX: fffffffffffffdfc RBX: 00007fec21d9bf60 RCX: 00007fec21cade11 RDX: 00007fec22d4d0f0 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007fec21ce308d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 00007fff4b45dd9f R14: 00007fec22d4d300 R15: 0000000000022000 Allocated by task 3694: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa6/0xd0 mm/kasan/common.c:524 kasan_kmalloc include/linux/kasan.h:234 [inline] kmem_cache_alloc_trace+0x1ea/0x4a0 mm/slab.c:3583 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:714 [inline] fib6_net_init net/ipv6/ip6_fib.c:2376 [inline] fib6_net_init+0x1d7/0xa20 net/ipv6/ip6_fib.c:2351 ops_init+0xaf/0x470 net/core/net_namespace.c:134 setup_net+0x5d1/0xc50 net/core/net_namespace.c:325 copy_net_ns+0x318/0x760 net/core/net_namespace.c:471 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x445/0x920 kernel/fork.c:3132 __do_sys_unshare kernel/fork.c:3203 [inline] __se_sys_unshare kernel/fork.c:3201 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3201 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 3710: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0x13d/0x180 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:200 [inline] __cache_free mm/slab.c:3439 [inline] kfree+0x113/0x310 mm/slab.c:3810 fib6_net_exit+0x1c9/0x280 net/ipv6/ip6_fib.c:2438 ops_exit_list+0xb0/0x170 net/core/net_namespace.c:162 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:594 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 The buggy address belongs to the object at ffff888067149000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 0 bytes inside of 2048-byte region [ffff888067149000, ffff888067149800) The buggy address belongs to the physical page: page:ffffea00019c5240 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x67149 flags: 0x4fff00000000200(slab|node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000000200 ffffea00019d8008 ffffea00019c52c8 ffff888010c40800 raw: 0000000000000000 ffff888067149000 0000000100000001 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 0x40cc0(GFP_KERNEL|__GFP_COMP), pid 3694, tgid 3694 (syz-executor.3), ts 110210141508, free_ts 0 prep_new_page mm/page_alloc.c:2441 [inline] get_page_from_freelist+0xba2/0x3e00 mm/page_alloc.c:4182 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5408 __alloc_pages_node include/linux/gfp.h:587 [inline] kmem_getpages mm/slab.c:1378 [inline] cache_grow_begin+0x75/0x350 mm/slab.c:2584 fallback_alloc+0x1e4/0x2e0 mm/slab.c:3132 __do_cache_alloc mm/slab.c:3274 [inline] slab_alloc mm/slab.c:3309 [inline] kmem_cache_alloc_trace+0x309/0x4a0 mm/slab.c:3581 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:714 [inline] fib6_net_init net/ipv6/ip6_fib.c:2376 [inline] fib6_net_init+0x1d7/0xa20 net/ipv6/ip6_fib.c:2351 ops_init+0xaf/0x470 net/core/net_namespace.c:134 setup_net+0x5d1/0xc50 net/core/net_namespace.c:325 copy_net_ns+0x318/0x760 net/core/net_namespace.c:471 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x445/0x920 kernel/fork.c:3132 __do_sys_unshare kernel/fork.c:3203 [inline] __se_sys_unshare kernel/fork.c:3201 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3201 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae page_owner free stack trace missing Memory state around the buggy address: ffff888067148f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888067148f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888067149000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888067149080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888067149100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================