syzbot


KASAN: slab-out-of-bounds Write in ext4_write_inline_data_end (2)

Status: auto-obsoleted due to no activity on 2023/07/24 06:06
Subsystems: ext4
[Documentation on labels]
Reported-by: syzbot+ba4fa9ce904fefb787d3@syzkaller.appspotmail.com
First crash: 386d, last: 386d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [ext4?] KASAN: slab-out-of-bounds Write in ext4_write_inline_data_end (2) 0 (1) 2023/04/03 05:32
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-54 KASAN: use-after-free Write in ext4_write_inline_data_end C 6 1074d 1118d 0/2 auto-obsoleted due to no activity on 2023/04/19 14:50
upstream KASAN: slab-out-of-bounds Write in ext4_write_inline_data_end ext4 C done 1 971d 970d 20/26 fixed on 2021/11/10 00:50

Sample crash report:
EXT4-fs error (device loop1): __ext4_get_inode_loc:4560: comm syz-executor.1: Invalid inode table block 8387954787021251444 in block_group 0
==================================================================
BUG: KASAN: slab-out-of-bounds in ext4_write_inline_data fs/ext4/inline.c:248 [inline]
BUG: KASAN: slab-out-of-bounds in ext4_write_inline_data_end+0x5b4/0x10e0 fs/ext4/inline.c:766
Write of size 1 at addr ffff88802cc1f9ae by task syz-executor.1/23455

CPU: 1 PID: 23455 Comm: syz-executor.1 Not tainted 6.3.0-rc3-syzkaller-00338-gda8e7da11e4b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:319 [inline]
 print_report+0x163/0x540 mm/kasan/report.c:430
 kasan_report+0x176/0x1b0 mm/kasan/report.c:536
 kasan_check_range+0x283/0x290 mm/kasan/generic.c:187
 __asan_memcpy+0x40/0x70 mm/kasan/shadow.c:106
 ext4_write_inline_data fs/ext4/inline.c:248 [inline]
 ext4_write_inline_data_end+0x5b4/0x10e0 fs/ext4/inline.c:766
 generic_perform_write+0x3ed/0x5e0 mm/filemap.c:3937
 ext4_buffered_write_iter+0x122/0x3a0 fs/ext4/file.c:289
 ext4_file_write_iter+0x1d6/0x1930
 do_iter_write+0x6ea/0xc50 fs/read_write.c:861
 iter_file_splice_write+0x843/0xfe0 fs/splice.c:778
 do_splice_from fs/splice.c:856 [inline]
 direct_splice_actor+0xe7/0x1c0 fs/splice.c:1022
 splice_direct_to_actor+0x4c4/0xbd0 fs/splice.c:977
 do_splice_direct+0x283/0x3d0 fs/splice.c:1065
 do_sendfile+0x620/0xff0 fs/read_write.c:1255
 __do_sys_sendfile64 fs/read_write.c:1323 [inline]
 __se_sys_sendfile64+0x17c/0x1e0 fs/read_write.c:1309
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f14b828c0f9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 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:00007f14b8fd4168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007f14b83abf80 RCX: 00007f14b828c0f9
RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000006
RBP: 00007f14b82e7b39 R08: 0000000000000000 R09: 0000000000000000
R10: 000000000001ffff R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff8d44f2ff R14: 00007f14b8fd4300 R15: 0000000000022000
 </TASK>

Allocated by task 2:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4f/0x70 mm/kasan/common.c:52
 ____kasan_kmalloc mm/kasan/common.c:374 [inline]
 __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:383
 kasan_kmalloc include/linux/kasan.h:196 [inline]
 __do_kmalloc_node mm/slab_common.c:967 [inline]
 __kmalloc+0xb9/0x230 mm/slab_common.c:980
 kmalloc include/linux/slab.h:584 [inline]
 kzalloc include/linux/slab.h:720 [inline]
 lsm_cred_alloc security/security.c:568 [inline]
 security_prepare_creds+0x4c/0x140 security/security.c:1781
 prepare_creds+0x458/0x630 kernel/cred.c:291
 copy_creds+0x14a/0xca0 kernel/cred.c:365
 copy_process+0x94a/0x3fc0 kernel/fork.c:2124
 kernel_clone+0x222/0x800 kernel/fork.c:2679
 kernel_thread+0x156/0x1d0 kernel/fork.c:2739
 create_kthread kernel/kthread.c:399 [inline]
 kthreadd+0x583/0x750 kernel/kthread.c:746
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308

The buggy address belongs to the object at ffff88802cc1f800
 which belongs to the cache kmalloc-cg-256 of size 256
The buggy address is located 230 bytes to the right of
 allocated 200-byte region [ffff88802cc1f800, ffff88802cc1f8c8)

The buggy address belongs to the physical page:
page:ffffea0000b30780 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802cc1f400 pfn:0x2cc1e
head:ffffea0000b30780 order:1 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff88802fa51901
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffff88801244f000 ffff88801244e4c8 ffffea0000940d90
raw: ffff88802cc1f400 0000000000100004 00000001ffffffff ffff88802fa51901
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4381, tgid 4381 (kworker/u4:5), ts 11572064611, free_ts 0
 prep_new_page mm/page_alloc.c:2553 [inline]
 get_page_from_freelist+0x3246/0x33c0 mm/page_alloc.c:4326
 __alloc_pages+0x255/0x670 mm/page_alloc.c:5592
 alloc_slab_page+0x6a/0x160 mm/slub.c:1851
 allocate_slab mm/slub.c:1998 [inline]
 new_slab+0x84/0x2f0 mm/slub.c:2051
 ___slab_alloc+0xa85/0x10a0 mm/slub.c:3193
 __slab_alloc mm/slub.c:3292 [inline]
 __slab_alloc_node mm/slub.c:3345 [inline]
 slab_alloc_node mm/slub.c:3442 [inline]
 __kmem_cache_alloc_node+0x1b8/0x290 mm/slub.c:3491
 __do_kmalloc_node mm/slab_common.c:966 [inline]
 __kmalloc+0xa8/0x230 mm/slab_common.c:980
 kmalloc include/linux/slab.h:584 [inline]
 kzalloc include/linux/slab.h:720 [inline]
 lsm_cred_alloc security/security.c:568 [inline]
 security_prepare_creds+0x4c/0x140 security/security.c:1781
 prepare_creds+0x458/0x630 kernel/cred.c:291
 prepare_exec_creds+0x18/0x270 kernel/cred.c:311
 prepare_bprm_creds fs/exec.c:1477 [inline]
 bprm_execve+0xff/0x1740 fs/exec.c:1815
 kernel_execve+0x8ea/0xa10 fs/exec.c:2020
 call_usermodehelper_exec_async+0x233/0x370 kernel/umh.c:110
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
page_owner free stack trace missing

Memory state around the buggy address:
 ffff88802cc1f880: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
 ffff88802cc1f900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88802cc1f980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                                  ^
 ffff88802cc1fa00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88802cc1fa80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/03/26 06:04 upstream da8e7da11e4b fbf0499a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: slab-out-of-bounds Write in ext4_write_inline_data_end
* Struck through repros no longer work on HEAD.