syzbot


KCSAN: data-race in __wb_update_bandwidth / percpu_counter_add_batch (9)

Status: moderation: reported on 2024/12/23 09:25
Subsystems: fs mm
[Documentation on labels]
Reported-by: syzbot+6e5620a42d170a5219cf@syzkaller.appspotmail.com
First crash: 54d, last: 26d
Similar bugs (8)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in __wb_update_bandwidth / percpu_counter_add_batch (3) fs mm 2 1518d 1531d 0/28 auto-closed as invalid on 2021/01/24 22:24
upstream KCSAN: data-race in __wb_update_bandwidth / percpu_counter_add_batch (7) fs mm 295 229d 436d 0/28 auto-obsoleted due to no activity on 2024/08/05 19:12
upstream KCSAN: data-race in __wb_update_bandwidth / percpu_counter_add_batch (5) fs mm 3 1295d 1329d 0/28 auto-closed as invalid on 2021/09/04 14:56
upstream KCSAN: data-race in __wb_update_bandwidth / percpu_counter_add_batch (4) fs mm 6 1373d 1472d 0/28 auto-closed as invalid on 2021/06/18 08:34
upstream KCSAN: data-race in __wb_update_bandwidth / percpu_counter_add_batch (6) fs mm 17 1179d 1256d 0/28 auto-closed as invalid on 2021/12/29 06:33
upstream KCSAN: data-race in __wb_update_bandwidth / percpu_counter_add_batch (8) mm fs 4 150d 191d 0/28 auto-obsoleted due to no activity on 2024/10/23 14:01
upstream KCSAN: data-race in __wb_update_bandwidth / percpu_counter_add_batch (2) fs mm 3 1595d 1634d 0/28 auto-closed as invalid on 2020/11/08 10:33
upstream KCSAN: data-race in __wb_update_bandwidth / percpu_counter_add_batch mm fs 9 1737d 1896d 0/28 closed as invalid on 2020/06/18 14:24

Sample crash report:
loop3: detected capacity change from 0 to 8192
==================================================================
BUG: KCSAN: data-race in __wb_update_bandwidth / percpu_counter_add_batch

read-write to 0xffff888102121920 of 8 bytes by task 6830 on cpu 0:
 percpu_counter_add_batch+0x120/0x140 lib/percpu_counter.c:107
 wb_stat_mod include/linux/backing-dev.h:66 [inline]
 folio_account_dirtied mm/page-writeback.c:2772 [inline]
 __folio_mark_dirty+0x27f/0x4e0 mm/page-writeback.c:2818
 mark_buffer_dirty+0x134/0x230 fs/buffer.c:1196
 __block_commit_write fs/buffer.c:2189 [inline]
 block_write_end+0x123/0x210 fs/buffer.c:2265
 generic_write_end+0x5c/0x160 fs/buffer.c:2279
 fat_write_end+0x4e/0x160 fs/fat/inode.c:242
 generic_perform_write+0x33c/0x4a0 mm/filemap.c:4061
 __generic_file_write_iter+0xa1/0x120 mm/filemap.c:4147
 generic_file_write_iter+0x77/0x1c0 mm/filemap.c:4173
 iter_file_splice_write+0x5f1/0x980 fs/splice.c:743
 do_splice_from fs/splice.c:941 [inline]
 direct_splice_actor+0x160/0x2c0 fs/splice.c:1164
 splice_direct_to_actor+0x302/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+0x398/0x660 fs/read_write.c:1363
 __do_sys_sendfile64 fs/read_write.c:1424 [inline]
 __se_sys_sendfile64 fs/read_write.c:1410 [inline]
 __x64_sys_sendfile64+0x110/0x150 fs/read_write.c:1410
 x64_sys_call+0xfbd/0x2dc0 arch/x86/include/generated/asm/syscalls_64.h:41
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff888102121920 of 8 bytes by task 6800 on cpu 1:
 percpu_counter_read include/linux/percpu_counter.h:110 [inline]
 __wb_update_bandwidth+0x83/0x5d0 mm/page-writeback.c:1553
 wb_update_bandwidth mm/page-writeback.c:1581 [inline]
 do_writepages+0x443/0x480 mm/page-writeback.c:2734
 filemap_fdatawrite_wbc mm/filemap.c:388 [inline]
 __filemap_fdatawrite_range mm/filemap.c:421 [inline]
 file_write_and_wait_range+0x168/0x2f0 mm/filemap.c:778
 __generic_file_fsync+0x46/0x140 fs/libfs.c:1532
 fat_file_fsync+0x46/0x100 fs/fat/file.c:191
 vfs_fsync_range+0x116/0x130 fs/sync.c:187
 generic_write_sync include/linux/fs.h:2904 [inline]
 generic_file_write_iter+0x185/0x1c0 mm/filemap.c:4177
 iter_file_splice_write+0x5f1/0x980 fs/splice.c:743
 do_splice_from fs/splice.c:941 [inline]
 direct_splice_actor+0x160/0x2c0 fs/splice.c:1164
 splice_direct_to_actor+0x302/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+0x398/0x660 fs/read_write.c:1363
 __do_sys_sendfile64 fs/read_write.c:1424 [inline]
 __se_sys_sendfile64 fs/read_write.c:1410 [inline]
 __x64_sys_sendfile64+0x110/0x150 fs/read_write.c:1410
 x64_sys_call+0xfbd/0x2dc0 arch/x86/include/generated/asm/syscalls_64.h:41
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x0000000000002f50 -> 0x0000000000002f60

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 6800 Comm: syz.3.1147 Not tainted 6.13.0-rc7-syzkaller-00209-g9528d418de4d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/01/20 06:42 upstream 9528d418de4d f2cb035c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __wb_update_bandwidth / percpu_counter_add_batch
2024/12/31 02:28 upstream ccb98ccef0e5 d3ccff63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __wb_update_bandwidth / percpu_counter_add_batch
2024/12/23 09:25 upstream 4bbf9020becb b4fbdbd4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __wb_update_bandwidth / percpu_counter_add_batch
* Struck through repros no longer work on HEAD.