syzbot


KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range

Status: auto-closed as invalid on 2022/04/09 14:24
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 321d, last: 272d

Sample crash report:
==================================================================
BUG: KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range

write to 0xffff888131086830 of 8 bytes by task 19598 on cpu 1:
 page_cache_delete mm/filemap.c:145 [inline]
 __filemap_remove_folio+0x1e1/0x2c0 mm/filemap.c:219
 invalidate_complete_folio2 mm/truncate.c:609 [inline]
 invalidate_inode_pages2_range+0x456/0x680 mm/truncate.c:697
 __iomap_dio_rw+0x5ee/0x10a0 fs/iomap/direct-io.c:571
 iomap_dio_rw+0x38/0x80 fs/iomap/direct-io.c:680
 ext4_dio_write_iter fs/ext4/file.c:564 [inline]
 ext4_file_write_iter+0x7d5/0xda0 fs/ext4/file.c:675
 call_write_iter include/linux/fs.h:2074 [inline]
 do_iter_readv_writev+0x2de/0x380 fs/read_write.c:725
 do_iter_write+0x192/0x5c0 fs/read_write.c:851
 vfs_iter_write+0x4c/0x70 fs/read_write.c:892
 iter_file_splice_write+0x43a/0x790 fs/splice.c:689
 do_splice_from fs/splice.c:767 [inline]
 direct_splice_actor+0x80/0xa0 fs/splice.c:936
 splice_direct_to_actor+0x345/0x650 fs/splice.c:891
 do_splice_direct+0x106/0x190 fs/splice.c:979
 do_sendfile+0x675/0xc40 fs/read_write.c:1245
 __do_sys_sendfile64 fs/read_write.c:1310 [inline]
 __se_sys_sendfile64 fs/read_write.c:1296 [inline]
 __x64_sys_sendfile64+0x102/0x140 fs/read_write.c:1296
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

read to 0xffff888131086830 of 8 bytes by task 19589 on cpu 0:
 mapping_needs_writeback mm/filemap.c:623 [inline]
 filemap_write_and_wait_range+0x36/0x340 mm/filemap.c:668
 __iomap_dio_rw+0x4f6/0x10a0 fs/iomap/direct-io.c:561
 iomap_dio_rw+0x38/0x80 fs/iomap/direct-io.c:680
 ext4_dio_write_iter fs/ext4/file.c:564 [inline]
 ext4_file_write_iter+0x7d5/0xda0 fs/ext4/file.c:675
 call_write_iter include/linux/fs.h:2074 [inline]
 do_iter_readv_writev+0x2de/0x380 fs/read_write.c:725
 do_iter_write+0x192/0x5c0 fs/read_write.c:851
 vfs_iter_write+0x4c/0x70 fs/read_write.c:892
 iter_file_splice_write+0x43a/0x790 fs/splice.c:689
 do_splice_from fs/splice.c:767 [inline]
 direct_splice_actor+0x80/0xa0 fs/splice.c:936
 splice_direct_to_actor+0x345/0x650 fs/splice.c:891
 do_splice_direct+0x106/0x190 fs/splice.c:979
 do_sendfile+0x675/0xc40 fs/read_write.c:1245
 __do_sys_sendfile64 fs/read_write.c:1310 [inline]
 __se_sys_sendfile64 fs/read_write.c:1296 [inline]
 __x64_sys_sendfile64+0x102/0x140 fs/read_write.c:1296
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

value changed: 0x00000000000000aa -> 0x00000000000000a7

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 19589 Comm: syz-executor.3 Not tainted 5.17.0-rc6-syzkaller-00228-gac84e82f78cb-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================

Crashes (5):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-kcsan-gce 2022/03/05 14:18 upstream ac84e82f78cb 45a13a73 .config log report info KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
ci2-upstream-kcsan-gce 2022/03/03 13:08 upstream 5859a2b19911 45a13a73 .config log report info KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
ci2-upstream-kcsan-gce 2022/02/03 09:45 upstream 88808fbbead4 4ebb2798 .config log report info KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
ci2-upstream-kcsan-gce 2022/01/24 22:51 upstream dd81e1c7d5fb 2cbffd88 .config log report info KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
ci2-upstream-kcsan-gce 2022/01/15 21:04 upstream a33f5c380c4b 723cfaf0 .config log report info KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
* Struck through repros no longer work on HEAD.