================================================================== BUG: KASAN: use-after-free in __fib6_clean_all+0x21d/0x8a0 Read of size 8 at addr ffff88801fa1e000 by task syz-executor.2/3621 CPU: 0 PID: 3621 Comm: syz-executor.2 Not tainted 5.18.0-syzkaller-04943-g7e062cda7d90 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description+0x65/0x4b0 mm/kasan/report.c:313 print_report+0xf4/0x210 mm/kasan/report.c:429 kasan_report+0xfb/0x130 mm/kasan/report.c:491 __fib6_clean_all+0x21d/0x8a0 rt6_sync_down_dev net/ipv6/route.c:4887 [inline] rt6_disable_ip+0x14c/0x8e0 net/ipv6/route.c:4892 addrconf_ifdown+0x16b/0x1bc0 net/ipv6/addrconf.c:3750 addrconf_notify+0x403/0xf80 notifier_call_chain kernel/notifier.c:84 [inline] raw_notifier_call_chain+0xe7/0x170 kernel/notifier.c:392 call_netdevice_notifiers_info net/core/dev.c:1943 [inline] call_netdevice_notifiers_extack net/core/dev.c:1981 [inline] call_netdevice_notifiers net/core/dev.c:1995 [inline] netdev_wait_allrefs_any net/core/dev.c:10225 [inline] netdev_run_todo+0x8db/0x1070 net/core/dev.c:10337 tun_detach drivers/net/tun.c:695 [inline] tun_chr_close+0x11f/0x130 drivers/net/tun.c:3444 __fput+0x3b9/0x820 fs/file_table.c:317 task_work_run+0x146/0x1c0 kernel/task_work.c:177 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0x547/0x1eb0 kernel/exit.c:795 do_group_exit+0x23b/0x2f0 kernel/exit.c:925 __do_sys_exit_group kernel/exit.c:936 [inline] __se_sys_exit_group kernel/exit.c:934 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:934 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f975a489109 Code: Unable to access opcode bytes at RIP 0x7f975a4890df. RSP: 002b:00007ffcfcf10b38 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 00007ffcfcf11190 RCX: 00007f975a489109 RDX: 00007f975a488217 RSI: 0000000000000000 RDI: 0000000000000007 RBP: 0000000000000007 R08: 0000000000000006 R09: 00007ffcfcf11190 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000032 R13: 0000000000102348 R14: 0000000000000003 R15: 00007ffcfcf111d0 Allocated by task 3621: 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:436 [inline] ____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:515 kasan_kmalloc include/linux/kasan.h:234 [inline] kmem_cache_alloc_trace+0x94/0x310 mm/slub.c:3255 kmalloc include/linux/slab.h:588 [inline] kzalloc include/linux/slab.h:721 [inline] fib6_net_init+0x1a6/0x800 net/ipv6/ip6_fib.c:2376 ops_init+0x313/0x430 net/core/net_namespace.c:134 setup_net+0x4bb/0xc10 net/core/net_namespace.c:325 copy_net_ns+0x359/0x5b0 net/core/net_namespace.c:471 create_new_namespaces+0x4db/0x8e0 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x11e/0x180 kernel/nsproxy.c:226 ksys_unshare+0x57f/0xb30 kernel/fork.c:3137 __do_sys_unshare kernel/fork.c:3208 [inline] __se_sys_unshare kernel/fork.c:3206 [inline] __x64_sys_unshare+0x34/0x40 kernel/fork.c:3206 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Freed by task 5628: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0xd8/0x110 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1727 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1753 slab_free mm/slub.c:3507 [inline] kfree+0xc6/0x210 mm/slub.c:4555 fib6_net_exit+0x32d/0x370 net/ipv6/ip6_fib.c:2438 ops_exit_list net/core/net_namespace.c:162 [inline] cleanup_net+0x758/0xc50 net/core/net_namespace.c:594 process_one_work+0x81c/0xd10 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 The buggy address belongs to the object at ffff88801fa1e000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 0 bytes inside of 2048-byte region [ffff88801fa1e000, ffff88801fa1e800) The buggy address belongs to the physical page: page:ffffea00007e8600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1fa18 head:ffffea00007e8600 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888011442000 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 958, tgid 958 (kworker/u4:5), ts 7201899250, free_ts 0 prep_new_page mm/page_alloc.c:2441 [inline] get_page_from_freelist+0x72e/0x7a0 mm/page_alloc.c:4182 __alloc_pages+0x26c/0x5f0 mm/page_alloc.c:5408 alloc_slab_page+0x70/0xf0 mm/slub.c:1797 allocate_slab+0x5e/0x520 mm/slub.c:1942 new_slab mm/slub.c:2002 [inline] ___slab_alloc+0x41e/0xcd0 mm/slub.c:3002 __slab_alloc mm/slub.c:3089 [inline] slab_alloc_node mm/slub.c:3180 [inline] __kmalloc_node+0x2c0/0x400 mm/slub.c:4461 kmalloc_node include/linux/slab.h:611 [inline] kvmalloc_node+0x6e/0x160 mm/util.c:612 kvzalloc_node include/linux/slab.h:742 [inline] sbitmap_init_node+0x2ba/0x5b0 lib/sbitmap.c:113 scsi_realloc_sdev_budget_map+0x2c8/0x450 drivers/scsi/scsi_scan.c:246 scsi_alloc_sdev+0x773/0x9d0 drivers/scsi/scsi_scan.c:356 scsi_probe_and_add_lun+0x1d0/0x4910 drivers/scsi/scsi_scan.c:1172 __scsi_scan_target+0x1fb/0x10e0 drivers/scsi/scsi_scan.c:1654 scsi_scan_channel drivers/scsi/scsi_scan.c:1742 [inline] scsi_scan_host_selected+0x394/0x6c0 drivers/scsi/scsi_scan.c:1771 do_scsi_scan_host drivers/scsi/scsi_scan.c:1910 [inline] do_scan_async+0x12e/0x7b0 drivers/scsi/scsi_scan.c:1920 async_run_entry_fn+0xa6/0x400 kernel/async.c:127 process_one_work+0x81c/0xd10 kernel/workqueue.c:2289 page_owner free stack trace missing Memory state around the buggy address: ffff88801fa1df00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801fa1df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801fa1e000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801fa1e080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801fa1e100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================