================================================================== BUG: KASAN: use-after-free in bio_poll+0x42/0x1e0 block/blk-core.c:1031 Read of size 8 at addr ffff88805cc5a008 by task syz-executor.3/5787 CPU: 1 PID: 5787 Comm: syz-executor.3 Not tainted 5.16.0-rc8-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+0x1dc/0x2d8 lib/dump_stack.c:106 print_address_description+0x65/0x380 mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:433 [inline] kasan_report+0x19a/0x1f0 mm/kasan/report.c:450 bio_poll+0x42/0x1e0 block/blk-core.c:1031 __iomap_dio_rw+0x199f/0x1d90 fs/iomap/direct-io.c:656 iomap_dio_rw+0x38/0x80 fs/iomap/direct-io.c:679 ext4_dio_write_iter fs/ext4/file.c:568 [inline] ext4_file_write_iter+0x1780/0x1bd0 fs/ext4/file.c:679 do_iter_readv_writev+0x54f/0x740 do_iter_write+0x21e/0x7b0 fs/read_write.c:851 vfs_writev fs/read_write.c:924 [inline] do_pwritev+0x21c/0x370 fs/read_write.c:1021 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f9f72d09e99 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:00007f9f7167f168 EFLAGS: 00000246 ORIG_RAX: 0000000000000148 RAX: ffffffffffffffda RBX: 00007f9f72e1cf60 RCX: 00007f9f72d09e99 RDX: 000000000000002d RSI: 0000000020000240 RDI: 0000000000000005 RBP: 00007f9f72d63ff1 R08: 0000000000000000 R09: 0000000000000003 R10: 0000000000004200 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe2ad2faef R14: 00007f9f7167f300 R15: 0000000000022000 The buggy address belongs to the page: page:ffffea0001731680 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0 pfn:0x5cc5a flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0000712588 ffffea0000b77548 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffff7f 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x192800(GFP_NOWAIT|__GFP_NOWARN|__GFP_NORETRY|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 2936, ts 292653855705, free_ts 321232779768 prep_new_page mm/page_alloc.c:2418 [inline] get_page_from_freelist+0x729/0x9e0 mm/page_alloc.c:4149 __alloc_pages+0x255/0x580 mm/page_alloc.c:5369 alloc_slab_page mm/slub.c:1793 [inline] allocate_slab+0xcc/0x540 mm/slub.c:1930 new_slab mm/slub.c:1993 [inline] ___slab_alloc+0x41e/0xc40 mm/slub.c:3022 __slab_alloc mm/slub.c:3109 [inline] slab_alloc_node mm/slub.c:3200 [inline] slab_alloc mm/slub.c:3242 [inline] kmem_cache_alloc+0x276/0x310 mm/slub.c:3247 mempool_alloc_slab+0x49/0x60 mm/mempool.c:512 mempool_alloc+0x177/0x6d0 mm/mempool.c:392 bio_alloc_bioset+0x12e/0x950 block/bio.c:468 bio_alloc include/linux/bio.h:371 [inline] submit_bh_wbc+0x1ca/0x660 fs/buffer.c:3026 submit_bh+0x21/0x30 fs/buffer.c:3060 jbd2_journal_commit_transaction+0x2c3b/0x5e80 fs/jbd2/commit.c:775 kjournald2+0x4b4/0x940 fs/jbd2/journal.c:213 kthread+0x468/0x490 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1338 [inline] free_pcp_prepare+0xd1c/0xe00 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3309 [inline] free_unref_page+0x7d/0x580 mm/page_alloc.c:3388 rcu_do_batch kernel/rcu/tree.c:2506 [inline] rcu_core+0x9b8/0x1610 kernel/rcu/tree.c:2741 __do_softirq+0x392/0x7a3 kernel/softirq.c:558 run_ksoftirqd+0xc1/0x120 kernel/softirq.c:921 smpboot_thread_fn+0x533/0x9d0 kernel/smpboot.c:164 kthread+0x468/0x490 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 Memory state around the buggy address: ffff88805cc59f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805cc59f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88805cc5a000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88805cc5a080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805cc5a100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================