KASAN: use-after-free Write in ext4_write_inline_data_end

12 views
Skip to first unread message

syzbot

unread,
Mar 24, 2021, 4:23:20 PM3/24/21
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 32de1122 ANDROID: gki_defconfig: Enable IFB, NET_SCH_TBF, ..
git tree: android12-5.4
console output: https://syzkaller.appspot.com/x/log.txt?x=101adad6d00000
kernel config: https://syzkaller.appspot.com/x/.config?x=c34b9a3c528ee57b
dashboard link: https://syzkaller.appspot.com/bug?extid=5c0b255d1327b140e7f1
compiler: Debian clang version 11.0.1-2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1035c1f6d00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17fc18bed00000

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

==================================================================
BUG: KASAN: use-after-free in ext4_write_inline_data fs/ext4/inline.c:246 [inline]
BUG: KASAN: use-after-free in ext4_write_inline_data_end+0x500/0x8c0 fs/ext4/inline.c:768
Write of size 70 at addr ffff8881ebab3016 by task syz-executor102/342

CPU: 0 PID: 342 Comm: syz-executor102 Not tainted 5.4.107-syzkaller-00754-g32de11228337 #0
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+0x1d8/0x24e lib/dump_stack.c:118
print_address_description+0x9b/0x650 mm/kasan/report.c:384
__kasan_report+0x182/0x260 mm/kasan/report.c:516
kasan_report+0x30/0x60 mm/kasan/common.c:641
check_memory_region_inline mm/kasan/generic.c:141 [inline]
check_memory_region+0x2a5/0x2e0 mm/kasan/generic.c:191
memcpy+0x38/0x50 mm/kasan/common.c:124
ext4_write_inline_data fs/ext4/inline.c:246 [inline]
ext4_write_inline_data_end+0x500/0x8c0 fs/ext4/inline.c:768
ext4_write_end+0x1d5/0xe50 fs/ext4/inode.c:1446
generic_perform_write+0x403/0x5a0 mm/filemap.c:3303
__generic_file_write_iter+0x239/0x480 mm/filemap.c:3421
ext4_file_write_iter+0x49e/0x10e0 fs/ext4/file.c:270
call_write_iter include/linux/fs.h:1971 [inline]
new_sync_write fs/read_write.c:483 [inline]
__vfs_write+0x5ec/0x780 fs/read_write.c:496
vfs_write+0x212/0x4e0 fs/read_write.c:558
ksys_write+0x186/0x2b0 fs/read_write.c:611
do_syscall_64+0xcb/0x1e0 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x451fb9
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 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f13d86f9208 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00000000004cc3f8 RCX: 0000000000451fb9
RDX: 0000000000000082 RSI: 0000000020000180 RDI: 0000000000000007
RBP: 00000000004cc3f0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004cc3fc
R13: 00007fff922164bf R14: 00007f13d86f9300 R15: 0000000000022000

Allocated by task 288:
save_stack mm/kasan/common.c:70 [inline]
set_track mm/kasan/common.c:78 [inline]
__kasan_kmalloc+0x137/0x1e0 mm/kasan/common.c:517
slab_post_alloc_hook mm/slab.h:584 [inline]
slab_alloc_node mm/slub.c:2821 [inline]
slab_alloc mm/slub.c:2829 [inline]
kmem_cache_alloc+0x115/0x290 mm/slub.c:2834
getname_flags+0xba/0x640 fs/namei.c:141
do_sys_open+0x33e/0x7c0 fs/open.c:1087
do_syscall_64+0xcb/0x1e0 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x44/0xa9

Freed by task 288:
save_stack mm/kasan/common.c:70 [inline]
set_track mm/kasan/common.c:78 [inline]
kasan_set_free_info mm/kasan/common.c:333 [inline]
__kasan_slab_free+0x18a/0x240 mm/kasan/common.c:475
slab_free_hook mm/slub.c:1454 [inline]
slab_free_freelist_hook+0x7b/0x150 mm/slub.c:1492
slab_free mm/slub.c:3072 [inline]
kmem_cache_free+0xb8/0x5f0 mm/slub.c:3088
do_sys_open+0x62e/0x7c0 fs/open.c:1102
do_syscall_64+0xcb/0x1e0 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x44/0xa9

The buggy address belongs to the object at ffff8881ebab2200
which belongs to the cache names_cache of size 4096
The buggy address is located 3606 bytes inside of
4096-byte region [ffff8881ebab2200, ffff8881ebab3200)
The buggy address belongs to the page:
page:ffffea0007aeac00 refcount:1 mapcount:0 mapping:ffff8881f5cfb680 index:0x0 compound_mapcount: 0
flags: 0x8000000000010200(slab|head)
raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5cfb680
raw: 0000000000000000 0000000000070007 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8881ebab2f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8881ebab2f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881ebab3000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8881ebab3080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8881ebab3100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb 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 can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Apr 19, 2023, 10:50:34 AM4/19/23
to syzkaller-a...@googlegroups.com
Auto-closing this bug as obsolete.
No recent activity, existing reproducers are no longer triggering the issue.
Reply all
Reply to author
Forward
0 new messages