syzbot


KCSAN: data-race in __writeback_single_inode / xas_set_mark (6)

Status: moderation: reported on 2024/05/07 08:53
Subsystems: fs mm
[Documentation on labels]
Reported-by: syzbot+40d7ce09fc0205cdd588@syzkaller.appspotmail.com
First crash: 42d, last: 28d
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in __writeback_single_inode / xas_set_mark (5) fs mm 2 86d 118d 0/27 auto-obsoleted due to no activity on 2024/04/28 10:15
upstream KCSAN: data-race in __writeback_single_inode / xas_set_mark ext4 39 1462d 1698d 0/27 closed as invalid on 2020/06/18 14:24
upstream KCSAN: data-race in __writeback_single_inode / xas_set_mark (3) fs mm 115 330d 858d 0/27 auto-obsoleted due to no activity on 2023/08/28 03:40
upstream KCSAN: data-race in __writeback_single_inode / xas_set_mark (2) fs mm 238 909d 1356d 0/27 auto-closed as invalid on 2022/01/26 09:38
upstream KCSAN: data-race in __writeback_single_inode / xas_set_mark (4) fs mm 10 159d 191d 0/27 auto-obsoleted due to no activity on 2024/02/15 01:09

Sample crash report:
==================================================================
BUG: KCSAN: data-race in __writeback_single_inode / xas_set_mark

write to 0xffff8881072d2c8c of 4 bytes by task 3545 on cpu 1:
 xa_mark_set lib/xarray.c:71 [inline]
 xas_set_mark+0x131/0x150 lib/xarray.c:893
 tag_pages_for_writeback+0xaa/0x2b0 mm/page-writeback.c:2371
 writeback_iter+0x351/0x830 mm/page-writeback.c:2514
 write_cache_pages+0x4b/0x100 mm/page-writeback.c:2590
 mpage_writepages+0x72/0xf0 fs/mpage.c:673
 fat_writepages+0x24/0x30 fs/fat/inode.c:200
 do_writepages+0x1d8/0x480 mm/page-writeback.c:2634
 filemap_fdatawrite_wbc+0xdb/0x100 mm/filemap.c:397
 __filemap_fdatawrite_range mm/filemap.c:430 [inline]
 file_write_and_wait_range+0xc8/0x170 mm/filemap.c:788
 __generic_file_fsync+0x4c/0x140 fs/libfs.c:1516
 fat_file_fsync+0x4c/0x100 fs/fat/file.c:191
 vfs_fsync_range+0x122/0x140 fs/sync.c:188
 generic_write_sync include/linux/fs.h:2811 [inline]
 generic_file_write_iter+0x191/0x1d0 mm/filemap.c:4140
 call_write_iter include/linux/fs.h:2120 [inline]
 iter_file_splice_write+0x5e6/0x970 fs/splice.c:743
 do_splice_from fs/splice.c:941 [inline]
 direct_splice_actor+0x16c/0x2c0 fs/splice.c:1164
 splice_direct_to_actor+0x305/0x670 fs/splice.c:1108
 do_splice_direct_actor fs/splice.c:1207 [inline]
 do_splice_direct+0xd7/0x150 fs/splice.c:1233
 do_sendfile+0x3b9/0x970 fs/read_write.c:1295
 __do_sys_sendfile64 fs/read_write.c:1362 [inline]
 __se_sys_sendfile64 fs/read_write.c:1348 [inline]
 __x64_sys_sendfile64+0x110/0x150 fs/read_write.c:1348
 x64_sys_call+0x2c67/0x2d30 arch/x86/include/generated/asm/syscalls_64.h:41
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x1d0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff8881072d2c8c of 4 bytes by task 3552 on cpu 0:
 xa_marked include/linux/xarray.h:424 [inline]
 mapping_tagged include/linux/fs.h:496 [inline]
 __writeback_single_inode+0x21d/0x870 fs/fs-writeback.c:1702
 writeback_single_inode+0x12f/0x4a0 fs/fs-writeback.c:1772
 sync_inode_metadata+0x5c/0x90 fs/fs-writeback.c:2842
 __generic_file_fsync+0xf9/0x140 fs/libfs.c:1527
 fat_file_fsync+0x4c/0x100 fs/fat/file.c:191
 vfs_fsync_range+0x122/0x140 fs/sync.c:188
 generic_write_sync include/linux/fs.h:2811 [inline]
 generic_file_write_iter+0x191/0x1d0 mm/filemap.c:4140
 call_write_iter include/linux/fs.h:2120 [inline]
 iter_file_splice_write+0x5e6/0x970 fs/splice.c:743
 do_splice_from fs/splice.c:941 [inline]
 direct_splice_actor+0x16c/0x2c0 fs/splice.c:1164
 splice_direct_to_actor+0x305/0x670 fs/splice.c:1108
 do_splice_direct_actor fs/splice.c:1207 [inline]
 do_splice_direct+0xd7/0x150 fs/splice.c:1233
 do_sendfile+0x3b9/0x970 fs/read_write.c:1295
 __do_sys_sendfile64 fs/read_write.c:1362 [inline]
 __se_sys_sendfile64 fs/read_write.c:1348 [inline]
 __x64_sys_sendfile64+0x110/0x150 fs/read_write.c:1348
 x64_sys_call+0x2c67/0x2d30 arch/x86/include/generated/asm/syscalls_64.h:41
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x1d0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x02000021 -> 0x04000021

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 3552 Comm: syz-executor.0 Not tainted 6.9.0-syzkaller-09880-gdaa121128a2d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/21 02:49 upstream daa121128a2d c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __writeback_single_inode / xas_set_mark
2024/05/19 03:04 upstream 0450d2083be6 c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __writeback_single_inode / xas_set_mark
2024/05/19 00:58 upstream 4b377b4868ef c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __writeback_single_inode / xas_set_mark
2024/05/07 08:52 upstream dccb07f2914c fa7a5cf0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __writeback_single_inode / xas_set_mark
* Struck through repros no longer work on HEAD.