================================================================== BUG: KASAN: use-after-free in ext4_data_block_valid+0x2d5/0x330 fs/ext4/block_validity.c:211 Read of size 8 at addr ffff8881c5364750 by task syz-executor1/6025 CPU: 0 PID: 6025 Comm: syz-executor1 Not tainted 4.20.0-rc2+ #338 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+0x244/0x39d lib/dump_stack.c:113 print_address_description.cold.7+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.8+0x242/0x309 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 ext4_data_block_valid+0x2d5/0x330 fs/ext4/block_validity.c:211 ext4_valid_extent fs/ext4/extents.c:380 [inline] ext4_valid_extent_entries fs/ext4/extents.c:410 [inline] __ext4_ext_check+0xc77/0x1330 fs/ext4/extents.c:465 ext4_ext_remove_space+0x27e0/0x5b50 fs/ext4/extents.c:3000 ext4_ext_truncate+0x1cc/0x220 fs/ext4/extents.c:4543 ext4_truncate+0xf5c/0x1650 fs/ext4/inode.c:4533 ext4_evict_inode+0xa10/0x1ad0 fs/ext4/inode.c:289 evict+0x4b9/0x980 fs/inode.c:558 iput_final fs/inode.c:1547 [inline] iput+0x679/0xa90 fs/inode.c:1573 dentry_unlink_inode+0x461/0x5e0 fs/dcache.c:360 d_delete+0x1d7/0x220 fs/dcache.c:2350 vfs_rmdir+0x38b/0x470 fs/namei.c:3893 do_rmdir+0x537/0x630 fs/namei.c:3941 __do_sys_rmdir fs/namei.c:3959 [inline] __se_sys_rmdir fs/namei.c:3957 [inline] __x64_sys_rmdir+0x36/0x40 fs/namei.c:3957 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4572d7 Code: 00 66 90 b8 57 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 7d b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 b8 54 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 5d b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ffc7b205858 EFLAGS: 00000207 ORIG_RAX: 0000000000000054 RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 00000000004572d7 RDX: 0000000000000000 RSI: 000000000070d698 RDI: 00007ffc7b206990 RBP: 0000000000000239 R08: 0000000000000000 R09: 0000000000000001 R10: 000000000000000a R11: 0000000000000207 R12: 00007ffc7b206990 R13: 000000000232a940 R14: 0000000000000000 R15: 0000000000000001 Allocated by task 1: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:490 kmem_cache_alloc+0x12e/0x730 mm/slab.c:3554 add_system_zone+0x2e5/0x5f0 fs/ext4/block_validity.c:85 ext4_setup_system_zone+0x208/0x520 fs/ext4/block_validity.c:169 ext4_fill_super+0x89ee/0xdbb0 fs/ext4/super.c:4384 mount_bdev+0x30c/0x3e0 fs/super.c:1158 ext4_mount+0x34/0x40 fs/ext4/super.c:5893 mount_fs+0xae/0x31d fs/super.c:1261 vfs_kern_mount.part.35+0xdc/0x4f0 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2469 [inline] do_mount+0x581/0x31f0 fs/namespace.c:2801 ksys_mount+0x12d/0x140 fs/namespace.c:3017 do_mount_root+0x35/0x1d3 init/do_mounts.c:387 mount_block_root+0x39c/0x6ed init/do_mounts.c:416 mount_root+0x358/0x39f init/do_mounts.c:561 prepare_namespace+0x26c/0x2ab init/do_mounts.c:620 kernel_init_freeable+0x69b/0x6b9 init/main.c:1170 kernel_init+0x11/0x1ae init/main.c:1071 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352 Freed by task 10256: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kmem_cache_free+0x83/0x290 mm/slab.c:3760 ext4_release_system_zone+0x7c/0x110 fs/ext4/block_validity.c:187 ext4_setup_system_zone+0x3ef/0x520 fs/ext4/block_validity.c:151 ext4_remount+0x16fc/0x2980 fs/ext4/super.c:5338 do_remount_sb+0x350/0x7b0 fs/super.c:888 do_remount fs/namespace.c:2290 [inline] do_mount+0x1513/0x31f0 fs/namespace.c:2792 ksys_mount+0x12d/0x140 fs/namespace.c:3017 __do_sys_mount fs/namespace.c:3031 [inline] __se_sys_mount fs/namespace.c:3028 [inline] __x64_sys_mount+0xbe/0x150 fs/namespace.c:3028 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8881c5364738 which belongs to the cache ext4_system_zone of size 40 The buggy address is located 24 bytes inside of 40-byte region [ffff8881c5364738, ffff8881c5364760) The buggy address belongs to the page: page:ffffea000714d900 count:1 mapcount:0 mapping:ffff8881d450c300 index:0xffff8881c5364fb9 flags: 0x2fffc0000000200(slab) raw: 02fffc0000000200 ffff8881d450b138 ffff8881d450b138 ffff8881d450c300 raw: ffff8881c5364fb9 ffff8881c5364000 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881c5364600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881c5364680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881c5364700: fc fc fc fc fc fc fc fb fb fb fb fb fc fc fb fb ^ ffff8881c5364780: fb fb fb fc fc fb fb fb fb fb fc fc fb fb fb fb ffff8881c5364800: fb fc fc fb fb fb fb fb fc fc fb fb fb fb fb fc ==================================================================