RBP: 00007f9bb4d221d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffdf1a207bf R14: 00007f9bb4d22300 R15: 0000000000022000 ================================================================== BUG: KASAN: use-after-free in io_queue_link_head+0x56f/0x680 fs/io_uring.c:2550 Read of size 8 at addr ffff88817db096d0 by task syz-executor.0/16856 CPU: 0 PID: 16856 Comm: syz-executor.0 Not tainted 5.4.197-syzkaller-00010-gccdf6bdf62a8 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x18e/0x1d5 lib/dump_stack.c:118 print_address_description+0x8c/0x630 mm/kasan/report.c:384 __kasan_report+0xf6/0x130 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 io_queue_link_head+0x56f/0x680 fs/io_uring.c:2550 io_ring_submit fs/io_uring.c:2953 [inline] __do_sys_io_uring_enter fs/io_uring.c:3861 [inline] __se_sys_io_uring_enter+0x625/0x1cb0 fs/io_uring.c:3822 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f9bb5bac409 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f9bb4d22168 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa RAX: ffffffffffffffda RBX: 00007f9bb5cbef80 RCX: 00007f9bb5bac409 RDX: 0000000000000000 RSI: 00000000000022ff RDI: 0000000000000003 RBP: 00007f9bb4d221d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffdf1a207bf R14: 00007f9bb4d22300 R15: 0000000000022000 Allocated by task 16856: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x131/0x1e0 mm/kasan/common.c:529 slab_post_alloc_hook mm/slab.h:584 [inline] kmem_cache_alloc_bulk+0x16f/0x270 mm/slub.c:3291 io_get_req+0x17a/0x590 fs/io_uring.c:668 io_submit_sqe+0x83/0xe80 fs/io_uring.c:2587 io_ring_submit fs/io_uring.c:2975 [inline] __do_sys_io_uring_enter fs/io_uring.c:3861 [inline] __se_sys_io_uring_enter+0x7cf/0x1cb0 fs/io_uring.c:3822 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 16856: 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+0x178/0x240 mm/kasan/common.c:487 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook+0x80/0x150 mm/slub.c:1494 slab_free mm/slub.c:3080 [inline] kmem_cache_free+0xa9/0x1d0 mm/slub.c:3096 io_queue_link_head+0x2b7/0x680 fs/io_uring.c:2548 io_ring_submit fs/io_uring.c:2953 [inline] __do_sys_io_uring_enter fs/io_uring.c:3861 [inline] __se_sys_io_uring_enter+0x625/0x1cb0 fs/io_uring.c:3822 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88817db09680 which belongs to the cache io_kiocb of size 264 The buggy address is located 80 bytes inside of 264-byte region [ffff88817db09680, ffff88817db09788) The buggy address belongs to the page: page:ffffea0005f6c200 refcount:1 mapcount:0 mapping:ffff8881f5fe6c80 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5fe6c80 raw: 0000000000000000 0000000000150015 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+0x194/0x380 mm/page_alloc.c:2171 get_page_from_freelist+0x524/0x560 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x2ab/0x6f0 mm/page_alloc.c:4857 alloc_slab_page+0x39/0x3e0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x97/0x450 mm/slub.c:1749 new_slab_objects mm/slub.c:2506 [inline] ___slab_alloc+0x320/0x4b0 mm/slub.c:2667 kmem_cache_alloc_bulk+0xc6/0x270 mm/slub.c:3265 io_get_req+0x17a/0x590 fs/io_uring.c:668 io_submit_sqe+0x83/0xe80 fs/io_uring.c:2587 io_ring_submit fs/io_uring.c:2975 [inline] __do_sys_io_uring_enter fs/io_uring.c:3861 [inline] __se_sys_io_uring_enter+0x7cf/0x1cb0 fs/io_uring.c:3822 do_syscall_64+0xcb/0x1c0 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_pages_ok+0x7ee/0x920 mm/page_alloc.c:1438 free_the_page mm/page_alloc.c:4919 [inline] __free_pages+0x45/0x1e0 mm/page_alloc.c:4925 __free_slab+0x22b/0x2e0 mm/slub.c:1774 free_slab mm/slub.c:1789 [inline] discard_slab mm/slub.c:1795 [inline] unfreeze_partials+0x14f/0x180 mm/slub.c:2287 put_cpu_partial+0xb5/0x150 mm/slub.c:2323 __slab_free+0x2ac/0x370 mm/slub.c:2971 qlist_free_all+0x4c/0xb0 mm/kasan/quarantine.c:167 quarantine_reduce+0x174/0x190 mm/kasan/quarantine.c:260 __kasan_kmalloc+0x43/0x1e0 mm/kasan/common.c:507 slab_post_alloc_hook mm/slab.h:584 [inline] kmem_cache_alloc_bulk+0x16f/0x270 mm/slub.c:3291 io_get_req+0x17a/0x590 fs/io_uring.c:668 io_submit_sqe+0x83/0xe80 fs/io_uring.c:2587 io_ring_submit fs/io_uring.c:2975 [inline] __do_sys_io_uring_enter fs/io_uring.c:3861 [inline] __se_sys_io_uring_enter+0x7cf/0x1cb0 fs/io_uring.c:3822 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Memory state around the buggy address: ffff88817db09580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88817db09600: fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88817db09680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88817db09700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88817db09780: fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================