KASAN: use-after-free Read in ext4_rename_dir_prepare

7 views
Skip to first unread message

syzbot

unread,
Nov 18, 2022, 11:34:46 PM11/18/22
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3f8a27f9e27b Linux 4.19.211
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=139c4609880000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=536f81eebdd35bd6d6ac
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13bc4e0d880000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1760859e880000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/98c0bdb4abb3/disk-3f8a27f9.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/ea228ff02669/vmlinux-3f8a27f9.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/c5dc0ad47794/mount_0.gz

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

EXT4-fs (loop0): mounting with "discard" option, but the device does not support discard
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
EXT4-fs (loop0): mounting with "discard" option, but the device does not support discard
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
==================================================================
BUG: KASAN: use-after-free in ext4_rename_dir_prepare+0x3a6/0x440 fs/ext4/namei.c:3381
Read of size 4 at addr ffff88808f155e02 by task syz-executor413/8142

CPU: 0 PID: 8142 Comm: syz-executor413 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
kasan_report mm/kasan/report.c:412 [inline]
__asan_report_load4_noabort+0x88/0x90 mm/kasan/report.c:432
ext4_rename_dir_prepare+0x3a6/0x440 fs/ext4/namei.c:3381
ext4_cross_rename+0x112f/0x14f0 fs/ext4/namei.c:3859
ext4_rename2+0x1be/0x210 fs/ext4/namei.c:3938
vfs_rename+0x67e/0x1bc0 fs/namei.c:4479
do_renameat2+0xb59/0xc70 fs/namei.c:4629
__do_sys_renameat2 fs/namei.c:4664 [inline]
__se_sys_renameat2 fs/namei.c:4661 [inline]
__x64_sys_renameat2+0xba/0x150 fs/namei.c:4661
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f7fd68de709
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd44b239b8 EFLAGS: 00000246 ORIG_RAX: 000000000000013c
RAX: ffffffffffffffda RBX: 00007f7fd6923ee0 RCX: 00007f7fd68de709
RDX: 00000000ffffff9c RSI: 00000000200004c0 RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000002 R09: 00007ffd44b239e0
R10: 0000000020000000 R11: 0000000000000246 R12: 00007ffd44b239dc
R13: 00007ffd44b23a10 R14: 00007ffd44b239f0 R15: 0000000000000001

The buggy address belongs to the page:
page:ffffea00023c5540 count:0 mapcount:0 mapping:0000000000000000 index:0x1
flags: 0xfff00000000000()
raw: 00fff00000000000 dead000000000100 dead000000000200 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88808f155d00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88808f155d80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88808f155e00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88808f155e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88808f155f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================


---
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 can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches
Reply all
Reply to author
Forward
0 new messages