syzbot


KCSAN: data-race in filemap_write_and_wait_range / xas_clear_mark

Status: auto-closed as invalid on 2022/01/11 12:43
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 354d, last: 354d

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

write to 0xffff888131c84d2c of 4 bytes by task 17360 on cpu 1:
 xa_mark_clear lib/xarray.c:75 [inline]
 xas_clear_mark+0x15a/0x170 lib/xarray.c:921
 __folio_start_writeback+0x30e/0x490 mm/page-writeback.c:2886
 set_page_writeback+0x39/0x50 mm/folio-compat.c:77
 ext4_bio_write_page+0x132/0xaa0 fs/ext4/page-io.c:455
 mpage_submit_page fs/ext4/inode.c:2095 [inline]
 mpage_process_page_bufs+0x437/0x560 fs/ext4/inode.c:2209
 mpage_prepare_extent_to_map+0x4f6/0x650 fs/ext4/inode.c:2621
 ext4_writepages+0x766/0x1e80 fs/ext4/inode.c:2749
 do_writepages+0x1cb/0x330 mm/page-writeback.c:2364
 filemap_fdatawrite_wbc mm/filemap.c:407 [inline]
 __filemap_fdatawrite_range mm/filemap.c:440 [inline]
 file_write_and_wait_range+0x132/0x1d0 mm/filemap.c:824
 ext4_sync_file+0x105/0x6e0 fs/ext4/fsync.c:151
 vfs_fsync_range+0x107/0x120 fs/sync.c:182
 generic_write_sync include/linux/fs.h:2955 [inline]
 ext4_buffered_write_iter+0x322/0x380 fs/ext4/file.c:277
 ext4_file_write_iter+0x2e7/0x1200
 call_write_iter include/linux/fs.h:2162 [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 0xffff888131c84d2c of 4 bytes by task 17357 on cpu 0:
 xa_marked include/linux/xarray.h:418 [inline]
 mapping_tagged include/linux/fs.h:493 [inline]
 filemap_fdatawrite_wbc mm/filemap.c:403 [inline]
 __filemap_fdatawrite_range mm/filemap.c:440 [inline]
 filemap_write_and_wait_range+0x102/0x340 mm/filemap.c:718
 __iomap_dio_rw+0x4bb/0x1070 fs/iomap/direct-io.c:560
 iomap_dio_rw+0x38/0x80 fs/iomap/direct-io.c:679
 ext4_dio_write_iter fs/ext4/file.c:568 [inline]
 ext4_file_write_iter+0xa72/0x1200 fs/ext4/file.c:679
 call_write_iter include/linux/fs.h:2162 [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: 0x0e000021 -> 0x04000021

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 17357 Comm: syz-executor.3 Not tainted 5.16.0-rc4-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-kcsan-gce 2021/12/07 12:35 upstream cd8c917a56f2 0230ba3e .config log report info KCSAN: data-race in filemap_write_and_wait_range / xas_clear_mark
* Struck through repros no longer work on HEAD.