syzbot


KASAN: use-after-free Read in ext4_inode_block_valid (2)

Status: auto-closed as invalid on 2022/07/12 03:24
Reported-by: syzbot+1f521b95f2a327f55ae1@syzkaller.appspotmail.com
First crash: 767d, last: 767d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: use-after-free Read in ext4_inode_block_valid 3 1069d 1108d 0/1 auto-closed as invalid on 2021/09/13 02:10
linux-4.14 KASAN: use-after-free Read in ext4_inode_block_valid (3) 2 524d 532d 0/1 auto-obsoleted due to no activity on 2023/03/12 01:03

Sample crash report:
team0: Device macsec0 is up. Set it down before adding it as a team port
==================================================================
BUG: KASAN: use-after-free in ext4_inode_block_valid+0x33b/0x3b0 fs/ext4/block_validity.c:255
Read of size 8 at addr ffff8880a4203d00 by task kworker/u4:3/12496

CPU: 0 PID: 12496 Comm: kworker/u4:3 Not tainted 4.14.271-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load8_noabort+0x68/0x70 mm/kasan/report.c:430
 ext4_inode_block_valid+0x33b/0x3b0 fs/ext4/block_validity.c:255
 __check_block_validity.constprop.0+0x17a/0x2c0 fs/ext4/inode.c:423
 ext4_map_blocks+0xc40/0x1730 fs/ext4/inode.c:612
 ext4_getblk+0x314/0x3f0 fs/ext4/inode.c:992
 ext4_bread_batch+0x7a/0x330 fs/ext4/inode.c:1062
 ext4_find_entry+0x419/0xc80 fs/ext4/namei.c:1442
 ext4_lookup fs/ext4/namei.c:1584 [inline]
 ext4_lookup+0x10c/0x580 fs/ext4/namei.c:1560
 lookup_open+0x5c4/0x1750 fs/namei.c:3220
 do_last fs/namei.c:3334 [inline]
 path_openat+0x14bb/0x2970 fs/namei.c:3569
 do_filp_open+0x179/0x3c0 fs/namei.c:3603
 do_open_execat+0xd3/0x450 fs/exec.c:849
 do_execveat_common+0x711/0x1f30 fs/exec.c:1755
 do_execve+0x33/0x50 fs/exec.c:1860
 call_usermodehelper_exec_async+0x2ed/0x510 kernel/umh.c:109
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

Allocated by task 1:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
 kmem_cache_alloc+0x124/0x3c0 mm/slab.c:3552
 add_system_zone+0x108/0x650 fs/ext4/block_validity.c:78
 ext4_setup_system_zone+0x231/0x8c0 fs/ext4/block_validity.c:206
 ext4_fill_super+0x62cc/0xb290 fs/ext4/super.c:4395
 mount_bdev+0x2b3/0x360 fs/super.c:1134
 mount_fs+0x92/0x2a0 fs/super.c:1237
 vfs_kern_mount.part.0+0x5b/0x470 fs/namespace.c:1046
 vfs_kern_mount fs/namespace.c:1036 [inline]
 do_new_mount fs/namespace.c:2572 [inline]
 do_mount+0xe65/0x2a10 fs/namespace.c:2902
 SYSC_mount fs/namespace.c:3118 [inline]
 SyS_mount+0xa8/0x120 fs/namespace.c:3095
 do_mount_root+0x30/0x1b0 init/do_mounts.c:366
 mount_block_root+0x2bc/0x5a3 init/do_mounts.c:395
 mount_root+0x1c4/0x1f3 init/do_mounts.c:540
 prepare_namespace+0x1d6/0x212 init/do_mounts.c:599
 kernel_init_freeable+0x609/0x626 init/main.c:1093
 kernel_init+0xd/0x168 init/main.c:1000
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

Freed by task 12437:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kmem_cache_free+0x7c/0x2b0 mm/slab.c:3758
 ext4_release_system_zone+0x79/0x110 fs/ext4/block_validity.c:230
 ext4_setup_system_zone+0x3a9/0x8c0 fs/ext4/block_validity.c:188
 ext4_remount+0xfa2/0x1df0 fs/ext4/super.c:5375
 do_remount_sb+0x150/0x530 fs/super.c:868
 do_remount fs/namespace.c:2393 [inline]
 do_mount+0x1644/0x2a10 fs/namespace.c:2893
 SYSC_mount fs/namespace.c:3118 [inline]
 SyS_mount+0xa8/0x120 fs/namespace.c:3095
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

The buggy address belongs to the object at ffff8880a4203ce8
 which belongs to the cache ext4_system_zone of size 40
The buggy address is located 24 bytes inside of
 40-byte region [ffff8880a4203ce8, ffff8880a4203d10)
The buggy address belongs to the page:
page:ffffea00029080c0 count:1 mapcount:0 mapping:ffff8880a4203000 index:0xffff8880a4203fb9
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff8880a4203000 ffff8880a4203fb9 0000000100000003
raw: ffff8880b11ea038 ffff8880b11ea038 ffff8880b11e9a80 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880a4203c00: fc fb fb fb fb fb fc fc fb fb fb fb fb fc fc fb
 ffff8880a4203c80: fb fb fb fb fc fc fb fb fb fb fb fc fc fb fb fb
>ffff8880a4203d00: fb fb fc fc fb fb fb fb fb fc fc fb fb fb fb fb
                   ^
 ffff8880a4203d80: fc fc fb fb fb fb fb fc fc fb fb fb fb fb fc fc
 ffff8880a4203e00: fb fb fb fb fb fc fc fb fb fb fb fb fc fc fb fb
==================================================================
EXT4-fs (sda1): re-mounted. Opts: noblock_validity,,errors=continue
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.2'.

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/03/14 03:23 linux-4.14.y af48f51cb593 9e8eaa75 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in ext4_inode_block_valid
* Struck through repros no longer work on HEAD.