syzbot


KCSAN: data-race in wb_timer_fn / wbt_inflight_cb

Status: auto-closed as invalid on 2020/08/25 18:17
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 813d, last: 795d
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in wb_timer_fn / wbt_inflight_cb (2) 11 607d 657d 0/24 auto-closed as invalid on 2021/03/02 02:09
upstream KCSAN: data-race in wb_timer_fn / wbt_inflight_cb (3) 1 531d 531d 0/24 auto-closed as invalid on 2021/05/17 08:41

Sample crash report:
==================================================================
BUG: KCSAN: data-race in wb_timer_fn / wbt_inflight_cb

write to 0xffff88821a1daf04 of 4 bytes by interrupt on cpu 0:
 calc_wb_limits block/blk-wbt.c:304 [inline]
 scale_up block/blk-wbt.c:313 [inline]
 wb_timer_fn+0x56a/0xa30 block/blk-wbt.c:374
 blk_stat_timer_fn+0x3f4/0x410 block/blk-stat.c:99
 call_timer_fn+0x30/0x2a0 kernel/time/timer.c:1415
 expire_timers+0x116/0x290 kernel/time/timer.c:1460
 __run_timers+0x443/0x500 kernel/time/timer.c:1784
 run_timer_softirq+0x2e/0x60 kernel/time/timer.c:1797
 __do_softirq+0x198/0x360 kernel/softirq.c:292
 asm_call_on_stack+0xf/0x20 arch/x86/entry/entry_64.S:711
 __run_on_irqstack arch/x86/include/asm/irq_stack.h:22 [inline]
 run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:48 [inline]
 do_softirq_own_stack+0x5d/0x80 arch/x86/kernel/irq_64.c:77
 invoke_softirq kernel/softirq.c:387 [inline]
 __irq_exit_rcu+0x115/0x120 kernel/softirq.c:417
 sysvec_apic_timer_interrupt+0xba/0xd0 arch/x86/kernel/apic/apic.c:1091
 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:585
 find_watchpoint kernel/kcsan/core.c:123 [inline]
 check_access kernel/kcsan/core.c:566 [inline]
 __tsan_read8+0x2f/0x180 kernel/kcsan/core.c:777
 unlock_page_memcg+0x2e/0xc0 mm/memcontrol.c:2035
 page_remove_rmap+0x26f/0x2e0 mm/rmap.c:1367
 zap_pte_range+0x702/0x1610 mm/memory.c:1089
 zap_pmd_range mm/memory.c:1193 [inline]
 zap_pud_range mm/memory.c:1222 [inline]
 zap_p4d_range mm/memory.c:1243 [inline]
 unmap_page_range+0x751/0x870 mm/memory.c:1264
 unmap_single_vma+0x157/0x210 mm/memory.c:1309
 unmap_vmas+0xc0/0x150 mm/memory.c:1341
 exit_mmap+0x1c7/0x3b0 mm/mmap.c:3150
 __mmput+0xa2/0x220 kernel/fork.c:1093
 mmput+0x38/0x40 kernel/fork.c:1114
 exit_mm+0x2c8/0x330 kernel/exit.c:482
 do_exit+0x415/0x16e0 kernel/exit.c:792
 do_group_exit+0xcb/0x180 kernel/exit.c:903
 get_signal+0x106d/0x1650 kernel/signal.c:2743
 do_signal+0x25/0x270 arch/x86/kernel/signal.c:810
 exit_to_usermode_loop arch/x86/entry/common.c:235 [inline]
 __prepare_exit_to_usermode+0x127/0x230 arch/x86/entry/common.c:269
 __syscall_return_slowpath+0x47/0x60 arch/x86/entry/common.c:352
 do_syscall_64+0x5d/0xb0 arch/x86/entry/common.c:393
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

read to 0xffff88821a1daf04 of 4 bytes by task 13537 on cpu 1:
 rwb_enabled block/blk-wbt.c:80 [inline]
 get_limit block/blk-wbt.c:458 [inline]
 wbt_inflight_cb+0x3f/0x220 block/blk-wbt.c:495
 rq_qos_wait+0xac/0x220 block/blk-rq-qos.c:266
 __wbt_wait block/blk-wbt.c:518 [inline]
 wbt_wait+0x1bb/0x2b0 block/blk-wbt.c:583
 __rq_qos_throttle+0x39/0x70 block/blk-rq-qos.c:72
 rq_qos_throttle block/blk-rq-qos.h:182 [inline]
 blk_mq_make_request+0x234/0x1070 block/blk-mq.c:2050
 do_make_request block/blk-core.c:1084 [inline]
 generic_make_request+0x240/0x5d0 block/blk-core.c:1156
 submit_bio+0x200/0x370 block/blk-core.c:1275
 submit_bh_wbc+0x397/0x3d0 fs/buffer.c:3073
 submit_bh fs/buffer.c:3079 [inline]
 write_dirty_buffer+0xd4/0xe0 fs/buffer.c:3147
 fat_sync_bhs+0x52/0x160 fs/fat/misc.c:357
 fat_alloc_clusters+0x909/0xa60 fs/fat/fatent.c:539
 fat_add_cluster fs/fat/inode.c:108 [inline]
 __fat_get_block fs/fat/inode.c:155 [inline]
 fat_get_block+0x213/0x5a0 fs/fat/inode.c:190
 __block_write_begin_int+0x4bf/0xfd0 fs/buffer.c:2012
 __block_write_begin fs/buffer.c:2062 [inline]
 block_write_begin+0x4f/0x190 fs/buffer.c:2121
 cont_write_begin+0x42c/0x610 fs/buffer.c:2470
 fat_write_begin+0x61/0xf0 fs/fat/inode.c:235
 generic_perform_write+0x196/0x390 mm/filemap.c:3318
 __generic_file_write_iter+0x154/0x330 mm/filemap.c:3447
 generic_file_write_iter+0x2f3/0x3e0 mm/filemap.c:3479
 call_write_iter include/linux/fs.h:1908 [inline]
 new_sync_write fs/read_write.c:503 [inline]
 vfs_write+0x607/0x690 fs/read_write.c:578
 ksys_write+0xce/0x180 fs/read_write.c:631
 __do_sys_write fs/read_write.c:643 [inline]
 __se_sys_write fs/read_write.c:640 [inline]
 __x64_sys_write+0x3e/0x50 fs/read_write.c:640
 do_syscall_64+0x51/0xb0 arch/x86/entry/common.c:384
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 13537 Comm: syz-executor.3 Not tainted 5.8.0-rc6-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================

Crashes (5):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-kcsan-gce 2020/07/21 18:12 upstream 4fa640dc5230 e562dd8a .config log report
ci2-upstream-kcsan-gce 2020/07/21 08:58 upstream 4fa640dc5230 d88894e6 .config log report
ci2-upstream-kcsan-gce 2020/07/20 16:53 upstream 5714ee50bb43 8caeeeb7 .config log report
ci2-upstream-kcsan-gce 2020/07/09 23:38 upstream 2a89b99f5803 edf162e8 .config log report
ci2-upstream-kcsan-gce 2020/07/03 14:05 upstream cdd3bb54332f 6e569755 .config log report
* Struck through repros no longer work on HEAD.