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

4 views
Skip to first unread message

syzbot

unread,
Nov 3, 2022, 2:15:41 AM11/3/22
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: a85772d7ba90 Linux 4.14.297
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14ce21de880000
kernel config: https://syzkaller.appspot.com/x/.config?x=c7c676c786714374
dashboard link: https://syzkaller.appspot.com/bug?extid=22807e38ecf2233aa7f5
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/39db606a8a5a/disk-a85772d7.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/bc47cfcb03c7/vmlinux-a85772d7.xz
kernel image: https://storage.googleapis.com/syzbot-assets/a5aa85f7ae07/bzImage-a85772d7.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+22807e...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in ext4_inode_block_valid+0x33b/0x3b0 fs/ext4/block_validity.c:255
Read of size 8 at addr ffff8882351562b8 by task syz-executor.1/10386

CPU: 1 PID: 10386 Comm: syz-executor.1 Not tainted 4.14.297-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022
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+0x8dc/0x1730 fs/ext4/inode.c:738
ext4_alloc_file_blocks.isra.0+0x24e/0x840 fs/ext4/extents.c:4732
ext4_fallocate+0x713/0x1d80 fs/ext4/extents.c:5014
vfs_fallocate+0x346/0x790 fs/open.c:319
ioctl_preallocate+0x132/0x1a0 fs/ioctl.c:481
file_ioctl fs/ioctl.c:497 [inline]
do_vfs_ioctl+0xd94/0xff0 fs/ioctl.c:684
SYSC_ioctl fs/ioctl.c:701 [inline]
SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x5e/0xd3

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+0x325/0x8c0 fs/ext4/block_validity.c:197
ext4_fill_super+0x63a9/0xb3c0 fs/ext4/super.c:4407
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/0x2a30 fs/namespace.c:2905
SYSC_mount fs/namespace.c:3121 [inline]
SyS_mount+0xa8/0x120 fs/namespace.c:3098
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:1099
kernel_init+0xd/0x15b init/main.c:1006
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:406

Freed by task 10384:
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:5387
do_remount_sb+0x150/0x530 fs/super.c:868
do_remount fs/namespace.c:2393 [inline]
do_mount+0x15f3/0x2a30 fs/namespace.c:2896
SYSC_mount fs/namespace.c:3121 [inline]
SyS_mount+0xa8/0x120 fs/namespace.c:3098
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x5e/0xd3

The buggy address belongs to the object at ffff8882351562a0
which belongs to the cache ext4_system_zone of size 40
The buggy address is located 24 bytes inside of
40-byte region [ffff8882351562a0, ffff8882351562c8)
The buggy address belongs to the page:
page:ffffea0008d45580 count:1 mapcount:0 mapping:ffff888235156000 index:0xffff888235156fb9
flags: 0x57ff00000000100(slab)
raw: 057ff00000000100 ffff888235156000 ffff888235156fb9 000000010000001b
raw: ffff8882392dad38 ffff8882392dad38 ffff8880b1234d80 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff888235156180: fc fb fb fb fb fb fc fc fb fb fb fb fb fc fc fb
ffff888235156200: fb fb fb fb fc fc fb fb fb fb fb fc fc fb fb fb
>ffff888235156280: fb fb fc fc fb fb fb fb fb fc fc fb fb fb fb fb
^
ffff888235156300: fc fc fb fb fb fb fb fc fc fb fb fb fb fb fc fc
ffff888235156380: fb fb fb fb fb fc fc fb fb fb fb fb fc fc fb fb
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Mar 11, 2023, 8:03:34 PM3/11/23
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages