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: 144d, last: 28d
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 1608d 1621d 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 319d 526d 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 1385d 1419d 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 1463d 1562d 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 1270d 1346d 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 240d 282d 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 1685d 1724d 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 1827d 1986d 0/28 closed as invalid on 2020/06/18 14:24

Sample crash report:
EXT4-fs (loop5): mounted filesystem 76b65be2-f6da-4727-8c75-0525a5b65a09 r/w without journal. Quota mode: writeback.
ext4 filesystem being mounted at /49/file1 supports timestamps until 2038-01-19 (0x7fffffff)
==================================================================
BUG: KCSAN: data-race in __wb_update_bandwidth / percpu_counter_add_batch

read-write to 0xffff888102159948 of 8 bytes by task 56 on cpu 1:
 percpu_counter_add_batch+0x120/0x140 lib/percpu_counter.c:107
 wb_stat_mod include/linux/backing-dev.h:66 [inline]
 __wb_writeout_add+0x45/0x1d0 mm/page-writeback.c:584
 __folio_end_writeback+0x217/0x4a0 mm/page-writeback.c:3053
 folio_end_writeback+0xcd/0x3d0 mm/filemap.c:1648
 ext4_finish_bio+0x476/0x8f0 fs/ext4/page-io.c:144
 ext4_release_io_end+0x8c/0x1f0 fs/ext4/page-io.c:159
 ext4_end_io_end+0x19c/0x260 fs/ext4/page-io.c:210
 ext4_do_flush_completed_IO fs/ext4/page-io.c:287 [inline]
 ext4_end_io_rsv_work+0x155/0x1e0 fs/ext4/page-io.c:302
 process_one_work kernel/workqueue.c:3238 [inline]
 process_scheduled_works+0x4de/0xa20 kernel/workqueue.c:3319
 worker_thread+0x52c/0x710 kernel/workqueue.c:3400
 kthread+0x4b7/0x540 kernel/kthread.c:464
 ret_from_fork+0x4b/0x60 arch/x86/kernel/process.c:153
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

read to 0xffff888102159948 of 8 bytes by task 4708 on cpu 0:
 percpu_counter_read include/linux/percpu_counter.h:110 [inline]
 __wb_update_bandwidth+0x96/0x5d0 mm/page-writeback.c:1510
 wb_update_bandwidth mm/page-writeback.c:1537 [inline]
 do_writepages+0x44a/0x480 mm/page-writeback.c:2682
 filemap_fdatawrite_wbc mm/filemap.c:386 [inline]
 __filemap_fdatawrite_range mm/filemap.c:419 [inline]
 file_write_and_wait_range+0x16e/0x2f0 mm/filemap.c:794
 generic_buffers_fsync_noflush+0x46/0x120 fs/buffer.c:600
 ext4_fsync_nojournal fs/ext4/fsync.c:88 [inline]
 ext4_sync_file+0x1c3/0x6c0 fs/ext4/fsync.c:147
 vfs_fsync_range+0x116/0x130 fs/sync.c:187
 generic_write_sync include/linux/fs.h:2976 [inline]
 ext4_buffered_write_iter+0x358/0x3c0 fs/ext4/file.c:305
 ext4_file_write_iter+0x3b2/0xf80 include/linux/fs.h:-1
 aio_write+0x324/0x460 fs/aio.c:1633
 __io_submit_one fs/aio.c:-1 [inline]
 io_submit_one+0xb0c/0x1230 fs/aio.c:2052
 __do_sys_io_submit fs/aio.c:2111 [inline]
 __se_sys_io_submit+0xf7/0x280 fs/aio.c:2081
 __x64_sys_io_submit+0x43/0x50 fs/aio.c:2081
 x64_sys_call+0xa8b/0x2e10 arch/x86/include/generated/asm/syscalls_64.h:210
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xc9/0x1a0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x0000000000000010 -> 0x0000000000000020

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 4708 Comm: syz.5.316 Not tainted 6.15.0-rc2-syzkaller-00257-gb5c6891b2c5b #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/04/18 09:21 upstream b5c6891b2c5b 2a20f901 .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
2025/02/21 23:29 upstream 8a61cb6e150e d34966d1 .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
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.