syzbot


KCSAN: data-race in __filemap_add_folio / generic_file_direct_write

Status: auto-closed as invalid on 2021/12/15 10:13
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 384d, last: 384d
similar bugs (3):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in __filemap_add_folio / generic_file_direct_write (3) 3 205d 210d 0/24 auto-closed as invalid on 2022/06/12 06:31
upstream KCSAN: data-race in __filemap_add_folio / generic_file_direct_write (2) 1 264d 264d 0/24 auto-closed as invalid on 2022/04/14 05:12
upstream KCSAN: data-race in __filemap_add_folio / generic_file_direct_write (4) 1 126d 126d 0/24 auto-closed as invalid on 2022/08/29 21:55

Sample crash report:
loop4: detected capacity change from 0 to 264192
==================================================================
BUG: KCSAN: data-race in __filemap_add_folio / generic_file_direct_write

write to 0xffff888101366638 of 8 bytes by task 2656 on cpu 0:
 __filemap_add_folio+0x256/0x4d0 mm/filemap.c:946
 filemap_add_folio+0x6b/0x150 mm/filemap.c:999
 add_to_page_cache_lru+0x4e/0x70 mm/folio-compat.c:115
 page_cache_ra_unbounded+0x274/0x430 mm/readahead.c:221
 do_page_cache_ra mm/readahead.c:268 [inline]
 force_page_cache_ra+0x1e6/0x220 mm/readahead.c:300
 page_cache_sync_ra+0xcc/0xe0 mm/readahead.c:574
 page_cache_sync_readahead include/linux/pagemap.h:980 [inline]
 filemap_get_pages mm/filemap.c:2556 [inline]
 filemap_read+0x3eb/0x16d0 mm/filemap.c:2642
 generic_file_read_iter+0x72/0x2a0 mm/filemap.c:2792
 blkdev_read_iter+0x96/0x140 block/fops.c:583
 call_read_iter include/linux/fs.h:2156 [inline]
 new_sync_read fs/read_write.c:400 [inline]
 vfs_read+0x66c/0x750 fs/read_write.c:481
 ksys_read+0xd9/0x190 fs/read_write.c:619
 __do_sys_read fs/read_write.c:629 [inline]
 __se_sys_read fs/read_write.c:627 [inline]
 __x64_sys_read+0x3e/0x50 fs/read_write.c:627
 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 0xffff888101366638 of 8 bytes by task 7455 on cpu 1:
 generic_file_direct_write+0x29a/0x410 mm/filemap.c:3699
 __generic_file_write_iter+0x13d/0x2b0 mm/filemap.c:3840
 blkdev_write_iter+0x257/0x340 block/fops.c:557
 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: 0x000000000000000b -> 0x000000000000000c

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 7455 Comm: syz-executor.4 Not tainted 5.15.0-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/11/10 10:12 upstream cb690f5238d7 55fa030c .config log report info KCSAN: data-race in __filemap_add_folio / generic_file_direct_write
* Struck through repros no longer work on HEAD.