syzbot


KCSAN: data-race in __filemap_add_folio / file_write_and_wait_range (7)

Status: upstream: reported on 2025/02/19 16:20
Subsystems: exfat
[Documentation on labels]
Reported-by: syzbot+6c0e241874a0c6a56ec2@syzkaller.appspotmail.com
First crash: 2d15h, last: 2d15h
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [exfat?] KCSAN: data-race in __filemap_add_folio / file_write_and_wait_range (7) 0 (1) 2025/02/19 16:20
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in __filemap_add_folio / file_write_and_wait_range (5) mm 12 250d 366d 0/28 auto-obsoleted due to no activity on 2024/07/21 21:55
upstream KCSAN: data-race in __filemap_add_folio / file_write_and_wait_range mm 90 672d 1200d 0/28 auto-obsoleted due to no activity on 2023/05/27 02:10
upstream KCSAN: data-race in __filemap_add_folio / file_write_and_wait_range (6) fs mm 1 151d 151d 0/28 auto-obsoleted due to no activity on 2024/10/29 01:04
upstream KCSAN: data-race in __filemap_add_folio / file_write_and_wait_range (3) mm 4 452d 440d 0/28 auto-obsoleted due to no activity on 2024/01/02 05:06
upstream KCSAN: data-race in __filemap_add_folio / file_write_and_wait_range (4) fs mm 2 411d 409d 0/28 auto-obsoleted due to no activity on 2024/02/11 21:27
upstream KCSAN: data-race in __filemap_add_folio / file_write_and_wait_range (2) ext4 4 540d 550d 0/28 auto-obsoleted due to no activity on 2023/10/06 06:01

Sample crash report:
==================================================================
BUG: KCSAN: data-race in __filemap_add_folio / file_write_and_wait_range

read-write to 0xffff888115692c60 of 8 bytes by task 14397 on cpu 0:
 __filemap_add_folio+0x430/0x6f0 mm/filemap.c:929
 filemap_add_folio+0x9c/0x1b0 mm/filemap.c:981
 __filemap_get_folio+0x32f/0x630 mm/filemap.c:1980
 block_write_begin fs/buffer.c:2221 [inline]
 cont_write_begin+0x512/0x860 fs/buffer.c:2577
 fat_write_begin+0x51/0xe0 fs/fat/inode.c:228
 generic_perform_write+0x1a8/0x4a0 mm/filemap.c:4189
 __generic_file_write_iter+0xa1/0x120 mm/filemap.c:4290
 generic_file_write_iter+0x8f/0x310 mm/filemap.c:4316
 new_sync_write fs/read_write.c:586 [inline]
 vfs_write+0x77b/0x920 fs/read_write.c:679
 ksys_write+0xe8/0x1b0 fs/read_write.c:731
 __do_sys_write fs/read_write.c:742 [inline]
 __se_sys_write fs/read_write.c:739 [inline]
 __x64_sys_write+0x42/0x50 fs/read_write.c:739
 x64_sys_call+0x287e/0x2dc0 arch/x86/include/generated/asm/syscalls_64.h:2
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff888115692c60 of 8 bytes by task 14402 on cpu 1:
 mapping_needs_writeback mm/filemap.c:644 [inline]
 file_write_and_wait_range+0x68/0x2f0 mm/filemap.c:796
 __generic_file_fsync+0x46/0x140 fs/libfs.c:1525
 fat_file_fsync+0x46/0x100 fs/fat/file.c:191
 vfs_fsync_range fs/sync.c:187 [inline]
 vfs_fsync fs/sync.c:201 [inline]
 do_fsync fs/sync.c:212 [inline]
 __do_sys_fdatasync fs/sync.c:222 [inline]
 __se_sys_fdatasync fs/sync.c:220 [inline]
 __x64_sys_fdatasync+0x7e/0xd0 fs/sync.c:220
 x64_sys_call+0x15e1/0x2dc0 arch/x86/include/generated/asm/syscalls_64.h:76
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x0000000000000321 -> 0x0000000000000324

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 14402 Comm: syz.7.4702 Tainted: G        W          6.14.0-rc3-syzkaller-00060-g6537cfb395f3 #0
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/02/19 15:47 upstream 6537cfb395f3 b257a9b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_add_folio / file_write_and_wait_range
* Struck through repros no longer work on HEAD.