================================================================== BUG: KASAN: double-free or invalid-free in io_req_caches_free.constprop.0+0x35a/0x580 fs/io_uring.c:8709 CPU: 1 PID: 18291 Comm: kworker/u4:13 Not tainted 5.11.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events_unbound io_ring_exit_work Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0xa5/0xe6 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2c6 mm/kasan/report.c:230 kasan_report_invalid_free+0x51/0x80 mm/kasan/report.c:355 ____kasan_slab_free+0xcc/0xe0 mm/kasan/common.c:341 kasan_slab_free include/linux/kasan.h:192 [inline] __cache_free mm/slab.c:3424 [inline] kmem_cache_free_bulk+0x4b/0x1b0 mm/slab.c:3744 io_req_caches_free.constprop.0+0x35a/0x580 fs/io_uring.c:8709 io_ring_ctx_free fs/io_uring.c:8764 [inline] io_ring_exit_work+0x426/0x5a0 fs/io_uring.c:8846 process_one_work+0x84c/0x13b0 kernel/workqueue.c:2275 worker_thread+0x598/0xf80 kernel/workqueue.c:2421 kthread+0x36f/0x450 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Allocated by task 3527: 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:401 [inline] ____kasan_kmalloc.constprop.0+0x7f/0xa0 mm/kasan/common.c:429 kasan_slab_alloc include/linux/kasan.h:209 [inline] slab_post_alloc_hook mm/slab.h:512 [inline] kmem_cache_alloc_bulk+0x2c2/0x460 mm/slab.c:3534 io_alloc_req fs/io_uring.c:2014 [inline] io_submit_sqes+0x130e/0x2380 fs/io_uring.c:6915 __do_sys_io_uring_enter+0xb94/0x17d0 fs/io_uring.c:9454 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 3527: 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:356 ____kasan_slab_free+0xb0/0xe0 mm/kasan/common.c:362 kasan_slab_free include/linux/kasan.h:192 [inline] __cache_free mm/slab.c:3424 [inline] kmem_cache_free_bulk+0x4b/0x1b0 mm/slab.c:3744 io_req_caches_free.constprop.0+0x35a/0x580 fs/io_uring.c:8709 io_uring_flush+0x3ac/0x5c0 fs/io_uring.c:9237 filp_close+0x96/0x120 fs/open.c:1286 close_files fs/file.c:403 [inline] put_files_struct fs/file.c:418 [inline] put_files_struct+0x15c/0x2c0 fs/file.c:415 do_exit+0xa60/0x2570 kernel/exit.c:820 do_group_exit+0xe7/0x290 kernel/exit.c:922 __do_sys_exit_group kernel/exit.c:933 [inline] __se_sys_exit_group kernel/exit.c:931 [inline] __x64_sys_exit_group+0x35/0x40 kernel/exit.c:931 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 ffff88803669a900 which belongs to the cache io_kiocb of size 208 The buggy address is located 0 bytes inside of 208-byte region [ffff88803669a900, ffff88803669a9d0) The buggy address belongs to the page: page:000000007071376c refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88803669a180 pfn:0x3669a flags: 0xfff00000000200(slab) raw: 00fff00000000200 ffffea000053f948 ffffea0000651648 ffff8880167ee100 raw: ffff88803669a180 ffff88803669a040 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x2420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE), pid 11856, ts 86367571325 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x144/0x1c0 mm/page_alloc.c:2297 prep_new_page mm/page_alloc.c:2306 [inline] get_page_from_freelist+0x1c6f/0x3fb0 mm/page_alloc.c:3945 __alloc_pages_nodemask+0x2d6/0x730 mm/page_alloc.c:4995 __alloc_pages include/linux/gfp.h:511 [inline] __alloc_pages_node include/linux/gfp.h:524 [inline] kmem_getpages mm/slab.c:1376 [inline] cache_grow_begin+0x71/0x430 mm/slab.c:2593 cache_alloc_refill+0x27f/0x380 mm/slab.c:2965 ____cache_alloc mm/slab.c:3048 [inline] ____cache_alloc mm/slab.c:3031 [inline] __do_cache_alloc mm/slab.c:3271 [inline] kmem_cache_alloc_bulk+0x2f9/0x460 mm/slab.c:3519 io_alloc_req fs/io_uring.c:2014 [inline] io_submit_sqes+0x130e/0x2380 fs/io_uring.c:6915 __do_sys_io_uring_enter+0xb94/0x17d0 fs/io_uring.c:9454 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1271 [inline] free_pcp_prepare+0x2cb/0x410 mm/page_alloc.c:1306 free_unref_page_prepare mm/page_alloc.c:3200 [inline] free_unref_page+0x12/0x1d0 mm/page_alloc.c:3248 __vunmap+0x5a3/0x950 mm/vmalloc.c:2286 free_work+0x4b/0x70 mm/vmalloc.c:67 process_one_work+0x84c/0x13b0 kernel/workqueue.c:2275 worker_thread+0x598/0xf80 kernel/workqueue.c:2421 kthread+0x36f/0x450 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Memory state around the buggy address: ffff88803669a800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803669a880: fb fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88803669a900: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803669a980: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc ffff88803669aa00: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ==================================================================