RDX: 0000000000000000 RSI: 00000000000001d3 RDI: 0000000000000003 RBP: 00007fabc49341d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007fffda8e648f R14: 00007fabc4934300 R15: 0000000000022000 ================================================================== BUG: KASAN: use-after-free in io_queue_sqe fs/io_uring.c:2514 [inline] BUG: KASAN: use-after-free in io_queue_link_head+0x37a/0x5c0 fs/io_uring.c:2529 Read of size 8 at addr ffff8881975c6950 by task syz-executor.2/9454 CPU: 1 PID: 9454 Comm: syz-executor.2 Not tainted 5.4.147-syzkaller-00002-g60bad4df861d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x18e/0x1de lib/dump_stack.c:118 print_address_description+0x9b/0x650 mm/kasan/report.c:384 __kasan_report+0x182/0x260 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 io_queue_sqe fs/io_uring.c:2514 [inline] io_queue_link_head+0x37a/0x5c0 fs/io_uring.c:2529 io_ring_submit fs/io_uring.c:2945 [inline] __do_sys_io_uring_enter fs/io_uring.c:3853 [inline] __se_sys_io_uring_enter+0x63e/0x1d40 fs/io_uring.c:3814 do_syscall_64+0xcb/0x1e0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7fabc6bbdae9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fabc4934188 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa RAX: ffffffffffffffda RBX: 00007fabc6cd0f60 RCX: 00007fabc6bbdae9 RDX: 0000000000000000 RSI: 00000000000001d3 RDI: 0000000000000003 RBP: 00007fabc49341d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007fffda8e648f R14: 00007fabc4934300 R15: 0000000000022000 Allocated by task 9454: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x137/0x1e0 mm/kasan/common.c:529 slab_post_alloc_hook mm/slab.h:584 [inline] kmem_cache_alloc_bulk+0x18e/0x290 mm/slub.c:3284 io_get_req+0x17a/0x590 fs/io_uring.c:652 io_submit_sqe+0x83/0xe80 fs/io_uring.c:2579 io_ring_submit fs/io_uring.c:2967 [inline] __do_sys_io_uring_enter fs/io_uring.c:3853 [inline] __se_sys_io_uring_enter+0x7ee/0x1d40 fs/io_uring.c:3814 do_syscall_64+0xcb/0x1e0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 9454: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] kasan_set_free_info mm/kasan/common.c:345 [inline] __kasan_slab_free+0x18a/0x240 mm/kasan/common.c:487 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook+0x7b/0x150 mm/slub.c:1493 slab_free mm/slub.c:3073 [inline] kmem_cache_free+0xb8/0x5f0 mm/slub.c:3089 io_queue_sqe fs/io_uring.c:2513 [inline] io_queue_link_head+0x364/0x5c0 fs/io_uring.c:2529 io_ring_submit fs/io_uring.c:2945 [inline] __do_sys_io_uring_enter fs/io_uring.c:3853 [inline] __se_sys_io_uring_enter+0x63e/0x1d40 fs/io_uring.c:3814 do_syscall_64+0xcb/0x1e0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff8881975c6900 which belongs to the cache io_kiocb of size 264 The buggy address is located 80 bytes inside of 264-byte region [ffff8881975c6900, ffff8881975c6a08) The buggy address belongs to the page: page:ffffea00065d7180 refcount:1 mapcount:0 mapping:ffff8881f0ed4500 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f0ed4500 raw: 0000000000000000 0000000080150015 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x19a/0x380 mm/page_alloc.c:2171 get_page_from_freelist+0x550/0x8b0 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x2d6/0x740 mm/page_alloc.c:4855 alloc_slab_page+0x39/0x3e0 mm/slub.c:343 allocate_slab mm/slub.c:1676 [inline] new_slab+0x97/0x460 mm/slub.c:1742 new_slab_objects mm/slub.c:2499 [inline] ___slab_alloc+0x330/0x4c0 mm/slub.c:2660 kmem_cache_alloc_bulk+0xc7/0x290 mm/slub.c:3258 io_get_req+0x17a/0x590 fs/io_uring.c:652 io_submit_sqe+0x83/0xe80 fs/io_uring.c:2579 io_ring_submit fs/io_uring.c:2967 [inline] __do_sys_io_uring_enter fs/io_uring.c:3853 [inline] __se_sys_io_uring_enter+0x7ee/0x1d40 fs/io_uring.c:3814 do_syscall_64+0xcb/0x1e0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1176 [inline] free_pcp_prepare+0x1a9/0x270 mm/page_alloc.c:1233 free_unref_page_prepare mm/page_alloc.c:3085 [inline] free_unref_page_list+0xc2/0x5a0 mm/page_alloc.c:3154 release_pages+0x92a/0x950 mm/swap.c:842 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:184 [inline] tlb_flush_mmu+0x77f/0x910 mm/mmu_gather.c:191 tlb_finish_mmu+0xcb/0x200 mm/mmu_gather.c:272 exit_mmap+0x2a6/0x4f0 mm/mmap.c:3176 __mmput+0x34/0x240 kernel/fork.c:1089 exit_mm kernel/exit.c:489 [inline] do_exit+0xb6a/0x2aa0 kernel/exit.c:799 do_group_exit+0x15c/0x2c0 kernel/exit.c:910 __do_sys_exit_group+0x13/0x20 kernel/exit.c:921 __ia32_sys_exit_group+0x0/0x40 kernel/exit.c:919 __x64_sys_exit_group+0x37/0x40 kernel/exit.c:919 do_syscall_64+0xcb/0x1e0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Memory state around the buggy address: ffff8881975c6800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881975c6880: 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881975c6900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881975c6980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881975c6a00: fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================