syzbot


KCSAN: data-race in _copy_to_iter / memcpy_and_pad

Status: moderation: reported on 2025/05/21 12:34
Subsystems: block
[Documentation on labels]
Reported-by: syzbot+f490fb4b87e80227d334@syzkaller.appspotmail.com
First crash: 3d09h, last: 2d02h

Sample crash report:
EXT4-fs error (device loop3): ext4_orphan_get:1391: inode #15: comm syz.3.2848: casefold flag without casefold feature
EXT4-fs error (device loop3): ext4_orphan_get:1396: comm syz.3.2848: couldn't read orphan inode 15 (err -117)
==================================================================
BUG: KCSAN: data-race in _copy_to_iter / memcpy_and_pad

read to 0xffff888128902400 of 512 bytes by task 3308 on cpu 0:
 instrument_copy_to_user include/linux/instrumented.h:113 [inline]
 copy_to_user_iter lib/iov_iter.c:24 [inline]
 iterate_ubuf include/linux/iov_iter.h:30 [inline]
 iterate_and_advance2 include/linux/iov_iter.h:300 [inline]
 iterate_and_advance include/linux/iov_iter.h:328 [inline]
 _copy_to_iter+0x12d/0xdd0 lib/iov_iter.c:185
 copy_page_to_iter+0x171/0x2b0 lib/iov_iter.c:362
 copy_folio_to_iter include/linux/uio.h:198 [inline]
 filemap_read+0x413/0x990 mm/filemap.c:2753
 blkdev_read_iter+0x22d/0x2e0 block/fops.c:809
 new_sync_read fs/read_write.c:489 [inline]
 vfs_read+0x5cd/0x6f0 fs/read_write.c:570
 ksys_read+0xda/0x1a0 fs/read_write.c:713
 __do_sys_read fs/read_write.c:722 [inline]
 __se_sys_read fs/read_write.c:720 [inline]
 __x64_sys_read+0x40/0x50 fs/read_write.c:720
 x64_sys_call+0x2d77/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:1
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd0/0x1a0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

write to 0xffff888128902492 of 54 bytes by task 10884 on cpu 1:
 memcpy_and_pad+0x5a/0x80 lib/string_helpers.c:1005
 ext4_sample_last_mounted fs/ext4/file.c:873 [inline]
 ext4_file_open+0x50d/0x5d0 fs/ext4/file.c:895
 do_dentry_open+0x646/0xa20 fs/open.c:956
 vfs_open+0x37/0x1e0 fs/open.c:1086
 do_open fs/namei.c:3880 [inline]
 path_openat+0x1c5e/0x2170 fs/namei.c:4039
 do_filp_open+0x109/0x230 fs/namei.c:4066
 do_sys_openat2+0xa6/0x110 fs/open.c:1429
 do_sys_open fs/open.c:1444 [inline]
 __do_sys_creat fs/open.c:1522 [inline]
 __se_sys_creat fs/open.c:1516 [inline]
 __x64_sys_creat+0x65/0x90 fs/open.c:1516
 x64_sys_call+0x114d/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:86
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd0/0x1a0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 10884 Comm: syz.3.2848 Not tainted 6.15.0-rc7-syzkaller-00082-g5cdb2c77c4c3 #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/22 19:37 upstream 5cdb2c77c4c3 0919b50b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in _copy_to_iter / memcpy_and_pad
2025/05/21 12:33 upstream 4a95bc121ccd dc5d3808 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in _copy_to_iter / memcpy_and_pad
* Struck through repros no longer work on HEAD.