syzbot


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

Status: moderation: reported on 2024/02/21 10:43
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+5cba2f11c9c99940ec99@syzkaller.appspotmail.com
First crash: 52d, last: 16d
Similar bugs (4)
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 mm 90 358d 886d 0/26 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 138d 126d 0/26 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 97d 95d 0/26 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 225d 236d 0/26 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 0xffff8881057cf098 of 8 bytes by task 16184 on cpu 1:
 __filemap_add_folio+0x492/0x700 mm/filemap.c:912
 filemap_add_folio+0x70/0x160 mm/filemap.c:947
 page_cache_ra_unbounded+0x15f/0x2e0 mm/readahead.c:250
 do_page_cache_ra+0xa7/0xc0 mm/readahead.c:299
 ondemand_readahead+0x6ae/0x6c0 mm/readahead.c:634
 page_cache_sync_ra+0xe0/0xf0 mm/readahead.c:688
 page_cache_sync_readahead include/linux/pagemap.h:1300 [inline]
 filemap_get_pages+0x252/0xfb0 mm/filemap.c:2505
 filemap_splice_read+0x360/0x920 mm/filemap.c:2870
 ext4_file_splice_read+0x95/0xc0 fs/ext4/file.c:158
 do_splice_read fs/splice.c:985 [inline]
 splice_direct_to_actor+0x26c/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+0x3b9/0x970 fs/read_write.c:1295
 __do_sys_sendfile64 fs/read_write.c:1362 [inline]
 __se_sys_sendfile64 fs/read_write.c:1348 [inline]
 __x64_sys_sendfile64+0x110/0x150 fs/read_write.c:1348
 do_syscall_64+0xd3/0x1d0
 entry_SYSCALL_64_after_hwframe+0x6d/0x75

read to 0xffff8881057cf098 of 8 bytes by task 16178 on cpu 0:
 mapping_needs_writeback mm/filemap.c:635 [inline]
 file_write_and_wait_range+0x6d/0x170 mm/filemap.c:787
 ext4_sync_file+0x134/0x6c0 fs/ext4/fsync.c:158
 vfs_fsync_range+0x122/0x140 fs/sync.c:188
 generic_write_sync include/linux/fs.h:2793 [inline]
 iomap_dio_complete+0x370/0x4c0 fs/iomap/direct-io.c:126
 iomap_dio_rw+0x62/0x90 fs/iomap/direct-io.c:753
 ext4_dio_write_iter fs/ext4/file.c:577 [inline]
 ext4_file_write_iter+0xaa4/0xe30 fs/ext4/file.c:696
 call_write_iter include/linux/fs.h:2108 [inline]
 iter_file_splice_write+0x5e6/0x970 fs/splice.c:743
 do_splice_from fs/splice.c:941 [inline]
 direct_splice_actor+0x16c/0x2c0 fs/splice.c:1164
 splice_direct_to_actor+0x305/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+0x3b9/0x970 fs/read_write.c:1295
 __do_sys_sendfile64 fs/read_write.c:1362 [inline]
 __se_sys_sendfile64 fs/read_write.c:1348 [inline]
 __x64_sys_sendfile64+0x110/0x150 fs/read_write.c:1348
 do_syscall_64+0xd3/0x1d0
 entry_SYSCALL_64_after_hwframe+0x6d/0x75

value changed: 0x0000000000000219 -> 0x000000000000021c

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 16178 Comm: syz-executor.2 Tainted: G        W          6.9.0-rc1-syzkaller-00061-g8d025e2092e2 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/03/28 08:19 upstream 8d025e2092e2 120789fd .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
2024/03/11 13:37 upstream e8f897f4afef 6ee49f2e .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
2024/03/08 16:35 upstream 3aaa8ce7a335 8e75c913 .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
2024/02/23 08:53 upstream ffd2cb6b718e 8d446f15 .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
2024/02/21 10:42 upstream 9fc1ccccfd8d 3af7dd65 .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.