syzbot


KCSAN: data-race in __add_to_page_cache_locked / iomap_dio_complete (5)

Status: auto-closed as invalid on 2021/09/03 02:27
Subsystems: fs mm
[Documentation on labels]
First crash: 996d, last: 996d
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in __add_to_page_cache_locked / iomap_dio_complete (4) fs mm 7 1073d 1128d 0/26 auto-closed as invalid on 2021/06/16 07:05
upstream KCSAN: data-race in __add_to_page_cache_locked / iomap_dio_complete (3) ext4 6 1184d 1228d 0/26 auto-closed as invalid on 2021/02/24 09:14
upstream KCSAN: data-race in __add_to_page_cache_locked / iomap_dio_complete (2) fs mm 2 1273d 1307d 0/26 auto-closed as invalid on 2020/11/27 11:56
upstream KCSAN: data-race in __add_to_page_cache_locked / iomap_dio_complete (6) fs mm 1 916d 916d 0/26 auto-closed as invalid on 2021/11/19 12:34
upstream KCSAN: data-race in __add_to_page_cache_locked / iomap_dio_complete ext4 3 1443d 1491d 0/26 auto-closed as invalid on 2020/06/18 14:14

Sample crash report:
File: /root/syzkaller-testdir929527076/syzkaller.ZfU0jr/1320/bus PID: 7474 Comm: syz-executor.2
Page cache invalidation failure on direct I/O.  Possible data corruption due to collision with buffered I/O!
File: /root/syzkaller-testdir929527076/syzkaller.ZfU0jr/1320/bus PID: 7474 Comm: syz-executor.2
==================================================================
BUG: KCSAN: data-race in __add_to_page_cache_locked / iomap_dio_complete

write to 0xffff8881319a4500 of 8 bytes by task 7479 on cpu 0:
 __add_to_page_cache_locked+0x256/0x4b0 mm/filemap.c:914
 add_to_page_cache_lru+0xa0/0x1b0 mm/filemap.c:967
 page_cache_ra_unbounded+0x262/0x410 mm/readahead.c:221
 ondemand_readahead+0x579/0x7b0 mm/readahead.c:267
 page_cache_async_ra+0x165/0x190 mm/readahead.c:607
 page_cache_async_readahead include/linux/pagemap.h:907 [inline]
 filemap_readahead mm/filemap.c:2442 [inline]
 filemap_get_pages mm/filemap.c:2483 [inline]
 filemap_read+0x49d/0x1220 mm/filemap.c:2550
 generic_file_read_iter+0x75/0x2c0 mm/filemap.c:2701
 ext4_file_read_iter+0x1db/0x290 fs/ext4/file.c:73
 call_read_iter include/linux/fs.h:2108 [inline]
 new_sync_read fs/read_write.c:415 [inline]
 vfs_read+0x565/0x5d0 fs/read_write.c:496
 ksys_read+0xce/0x180 fs/read_write.c:634
 __do_sys_read fs/read_write.c:644 [inline]
 __se_sys_read fs/read_write.c:642 [inline]
 __x64_sys_read+0x3e/0x50 fs/read_write.c:642
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0x90 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

read to 0xffff8881319a4500 of 8 bytes by task 7474 on cpu 1:
 iomap_dio_complete+0x31a/0x3c0 fs/iomap/direct-io.c:112
 iomap_dio_rw+0x4e/0x70 fs/iomap/direct-io.c:652
 ext4_dio_write_iter fs/ext4/file.c:568 [inline]
 ext4_file_write_iter+0xa04/0x11d0 fs/ext4/file.c:678
 call_write_iter include/linux/fs.h:2114 [inline]
 do_iter_readv_writev+0x2cb/0x360 fs/read_write.c:740
 do_iter_write+0x112/0x4c0 fs/read_write.c:866
 vfs_iter_write+0x4c/0x70 fs/read_write.c:907
 iter_file_splice_write+0x40a/0x750 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+0xf5/0x170 fs/splice.c:979
 do_sendfile+0x773/0xda0 fs/read_write.c:1260
 __do_sys_sendfile64 fs/read_write.c:1325 [inline]
 __se_sys_sendfile64 fs/read_write.c:1311 [inline]
 __x64_sys_sendfile64+0xf2/0x130 fs/read_write.c:1311
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0x90 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

value changed: 0x00000000000009b6 -> 0x00000000000009c3

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 7474 Comm: syz-executor.2 Tainted: G        W         5.14.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/07/27 09:11 upstream ff1176468d36 fd511809 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in __add_to_page_cache_locked / iomap_dio_complete
* Struck through repros no longer work on HEAD.