syzbot


KASAN: use-after-free Write in ext4_write_inline_data_end

Status: auto-obsoleted due to no activity on 2023/04/19 14:50
Reported-by: syzbot+5c0b255d1327b140e7f1@syzkaller.appspotmail.com
First crash: 1339d, last: 1296d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-out-of-bounds Write in ext4_write_inline_data_end (2) ext4 1 608d 600d 0/28 auto-obsoleted due to no activity on 2023/07/24 06:06
upstream KASAN: slab-out-of-bounds Write in ext4_write_inline_data_end ext4 C done 1 1192d 1192d 20/28 fixed on 2021/11/10 00:50
Last patch testing requests (2)
Created Duration User Patch Repo Result
2023/04/19 14:15 22m retest repro android12-5.4 OK log
2023/04/19 14:15 19m retest repro android12-5.4 OK log

Sample crash report:
==================================================================
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 ffff8881e89d8016 by task syz-executor777/343

CPU: 1 PID: 343 Comm: syz-executor777 Not tainted 5.4.116-syzkaller-00001-g6aabee0aa2de #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:0x449c09
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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f6388c4f2f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00000000004cb420 RCX: 0000000000449c09
RDX: 0000000000000082 RSI: 00000000200000c0 RDI: 0000000000000008
RBP: 000000000049b064 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0030656c69662f2e
R13: 0000000300000002 R14: efd76d87389d3913 R15: 00000000004cb428

Allocated by task 1:
 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
 user_path_at_empty+0x28/0x50 fs/namei.c:2683
 user_path_at include/linux/namei.h:49 [inline]
 vfs_statx fs/stat.c:187 [inline]
 vfs_lstat include/linux/fs.h:3349 [inline]
 __do_sys_newlstat fs/stat.c:354 [inline]
 __se_sys_newlstat+0xde/0x860 fs/stat.c:348
 do_syscall_64+0xcb/0x1e0 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Freed by task 1:
 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
 putname fs/namei.c:262 [inline]
 filename_lookup+0x4bb/0x6a0 fs/namei.c:2432
 user_path_at include/linux/namei.h:49 [inline]
 vfs_statx fs/stat.c:187 [inline]
 vfs_lstat include/linux/fs.h:3349 [inline]
 __do_sys_newlstat fs/stat.c:354 [inline]
 __se_sys_newlstat+0xde/0x860 fs/stat.c:348
 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 ffff8881e89d8000
 which belongs to the cache names_cache of size 4096
The buggy address is located 22 bytes inside of
 4096-byte region [ffff8881e89d8000, ffff8881e89d9000)
The buggy address belongs to the page:
page:ffffea0007a27600 refcount:1 mapcount:0 mapping:ffff8881f5cfb400 index:0x0 compound_mapcount: 0
flags: 0x8000000000010200(slab|head)
raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5cfb400
raw: 0000000000000000 0000000000070007 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC)
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook mm/page_alloc.c:2165 [inline]
 prep_new_page+0x19a/0x380 mm/page_alloc.c:2171
 get_page_from_freelist+0x550/0x8b0 mm/page_alloc.c:3794
 __alloc_pages_nodemask+0x3a2/0x880 mm/page_alloc.c:4855
 alloc_slab_page+0x39/0x3e0 mm/slub.c:342
 allocate_slab mm/slub.c:1675 [inline]
 new_slab+0x97/0x460 mm/slub.c:1741
 new_slab_objects mm/slub.c:2498 [inline]
 ___slab_alloc+0x330/0x4c0 mm/slub.c:2659
 __slab_alloc mm/slub.c:2699 [inline]
 slab_alloc_node mm/slub.c:2784 [inline]
 slab_alloc mm/slub.c:2829 [inline]
 kmem_cache_alloc+0x18b/0x290 mm/slub.c:2834
 getname_flags+0xba/0x640 fs/namei.c:141
 do_sys_open+0x33e/0x7c0 fs/open.c:1107
 do_syscall_64+0xcb/0x1e0 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
page_owner free stack trace missing

Memory state around the buggy address:
 ffff8881e89d7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8881e89d7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8881e89d8000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                         ^
 ffff8881e89d8080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881e89d8100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/05/05 23:04 android12-5.4 6aabee0aa2de 06c27ff5 .config console log report syz C ci2-android-5-4-kasan KASAN: use-after-free Write in ext4_write_inline_data_end
2021/03/24 20:22 android12-5.4 32de11228337 607e3baf .config console log report syz C ci2-android-5-4-kasan KASAN: use-after-free Write in ext4_write_inline_data_end
2021/05/06 16:19 android12-5.4 dfece79f2f98 06585184 .config console log report info ci2-android-5-4-kasan KASAN: use-after-free Write in ext4_write_inline_data_end
2021/05/06 13:00 android12-5.4 dfece79f2f98 06c27ff5 .config console log report info ci2-android-5-4-kasan KASAN: use-after-free Write in ext4_write_inline_data_end
2021/05/05 22:06 android12-5.4 6aabee0aa2de 06c27ff5 .config console log report info ci2-android-5-4-kasan KASAN: use-after-free Write in ext4_write_inline_data_end
2021/05/07 05:52 android12-5.4 6ae6a79ecc03 06585184 .config console log report info ci2-android-5-4-kasan KASAN: slab-out-of-bounds Write in ext4_write_inline_data_end
* Struck through repros no longer work on HEAD.