syzbot


KCSAN: data-race in copy_page_from_iter_atomic / fat12_ent_put

Status: moderation: reported on 2025/05/25 09:15
Subsystems: exfat
[Documentation on labels]
Reported-by: syzbot+e739dcbd15165df09c0d@syzkaller.appspotmail.com
First crash: 16h32m, last: 16h32m

Sample crash report:
==================================================================
BUG: KCSAN: data-race in copy_page_from_iter_atomic / fat12_ent_put

write to 0xffff888125f4b803 of 1 bytes by task 7667 on cpu 1:
 fat12_ent_put+0x74/0x170 fs/fat/fatent.c:168
 fat_alloc_clusters+0x4ce/0xa80 fs/fat/fatent.c:503
 fat_add_cluster fs/fat/inode.c:107 [inline]
 __fat_get_block fs/fat/inode.c:154 [inline]
 fat_get_block+0x258/0x5e0 fs/fat/inode.c:189
 __block_write_begin_int+0x41c/0xf70 fs/buffer.c:2151
 block_write_begin fs/buffer.c:2262 [inline]
 cont_write_begin+0x5a3/0x8e0 fs/buffer.c:2601
 fat_write_begin+0x4f/0xe0 fs/fat/inode.c:228
 generic_perform_write+0x181/0x490 mm/filemap.c:4103
 __generic_file_write_iter+0xec/0x120 mm/filemap.c:4217
 generic_file_write_iter+0x8d/0x2f0 mm/filemap.c:4246
 new_sync_write fs/read_write.c:591 [inline]
 vfs_write+0x4a0/0x8d0 fs/read_write.c:684
 ksys_pwrite64 fs/read_write.c:791 [inline]
 __do_sys_pwrite64 fs/read_write.c:799 [inline]
 __se_sys_pwrite64 fs/read_write.c:796 [inline]
 __x64_sys_pwrite64+0xfd/0x150 fs/read_write.c:796
 x64_sys_call+0xe45/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:19
 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

read to 0xffff888125f4b800 of 2048 bytes by task 2068 on cpu 0:
 memcpy_from_iter lib/iov_iter.c:73 [inline]
 iterate_bvec include/linux/iov_iter.h:123 [inline]
 iterate_and_advance2 include/linux/iov_iter.h:304 [inline]
 iterate_and_advance include/linux/iov_iter.h:328 [inline]
 __copy_from_iter lib/iov_iter.c:249 [inline]
 copy_page_from_iter_atomic+0x77f/0xff0 lib/iov_iter.c:483
 copy_folio_from_iter_atomic include/linux/uio.h:210 [inline]
 generic_perform_write+0x2c2/0x490 mm/filemap.c:4121
 shmem_file_write_iter+0xc5/0xf0 mm/shmem.c:3464
 lo_rw_aio+0x5fa/0x7c0 drivers/block/loop.c:-1
 do_req_filebacked drivers/block/loop.c:-1 [inline]
 loop_handle_cmd drivers/block/loop.c:1886 [inline]
 loop_process_work+0x52d/0xa60 drivers/block/loop.c:1921
 loop_workfn+0x31/0x40 drivers/block/loop.c:1945
 process_one_work kernel/workqueue.c:3238 [inline]
 process_scheduled_works+0x4cb/0x9d0 kernel/workqueue.c:3319
 worker_thread+0x582/0x770 kernel/workqueue.c:3400
 kthread+0x486/0x510 kernel/kthread.c:464
 ret_from_fork+0x4b/0x60 arch/x86/kernel/process.c:153
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 2068 Comm: kworker/u8:6 Not tainted 6.15.0-rc7-syzkaller-00152-gd0c22de9995b #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Workqueue: loop4 loop_workfn
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/25 09:14 upstream d0c22de9995b ed351ea7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in copy_page_from_iter_atomic / fat12_ent_put
* Struck through repros no longer work on HEAD.