================================================================== BUG: KASAN: use-after-free in __blkdev_direct_IO fs/block_dev.c:468 [inline] BUG: KASAN: use-after-free in blkdev_direct_IO+0x13cd/0x1590 fs/block_dev.c:518 Read of size 4 at addr ffff8880a196e228 by task syz-executor.0/17010 CPU: 1 PID: 17010 Comm: syz-executor.0 Not tainted 5.3.0-rc2+ #113 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+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0xd4/0x306 mm/kasan/report.c:351 __kasan_report.cold+0x1b/0x36 mm/kasan/report.c:482 kasan_report+0x12/0x17 mm/kasan/common.c:612 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:131 __blkdev_direct_IO fs/block_dev.c:468 [inline] blkdev_direct_IO+0x13cd/0x1590 fs/block_dev.c:518 generic_file_direct_write+0x20a/0x4a0 mm/filemap.c:3230 __generic_file_write_iter+0x2ee/0x630 mm/filemap.c:3413 blkdev_write_iter fs/block_dev.c:1993 [inline] blkdev_write_iter+0x23a/0x440 fs/block_dev.c:1970 call_write_iter include/linux/fs.h:1870 [inline] new_sync_write+0x4d3/0x770 fs/read_write.c:483 __vfs_write+0xe1/0x110 fs/read_write.c:496 vfs_write+0x268/0x5d0 fs/read_write.c:558 ksys_write+0x14f/0x290 fs/read_write.c:611 __do_sys_write fs/read_write.c:623 [inline] __se_sys_write fs/read_write.c:620 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:620 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459829 Code: fd b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fdcb6709c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459829 RDX: 0000000052698b21 RSI: 0000000020000000 RDI: 0000000000000003 RBP: 000000000075c070 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fdcb670a6d4 R13: 00000000004c5db7 R14: 00000000004e00e0 R15: 00000000ffffffff Allocated by task 17010: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:487 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:460 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:495 slab_post_alloc_hook mm/slab.h:520 [inline] slab_alloc mm/slab.c:3319 [inline] kmem_cache_alloc+0x121/0x710 mm/slab.c:3483 mempool_alloc_slab+0x47/0x60 mm/mempool.c:513 mempool_alloc+0x169/0x380 mm/mempool.c:393 bio_alloc_bioset+0x3b9/0x680 block/bio.c:477 bio_alloc include/linux/bio.h:400 [inline] __blkdev_direct_IO fs/block_dev.c:470 [inline] blkdev_direct_IO+0x8b0/0x1590 fs/block_dev.c:518 generic_file_direct_write+0x20a/0x4a0 mm/filemap.c:3230 __generic_file_write_iter+0x2ee/0x630 mm/filemap.c:3413 blkdev_write_iter fs/block_dev.c:1993 [inline] blkdev_write_iter+0x23a/0x440 fs/block_dev.c:1970 call_write_iter include/linux/fs.h:1870 [inline] new_sync_write+0x4d3/0x770 fs/read_write.c:483 __vfs_write+0xe1/0x110 fs/read_write.c:496 vfs_write+0x268/0x5d0 fs/read_write.c:558 ksys_write+0x14f/0x290 fs/read_write.c:611 __do_sys_write fs/read_write.c:623 [inline] __se_sys_write fs/read_write.c:620 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:620 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 16: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:449 kasan_slab_free+0xe/0x10 mm/kasan/common.c:457 __cache_free mm/slab.c:3425 [inline] kmem_cache_free+0x86/0x320 mm/slab.c:3693 mempool_free_slab+0x1e/0x30 mm/mempool.c:520 mempool_free+0xeb/0x370 mm/mempool.c:502 bio_free+0x267/0x420 block/bio.c:255 bio_put+0xda/0x110 block/bio.c:549 blkdev_bio_end_io+0x338/0x4b0 fs/block_dev.c:333 bio_endio+0x611/0xaf0 block/bio.c:1830 req_bio_endio block/blk-core.c:239 [inline] blk_update_request+0x32e/0xc10 block/blk-core.c:1424 blk_mq_end_request+0x5b/0x560 block/blk-mq.c:557 blk_flush_complete_seq+0x558/0x1030 block/blk-flush.c:196 flush_end_io+0x3d1/0x6d0 block/blk-flush.c:237 __blk_mq_end_request block/blk-mq.c:548 [inline] blk_mq_end_request+0x32e/0x560 block/blk-mq.c:559 lo_complete_rq+0x210/0x2e0 drivers/block/loop.c:485 blk_done_softirq+0x2fe/0x4d0 block/blk-softirq.c:37 __do_softirq+0x262/0x98c kernel/softirq.c:292 The buggy address belongs to the object at ffff8880a196e200 which belongs to the cache bio-0 of size 192 The buggy address is located 40 bytes inside of 192-byte region [ffff8880a196e200, ffff8880a196e2c0) The buggy address belongs to the page: page:ffffea0002865b80 refcount:1 mapcount:0 mapping:ffff8880a8212380 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea000290f7c8 ffffea0002818248 ffff8880a8212380 raw: 0000000000000000 ffff8880a196e000 0000000100000010 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a196e100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a196e180: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8880a196e200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a196e280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880a196e300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================