syzbot


KCSAN: data-race in __mpage_writepage / truncate_setsize (7)

Status: auto-closed as invalid on 2022/05/21 16:37
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 256d, last: 224d
similar bugs (7):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in __mpage_writepage / truncate_setsize (6) 1 490d 490d 0/24 auto-closed as invalid on 2021/08/28 08:01
upstream KCSAN: data-race in __mpage_writepage / truncate_setsize (3) 3 800d 826d 0/24 auto-closed as invalid on 2020/10/22 12:12
upstream KCSAN: data-race in __mpage_writepage / truncate_setsize (5) 1 536d 536d 0/24 auto-closed as invalid on 2021/07/13 09:33
upstream KCSAN: data-race in __mpage_writepage / truncate_setsize (4) 1 714d 714d 0/24 auto-closed as invalid on 2021/01/16 18:17
upstream KCSAN: data-race in __mpage_writepage / truncate_setsize (2) 2 938d 951d 0/24 auto-closed as invalid on 2020/06/18 14:03
upstream KCSAN: data-race in __mpage_writepage / truncate_setsize (8) 1 136d 136d 0/24 auto-closed as invalid on 2022/08/17 17:26
upstream KCSAN: data-race in __mpage_writepage / truncate_setsize 1 1036d 1036d 0/24 auto-closed as invalid on 2020/04/04 11:54

Sample crash report:
==================================================================
BUG: KCSAN: data-race in __mpage_writepage / truncate_setsize

write to 0xffff888137e2ca28 of 8 bytes by task 7409 on cpu 1:
 i_size_write include/linux/fs.h:878 [inline]
 truncate_setsize+0x2a/0xc0 mm/truncate.c:775
 fat_setattr+0x765/0x880 fs/fat/file.c:539
 notify_change+0x9c3/0xa30 fs/attr.c:410
 do_truncate fs/open.c:65 [inline]
 do_sys_ftruncate+0x317/0x420 fs/open.c:193
 __do_sys_ftruncate fs/open.c:204 [inline]
 __se_sys_ftruncate fs/open.c:202 [inline]
 __x64_sys_ftruncate+0x2f/0x40 fs/open.c:202
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

read to 0xffff888137e2ca28 of 8 bytes by task 7408 on cpu 0:
 i_size_read include/linux/fs.h:856 [inline]
 __mpage_writepage+0xb8/0x1030 fs/mpage.c:466
 write_cache_pages+0x443/0xa30 mm/page-writeback.c:2243
 mpage_writepages+0x7b/0x100 fs/mpage.c:676
 fat_writepages+0x20/0x30 fs/fat/inode.c:205
 do_writepages+0x1db/0x350 mm/page-writeback.c:2352
 filemap_fdatawrite_wbc+0xd6/0xf0 mm/filemap.c:388
 __filemap_fdatawrite_range mm/filemap.c:421 [inline]
 file_write_and_wait_range+0xd6/0x170 mm/filemap.c:779
 __generic_file_fsync+0x48/0x140 fs/libfs.c:1115
 fat_file_fsync+0x48/0x100 fs/fat/file.c:191
 vfs_fsync_range+0x107/0x120 fs/sync.c:188
 generic_write_sync include/linux/fs.h:2732 [inline]
 generic_file_write_iter+0x103/0x130 mm/filemap.c:3951
 do_iter_readv_writev+0x27b/0x300
 do_iter_write+0x16f/0x5c0 fs/read_write.c:852
 vfs_iter_write+0x4c/0x70 fs/read_write.c:893
 iter_file_splice_write+0x44a/0x7c0 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/0x660 fs/splice.c:891
 do_splice_direct+0xfb/0x180 fs/splice.c:979
 do_sendfile+0x3ad/0x900 fs/read_write.c:1246
 __do_sys_sendfile64 fs/read_write.c:1311 [inline]
 __se_sys_sendfile64 fs/read_write.c:1297 [inline]
 __x64_sys_sendfile64+0x10c/0x150 fs/read_write.c:1297
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

value changed: 0x000000000002c600 -> 0x0000000000000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 7408 Comm: syz-executor.0 Not tainted 5.18.0-rc2-syzkaller-00275-g59250f8a7f3a-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================
syz-executor.0 (7408) used greatest stack depth: 10576 bytes left

Crashes (2):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-kcsan-gce 2022/04/16 16:35 upstream 59250f8a7f3a 8bcc32a6 .config log report info KCSAN: data-race in __mpage_writepage / truncate_setsize
ci2-upstream-kcsan-gce 2022/03/15 18:05 upstream 56e337f2cf13 9e8eaa75 .config log report info KCSAN: data-race in __mpage_writepage / truncate_setsize
* Struck through repros no longer work on HEAD.