================================================================== BUG: KASAN: use-after-free in __wake_up_common+0x637/0x650 kernel/sched/wait.c:101 Read of size 8 at addr ffff88802cd4f0d8 by task iou-wrk-19308/19310 CPU: 1 PID: 19310 Comm: iou-wrk-19308 Not tainted 5.13.0-rc2-next-20210518-syzkaller #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+0x13e/0x1d6 lib/dump_stack.c:129 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:436 __wake_up_common+0x637/0x650 kernel/sched/wait.c:101 __wake_up_common_lock+0xd0/0x130 kernel/sched/wait.c:138 io_worker_handle_work+0x9dd/0x1790 fs/io-wq.c:512 io_wqe_worker+0x2ef/0xd40 fs/io-wq.c:545 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Allocated by task 19313: 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:431 [inline] ____kasan_kmalloc mm/kasan/common.c:510 [inline] ____kasan_kmalloc mm/kasan/common.c:469 [inline] __kasan_kmalloc+0x9b/0xd0 mm/kasan/common.c:519 kmalloc_node include/linux/slab.h:608 [inline] kzalloc_node include/linux/slab.h:731 [inline] io_wq_create+0x3c4/0xdd0 fs/io-wq.c:934 io_init_wq_offload fs/io_uring.c:7881 [inline] io_uring_alloc_task_context+0x1bf/0x6b0 fs/io_uring.c:7900 __io_uring_add_task_file+0x29a/0x3c0 fs/io_uring.c:8971 io_uring_add_task_file fs/io_uring.c:9007 [inline] __do_sys_io_uring_enter+0x1795/0x1d60 fs/io_uring.c:9315 do_syscall_64+0x31/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 19313: 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:363 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xfb/0x130 mm/kasan/common.c:371 kasan_slab_free include/linux/kasan.h:212 [inline] slab_free_hook mm/slub.c:1623 [inline] slab_free_freelist_hook+0xdf/0x240 mm/slub.c:1648 slab_free mm/slub.c:3208 [inline] kfree+0xeb/0x650 mm/slub.c:4274 io_wq_destroy+0x182/0x380 fs/io-wq.c:1032 io_wq_put fs/io-wq.c:1042 [inline] io_wq_put_and_exit+0x7a/0xa0 fs/io-wq.c:1048 io_uring_clean_tctx fs/io_uring.c:9044 [inline] __io_uring_cancel+0x428/0x530 fs/io_uring.c:9136 io_uring_files_cancel include/linux/io_uring.h:16 [inline] do_exit+0x299/0x2a70 kernel/exit.c:781 do_group_exit+0x125/0x310 kernel/exit.c:923 get_signal+0x47f/0x2150 kernel/signal.c:2856 arch_do_signal_or_restart+0x2a9/0x1c40 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+0x16e/0x280 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 do_syscall_64+0x3e/0xb0 arch/x86/entry/common.c:57 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88802cd4f000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 216 bytes inside of 1024-byte region [ffff88802cd4f000, ffff88802cd4f400) The buggy address belongs to the page: page:ffffea0000b35200 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802cd4d800 pfn:0x2cd48 head:ffffea0000b35200 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0000aeec00 0000000400000004 ffff888011041dc0 raw: ffff88802cd4d800 000000008010000f 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 0xd2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 8427, ts 199899511593, free_ts 199892262649 prep_new_page mm/page_alloc.c:2377 [inline] get_page_from_freelist+0x125c/0x2ed0 mm/page_alloc.c:4038 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5239 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2272 alloc_slab_page mm/slub.c:1686 [inline] allocate_slab+0x2c2/0x4c0 mm/slub.c:1826 new_slab mm/slub.c:1889 [inline] new_slab_objects mm/slub.c:2635 [inline] ___slab_alloc+0x4ba/0x820 mm/slub.c:2798 __slab_alloc.constprop.0+0xa7/0xf0 mm/slub.c:2838 slab_alloc_node mm/slub.c:2920 [inline] __kmalloc_node_track_caller+0x2e3/0x360 mm/slub.c:4653 kmalloc_reserve net/core/skbuff.c:354 [inline] __alloc_skb+0xde/0x340 net/core/skbuff.c:425 alloc_skb include/linux/skbuff.h:1107 [inline] __tcp_send_ack.part.0+0x67/0x7a0 net/ipv4/tcp_output.c:3944 __tcp_send_ack net/ipv4/tcp_output.c:3976 [inline] tcp_send_ack+0x7d/0xa0 net/ipv4/tcp_output.c:3976 __tcp_ack_snd_check+0x156/0x9c0 net/ipv4/tcp_input.c:5414 tcp_rcv_established+0x1b17/0x2130 net/ipv4/tcp_input.c:5848 tcp_v4_do_rcv+0x5d4/0x880 net/ipv4/tcp_ipv4.c:1694 tcp_v4_rcv+0x32a0/0x3960 net/ipv4/tcp_ipv4.c:2079 ip_protocol_deliver_rcu+0xa7/0xa20 net/ipv4/ip_input.c:204 ip_local_deliver_finish+0x20a/0x370 net/ipv4/ip_input.c:231 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1305 [inline] __free_pages_ok+0x4cb/0xf30 mm/page_alloc.c:1586 __put_page+0xf7/0x3f0 mm/swap.c:127 put_page include/linux/mm.h:1247 [inline] __skb_frag_unref include/linux/skbuff.h:3089 [inline] skb_release_data+0x46a/0x750 net/core/skbuff.c:667 skb_release_all net/core/skbuff.c:726 [inline] __kfree_skb+0x46/0x60 net/core/skbuff.c:740 sk_eat_skb include/net/sock.h:2569 [inline] tcp_recvmsg_locked+0x130f/0x22f0 net/ipv4/tcp.c:2505 tcp_recvmsg+0x134/0x550 net/ipv4/tcp.c:2551 inet_recvmsg+0x11b/0x5e0 net/ipv4/af_inet.c:852 sock_recvmsg_nosec net/socket.c:888 [inline] sock_recvmsg net/socket.c:906 [inline] sock_recvmsg net/socket.c:902 [inline] sock_read_iter+0x33c/0x470 net/socket.c:979 call_read_iter include/linux/fs.h:2108 [inline] new_sync_read+0x5b7/0x6e0 fs/read_write.c:415 vfs_read+0x35c/0x570 fs/read_write.c:496 ksys_read+0x1ee/0x250 fs/read_write.c:634 do_syscall_64+0x31/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff88802cd4ef80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802cd4f000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802cd4f080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802cd4f100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802cd4f180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================