syzbot


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

Status: moderation: reported on 2024/09/24 01:04
Subsystems: fs mm
[Documentation on labels]
Reported-by: syzbot+b9333ca46f2dae6469ca@syzkaller.appspotmail.com
First crash: 15d, last: 15d
Similar bugs (5)
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 114d 230d 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 536d 1064d 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 (3) mm 4 316d 304d 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 275d 273d 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 404d 414d 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 0xffff8881068dfb60 of 8 bytes by task 6586 on cpu 1:
 __filemap_add_folio+0x430/0x6f0 mm/filemap.c:920
 filemap_add_folio+0x9c/0x1b0 mm/filemap.c:972
 page_cache_ra_unbounded+0x175/0x310 mm/readahead.c:268
 page_cache_sync_ra+0x652/0x670
 page_cache_sync_readahead include/linux/pagemap.h:1394 [inline]
 filemap_get_pages+0x2c1/0x10e0 mm/filemap.c:2543
 filemap_splice_read+0x358/0x910 mm/filemap.c:2917
 do_splice_read fs/splice.c:985 [inline]
 splice_direct_to_actor+0x269/0x670 fs/splice.c:1089
 do_splice_direct_actor fs/splice.c:1207 [inline]
 do_splice_direct+0xd7/0x150 fs/splice.c:1233
 do_sendfile+0x39b/0x970 fs/read_write.c:1388
 __do_sys_sendfile64 fs/read_write.c:1455 [inline]
 __se_sys_sendfile64 fs/read_write.c:1441 [inline]
 __x64_sys_sendfile64+0x110/0x150 fs/read_write.c:1441
 x64_sys_call+0xed5/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:41
 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 0xffff8881068dfb60 of 8 bytes by task 6595 on cpu 0:
 mapping_needs_writeback mm/filemap.c:635 [inline]
 file_write_and_wait_range+0x67/0x250 mm/filemap.c:787
 __generic_file_fsync+0x46/0x140 fs/libfs.c:1528
 fat_file_fsync+0x46/0x100 fs/fat/file.c:191
 vfs_fsync_range+0x116/0x130 fs/sync.c:188
 generic_write_sync include/linux/fs.h:2870 [inline]
 generic_file_write_iter+0x185/0x1c0 mm/filemap.c:4181
 iter_file_splice_write+0x5f1/0x980 fs/splice.c:743
 do_splice_from fs/splice.c:941 [inline]
 direct_splice_actor+0x160/0x2c0 fs/splice.c:1164
 splice_direct_to_actor+0x302/0x670 fs/splice.c:1108
 do_splice_direct_actor fs/splice.c:1207 [inline]
 do_splice_direct+0xd7/0x150 fs/splice.c:1233
 do_sendfile+0x39b/0x970 fs/read_write.c:1388
 __do_sys_sendfile64 fs/read_write.c:1455 [inline]
 __se_sys_sendfile64 fs/read_write.c:1441 [inline]
 __x64_sys_sendfile64+0x110/0x150 fs/read_write.c:1441
 x64_sys_call+0xed5/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:41
 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: 0x0000000000000000 -> 0x0000000000000001

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 6595 Comm: syz.2.872 Tainted: G        W          6.11.0-syzkaller-09015-g18ba6034468e #0
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/09/24 01:03 upstream 18ba6034468e 89298aad .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.