BUG: KASAN: use-after-free in crc16+0x235/0x2d0 lib/crc16.c:58 Read of size 1 at addr ffff88816d7ac000 by task syz-executor.3/13756 CPU: 1 PID: 13756 Comm: syz-executor.3 Tainted: G W 5.10.161-syzkaller-00019-g416c4356f372 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/16/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3c0 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report+0x1a4/0x1f0 mm/kasan/report.c:436 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306 crc16+0x235/0x2d0 lib/crc16.c:58 ext4_group_desc_csum+0x851/0xb50 fs/ext4/super.c:2850 ext4_group_desc_csum_set+0x1d6/0x270 fs/ext4/super.c:2873 ext4_free_blocks+0x1b9e/0x2ad0 fs/ext4/mballoc.c:5527 ext4_remove_blocks+0xaf1/0x1180 fs/ext4/extents.c:2520 ext4_ext_rm_leaf+0xaa8/0x18c0 fs/ext4/extents.c:2704 ext4_ext_remove_space+0xf25/0x22a0 fs/ext4/extents.c:2952 ext4_ext_truncate+0x18a/0x210 fs/ext4/extents.c:4413 ext4_truncate+0xba0/0x1270 fs/ext4/inode.c:4356 ext4_evict_inode+0xf1e/0x1730 fs/ext4/inode.c:288 evict+0x2a3/0x6c0 fs/inode.c:577 iput_final fs/inode.c:1655 [inline] iput+0x61f/0x7d0 fs/inode.c:1681 do_unlinkat+0x51a/0x920 fs/namei.c:3982 __do_sys_unlink fs/namei.c:4022 [inline] __se_sys_unlink fs/namei.c:4020 [inline] __x64_sys_unlink+0x49/0x50 fs/namei.c:4020 do_syscall_64+0x34/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xc6 RIP: 0033:0x7fcf9d9270f9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fcf9c69a168 EFLAGS: 00000246 ORIG_RAX: 0000000000000057 RAX: ffffffffffffffda RBX: 00007fcf9da46f80 RCX: 00007fcf9d9270f9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000200 RBP: 00007fcf9d982ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc27c96f3f R14: 00007fcf9c69a300 R15: 0000000000022000 Allocated by task 13288: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:428 [inline] __kasan_slab_alloc+0xb2/0xe0 mm/kasan/common.c:461 kasan_slab_alloc include/linux/kasan.h:259 [inline] slab_post_alloc_hook include/../mm/slab.h:583 [inline] slab_alloc_node mm/slub.c:2956 [inline] slab_alloc mm/slub.c:2964 [inline] kmem_cache_alloc+0x16c/0x300 mm/slub.c:2969 mempool_alloc_slab+0x1d/0x30 mm/mempool.c:513 mempool_alloc+0x135/0x530 mm/mempool.c:393 bio_alloc_bioset+0x1db/0x650 block/bio.c:486 bio_alloc include/linux/bio.h:407 [inline] iomap_dio_bio_actor+0x526/0x12f0 fs/iomap/direct-io.c:278 iomap_dio_actor+0x34f/0x570 fs/iomap/direct-io.c:393 iomap_apply+0x3ab/0x7f0 fs/iomap/apply.c:84 __iomap_dio_rw+0x716/0x10d0 fs/iomap/direct-io.c:523 iomap_dio_rw+0x35/0x80 fs/iomap/direct-io.c:611 ext4_dio_write_iter fs/ext4/file.c:577 [inline] ext4_file_write_iter+0x10e0/0x1c70 fs/ext4/file.c:687 do_iter_readv_writev+0x52a/0x720 fs/read_write.c:737 do_iter_write+0x182/0x660 fs/read_write.c:866 vfs_iter_write+0x7c/0xa0 fs/read_write.c:907 iter_file_splice_write+0x8a1/0x10c0 fs/splice.c:686 do_splice_from fs/splice.c:764 [inline] direct_splice_actor+0xfe/0x130 fs/splice.c:933 splice_direct_to_actor+0x4f4/0xbd0 fs/splice.c:888 do_splice_direct+0x2a0/0x3f0 fs/splice.c:976 do_sendfile+0x9c7/0x1150 fs/read_write.c:1257 __do_sys_sendfile64 fs/read_write.c:1318 [inline] __se_sys_sendfile64 fs/read_write.c:1304 [inline] __x64_sys_sendfile64+0x1ce/0x230 fs/read_write.c:1304 do_syscall_64+0x34/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Freed by task 0: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:357 ____kasan_slab_free+0x121/0x160 mm/kasan/common.c:360 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:368 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:1604 [inline] slab_free_freelist_hook+0xcc/0x1a0 mm/slub.c:1630 slab_free mm/slub.c:3212 [inline] kmem_cache_free+0xa9/0x1f0 mm/slub.c:3228 mempool_free_slab+0x1d/0x30 mm/mempool.c:520 mempool_free+0xd5/0x310 mm/mempool.c:502 bio_put+0x34e/0x420 block/bio.c:266 iomap_dio_bio_end_io+0x26b/0x440 fs/iomap/direct-io.c:181 bio_endio+0x465/0x5c0 block/bio.c:1459 req_bio_endio block/blk-core.c:269 [inline] blk_update_request+0x6d5/0x1250 block/blk-core.c:1471 scsi_end_request+0x90/0x810 drivers/scsi/scsi_lib.c:570 scsi_io_completion+0x1c5/0x480 drivers/scsi/scsi_lib.c:967 scsi_finish_command+0x3a5/0x500 drivers/scsi/scsi.c:214 scsi_softirq_done+0x137/0x340 drivers/scsi/scsi_lib.c:1445 blk_done_softirq+0x372/0x410 block/blk-mq.c:592 __do_softirq+0x27e/0x596 kernel/softirq.c:305 The buggy address belongs to the object at ffff88816d7ac000 which belongs to the cache bio-0 of size 216 The buggy address is located 0 bytes inside of 216-byte region [ffff88816d7ac000, ffff88816d7ac0d8) The buggy address belongs to the page: page:ffffea0005b5eb00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x16d7ac flags: 0x8000000000000200(slab) raw: 8000000000000200 dead000000000100 dead000000000122 ffff888107fe8000 raw: 0000000000000000 00000000000c000c 00000001ffffffff 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 0x192880(GFP_NOWAIT|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 13288, ts 1109725488135, free_ts 1098680111526 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2386 [inline] prep_new_page mm/page_alloc.c:2392 [inline] get_page_from_freelist+0x755/0x810 mm/page_alloc.c:4073 __alloc_pages_nodemask+0x3b6/0x890 mm/page_alloc.c:5160 alloc_slab_page mm/slub.c:1815 [inline] allocate_slab+0x78/0x540 mm/slub.c:1817 new_slab mm/slub.c:1878 [inline] new_slab_objects mm/slub.c:2636 [inline] ___slab_alloc+0x131/0x2e0 mm/slub.c:2800 __slab_alloc+0x63/0xa0 mm/slub.c:2840 slab_alloc_node mm/slub.c:2922 [inline] slab_alloc mm/slub.c:2964 [inline] kmem_cache_alloc+0x1ef/0x300 mm/slub.c:2969 mempool_alloc_slab+0x1d/0x30 mm/mempool.c:513 mempool_alloc+0x135/0x530 mm/mempool.c:393 bio_alloc_bioset+0x1db/0x650 block/bio.c:486 bio_alloc include/linux/bio.h:407 [inline] iomap_dio_bio_actor+0x526/0x12f0 fs/iomap/direct-io.c:278 iomap_dio_actor+0x34f/0x570 fs/iomap/direct-io.c:393 iomap_apply+0x3ab/0x7f0 fs/iomap/apply.c:84 __iomap_dio_rw+0x716/0x10d0 fs/iomap/direct-io.c:523 iomap_dio_rw+0x35/0x80 fs/iomap/direct-io.c:611 ext4_dio_write_iter fs/ext4/file.c:577 [inline] ext4_file_write_iter+0x10e0/0x1c70 fs/ext4/file.c:687 do_iter_readv_writev+0x52a/0x720 fs/read_write.c:737 page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1332 [inline] free_pcp_prepare+0x18c/0x1c0 mm/page_alloc.c:1406 free_unref_page_prepare mm/page_alloc.c:3293 [inline] free_unref_page mm/page_alloc.c:3347 [inline] free_the_page mm/page_alloc.c:5219 [inline] __free_pages+0x390/0x570 mm/page_alloc.c:5228 pcpu_free_pages mm/percpu-vm.c:64 [inline] pcpu_depopulate_chunk mm/percpu-vm.c:328 [inline] __pcpu_balance_workfn mm/percpu.c:1976 [inline] pcpu_balance_workfn+0xaeb/0x1770 mm/percpu.c:2068 process_one_work+0x726/0xc10 kernel/workqueue.c:2296 worker_thread+0xb27/0x1550 kernel/workqueue.c:2442 kthread+0x349/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:299 Memory state around the buggy address: ffff88816d7abf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88816d7abf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88816d7ac000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88816d7ac080: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc ffff88816d7ac100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ==================================================================