================================================================== BUG: KASAN: use-after-free in create_worker_cb+0xaa/0xc0 fs/io-wq.c:272 Read of size 8 at addr ffff88801a8b58e8 by task syz-executor.1/11996 CPU: 1 PID: 11996 Comm: syz-executor.1 Not tainted 5.12.0-rc4-next-20210326-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x141/0x1d7 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:232 __kasan_report mm/kasan/report.c:399 [inline] kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:416 create_worker_cb+0xaa/0xc0 fs/io-wq.c:272 task_work_run+0xdd/0x1a0 kernel/task_work.c:143 exit_task_work include/linux/task_work.h:30 [inline] do_exit+0xbfc/0x2a60 kernel/exit.c:825 do_group_exit+0x125/0x310 kernel/exit.c:922 get_signal+0x42c/0x2100 kernel/signal.c:2777 arch_do_signal_or_restart+0x2a8/0x1eb0 arch/x86/kernel/signal.c:789 handle_signal_work kernel/entry/common.c:147 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x148/0x250 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x466459 Code: Unable to access opcode bytes at RIP 0x46642f. RSP: 002b:00007f235830d218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 000000000056bf68 RCX: 0000000000466459 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 000000000056bf68 RBP: 000000000056bf60 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf6c R13: 00007ffe2c16b92f R14: 00007f235830d300 R15: 0000000000022000 Allocated by task 11996: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:428 [inline] ____kasan_kmalloc mm/kasan/common.c:507 [inline] ____kasan_kmalloc mm/kasan/common.c:466 [inline] __kasan_kmalloc+0x9b/0xd0 mm/kasan/common.c:516 kmalloc_node include/linux/slab.h:574 [inline] kzalloc_node include/linux/slab.h:697 [inline] io_wq_create+0x6e4/0xca0 fs/io-wq.c:934 io_init_wq_offload fs/io_uring.c:7938 [inline] io_uring_alloc_task_context+0x1bf/0x660 fs/io_uring.c:7957 __io_uring_add_task_file+0x29a/0x3c0 fs/io_uring.c:8915 io_uring_add_task_file fs/io_uring.c:8951 [inline] io_uring_install_fd fs/io_uring.c:9509 [inline] io_uring_create fs/io_uring.c:9656 [inline] io_uring_setup+0x20dd/0x2b00 fs/io_uring.c:9693 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 11996: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:357 ____kasan_slab_free mm/kasan/common.c:360 [inline] ____kasan_slab_free mm/kasan/common.c:325 [inline] __kasan_slab_free+0xfb/0x130 mm/kasan/common.c:368 kasan_slab_free include/linux/kasan.h:212 [inline] slab_free_hook mm/slub.c:1578 [inline] slab_free_freelist_hook+0xdf/0x240 mm/slub.c:1603 slab_free mm/slub.c:3163 [inline] kfree+0xe5/0x7f0 mm/slub.c:4230 io_wq_destroy+0x13e/0x2d0 fs/io-wq.c:1022 io_wq_put fs/io-wq.c:1032 [inline] io_wq_put_and_exit+0x7a/0xa0 fs/io-wq.c:1038 io_uring_clean_tctx+0xed/0x160 fs/io_uring.c:8988 __io_uring_files_cancel+0x703/0x850 fs/io_uring.c:9053 io_uring_files_cancel include/linux/io_uring.h:22 [inline] do_exit+0x299/0x2a60 kernel/exit.c:780 do_group_exit+0x125/0x310 kernel/exit.c:922 get_signal+0x42c/0x2100 kernel/signal.c:2777 arch_do_signal_or_restart+0x2a8/0x1eb0 arch/x86/kernel/signal.c:789 handle_signal_work kernel/entry/common.c:147 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x148/0x250 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x44/0xae Last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xe5/0x110 mm/kasan/generic.c:345 kvfree_call_rcu+0x74/0x8c0 kernel/rcu/tree.c:3598 neigh_destroy+0x40f/0x610 net/core/neighbour.c:858 neigh_release include/net/neighbour.h:425 [inline] neigh_cleanup_and_release+0x1fd/0x340 net/core/neighbour.c:103 neigh_del net/core/neighbour.c:193 [inline] neigh_remove_one+0x3cf/0x450 net/core/neighbour.c:214 neigh_forced_gc net/core/neighbour.c:243 [inline] neigh_alloc net/core/neighbour.c:390 [inline] ___neigh_create+0x16ce/0x2610 net/core/neighbour.c:578 ip6_finish_output2+0xf1f/0x1700 net/ipv6/ip6_output.c:114 __ip6_finish_output net/ipv6/ip6_output.c:182 [inline] __ip6_finish_output+0x4c1/0xe10 net/ipv6/ip6_output.c:161 ip6_finish_output+0x35/0x200 net/ipv6/ip6_output.c:192 NF_HOOK_COND include/linux/netfilter.h:290 [inline] ip6_output+0x1e4/0x530 net/ipv6/ip6_output.c:215 dst_output include/net/dst.h:448 [inline] ip6_local_out+0xaf/0x1a0 net/ipv6/output_core.c:179 ip6_send_skb+0xb7/0x340 net/ipv6/ip6_output.c:1904 ip6_push_pending_frames+0xdd/0x100 net/ipv6/ip6_output.c:1924 icmpv6_push_pending_frames+0x294/0x470 net/ipv6/icmp.c:310 icmp6_send+0x1a6d/0x22d0 net/ipv6/icmp.c:626 __icmpv6_send include/linux/icmpv6.h:28 [inline] icmpv6_send include/linux/icmpv6.h:49 [inline] ip6_pkt_drop+0x30b/0x7a0 net/ipv6/route.c:4396 dst_input include/net/dst.h:458 [inline] ip6_rcv_finish net/ipv6/ip6_input.c:76 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] NF_HOOK include/linux/netfilter.h:295 [inline] ipv6_rcv+0x28e/0x3c0 net/ipv6/ip6_input.c:297 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5436 __netif_receive_skb+0x27/0x1c0 net/core/dev.c:5550 netif_receive_skb_internal net/core/dev.c:5655 [inline] netif_receive_skb+0x157/0x8e0 net/core/dev.c:5714 tun_rx_batched.isra.0+0x460/0x720 drivers/net/tun.c:1452 tun_get_user+0x23df/0x3690 drivers/net/tun.c:1899 tun_chr_write_iter+0xe1/0x1f0 drivers/net/tun.c:1929 call_write_iter include/linux/fs.h:2106 [inline] new_sync_write+0x426/0x650 fs/read_write.c:518 vfs_write+0x796/0xa30 fs/read_write.c:605 ksys_write+0x12d/0x250 fs/read_write.c:658 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88801a8b5800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 232 bytes inside of 1024-byte region [ffff88801a8b5800, ffff88801a8b5c00) The buggy address belongs to the page: page:ffffea00006a2c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1a8b0 head:ffffea00006a2c00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888010841dc0 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88801a8b5780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801a8b5800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88801a8b5880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801a8b5900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801a8b5980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================