syzbot


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

Status: moderation: reported on 2025/06/22 15:22
Subsystems: mm fs
[Documentation on labels]
Reported-by: syzbot+ade9a83b6ae7a3c3c3fe@syzkaller.appspotmail.com
First crash: 91d, last: 20d
Similar bugs (9)
Kernel Title Rank 🛈 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 6 2 1736d 1749d 0/29 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 6 295 447d 654d 0/29 auto-obsoleted due to no activity on 2024/08/05 19:12
upstream KCSAN: data-race in __wb_update_bandwidth / percpu_counter_add_batch (9) fs mm 6 5 156d 272d 0/29 auto-obsoleted due to no activity on 2025/06/13 09:22
upstream KCSAN: data-race in __wb_update_bandwidth / percpu_counter_add_batch (5) fs mm 6 3 1513d 1547d 0/29 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 6 1591d 1690d 0/29 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 6 17 1397d 1474d 0/29 auto-closed as invalid on 2021/12/29 06:33
upstream KCSAN: data-race in __wb_update_bandwidth / percpu_counter_add_batch (8) fs mm 6 4 368d 409d 0/29 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 6 3 1813d 1852d 0/29 auto-closed as invalid on 2020/11/08 10:33
upstream KCSAN: data-race in __wb_update_bandwidth / percpu_counter_add_batch mm fs 6 9 1955d 2114d 0/29 closed as invalid on 2020/06/18 14:24

Sample crash report:
==================================================================
BUG: KCSAN: data-race in __wb_update_bandwidth / percpu_counter_add_batch

read-write to 0xffff888102315148 of 8 bytes by interrupt on cpu 1:
 percpu_counter_add_batch+0x110/0x130 lib/percpu_counter.c:107
 wb_stat_mod include/linux/backing-dev.h:66 [inline]
 __wb_writeout_add+0x42/0x1b0 mm/page-writeback.c:585
 __folio_end_writeback+0x200/0x470 mm/page-writeback.c:3028
 folio_end_writeback+0x71/0x3d0 mm/filemap.c:1660
 end_buffer_async_write+0x156/0x1f0 fs/buffer.c:419
 end_bio_bh_io_sync+0x76/0xa0 fs/buffer.c:2776
 bio_endio+0x37e/0x420 block/bio.c:1651
 blk_update_request+0x336/0x730 block/blk-mq.c:989
 blk_mq_end_request+0x26/0x50 block/blk-mq.c:1151
 lo_complete_rq+0x98/0x140 drivers/block/loop.c:314
 blk_complete_reqs block/blk-mq.c:1226 [inline]
 blk_done_softirq+0x74/0xb0 block/blk-mq.c:1231
 handle_softirqs+0xba/0x290 kernel/softirq.c:579
 do_softirq+0x5d/0x90 kernel/softirq.c:480
 __local_bh_enable_ip+0x70/0x80 kernel/softirq.c:407
 __raw_spin_unlock_bh include/linux/spinlock_api_smp.h:167 [inline]
 _raw_spin_unlock_bh+0x36/0x40 kernel/locking/spinlock.c:210
 spin_unlock_bh include/linux/spinlock.h:396 [inline]
 batadv_nc_purge_paths+0x22b/0x270 net/batman-adv/network-coding.c:471
 batadv_nc_worker+0x3d8/0xae0 net/batman-adv/network-coding.c:720
 process_one_work kernel/workqueue.c:3236 [inline]
 process_scheduled_works+0x4ce/0x9d0 kernel/workqueue.c:3319
 worker_thread+0x582/0x770 kernel/workqueue.c:3400
 kthread+0x486/0x510 kernel/kthread.c:463
 ret_from_fork+0xda/0x150 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

read to 0xffff888102315148 of 8 bytes by task 10369 on cpu 0:
 percpu_counter_read include/linux/percpu_counter.h:110 [inline]
 __wb_update_bandwidth+0x98/0x5d0 mm/page-writeback.c:1509
 wb_update_bandwidth+0x54/0x80 mm/page-writeback.c:1536
 wb_update_bandwidth_workfn+0x1c/0x30 mm/backing-dev.c:507
 process_one_work kernel/workqueue.c:3236 [inline]
 process_scheduled_works+0x4ce/0x9d0 kernel/workqueue.c:3319
 worker_thread+0x582/0x770 kernel/workqueue.c:3400
 kthread+0x486/0x510 kernel/kthread.c:463
 ret_from_fork+0xda/0x150 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

value changed: 0x000000000000c0f0 -> 0x000000000000c110

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 10369 Comm: kworker/u8:53 Not tainted syzkaller #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/14/2025
Workqueue: writeback wb_update_bandwidth_workfn
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/01 10:10 upstream b320789d6883 807a3b61 .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/08/09 12:20 upstream 2988dfed8a5d 32a0e5ed .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/07/13 22:41 upstream 5d5d62298b8b 3cda49cf .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/06/22 15:22 upstream 739a6c93cc75 d6cdfb8a .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.