[moderation] [fs?] [mm?] KCSAN: data-race in __wb_update_bandwidth / percpu_counter_add_batch (7)

4 views
Skip to first unread message

syzbot

unread,
Dec 7, 2023, 5:04:27 AM12/7/23
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: bee0e7762ad2 Merge tag 'for-linus-iommufd' of git://git.ke..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=109f1218e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=ac34c1f29a8029df
dashboard link: https://syzkaller.appspot.com/bug?extid=7d4479724906e2801233
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
CC: [ak...@linux-foundation.org linux-...@vger.kernel.org linux-...@vger.kernel.org linu...@kvack.org wi...@infradead.org]

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/233be5f65dd2/disk-bee0e776.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/94423738a289/vmlinux-bee0e776.xz
kernel image: https://storage.googleapis.com/syzbot-assets/0b977463fa9a/bzImage-bee0e776.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+7d4479...@syzkaller.appspotmail.com

==================================================================
BUG: KCSAN: data-race in __wb_update_bandwidth / percpu_counter_add_batch

read-write to 0xffff8881017a2140 of 8 bytes by task 1734 on cpu 1:
percpu_counter_add_batch+0xc9/0x140 lib/percpu_counter.c:96
wb_stat_mod include/linux/backing-dev.h:67 [inline]
__wb_writeout_add+0x4c/0x1d0 mm/page-writeback.c:583
__folio_end_writeback+0x21b/0x4a0 mm/page-writeback.c:2963
folio_end_writeback+0x74/0x1f0 mm/filemap.c:1598
ext4_finish_bio+0x45c/0x8c0 fs/ext4/page-io.c:145
ext4_release_io_end+0x8c/0x1e0 fs/ext4/page-io.c:160
ext4_end_io_end fs/ext4/page-io.c:194 [inline]
ext4_do_flush_completed_IO fs/ext4/page-io.c:259 [inline]
ext4_end_io_rsv_work+0x2d3/0x360 fs/ext4/page-io.c:273
process_one_work kernel/workqueue.c:2630 [inline]
process_scheduled_works+0x5b8/0xa30 kernel/workqueue.c:2703
worker_thread+0x525/0x730 kernel/workqueue.c:2784
kthread+0x1d7/0x210 kernel/kthread.c:388
ret_from_fork+0x48/0x60 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242

read to 0xffff8881017a2140 of 8 bytes by task 9507 on cpu 0:
percpu_counter_read include/linux/percpu_counter.h:110 [inline]
__wb_update_bandwidth+0x9b/0x5c0 mm/page-writeback.c:1462
wb_update_bandwidth mm/page-writeback.c:1489 [inline]
do_writepages+0x30a/0x340 mm/page-writeback.c:2584
filemap_fdatawrite_wbc+0xdb/0xf0 mm/filemap.c:387
__filemap_fdatawrite_range mm/filemap.c:420 [inline]
__filemap_fdatawrite mm/filemap.c:426 [inline]
filemap_flush+0x95/0xc0 mm/filemap.c:453
ext4_alloc_da_blocks+0x50/0x130 fs/ext4/inode.c:3077
ext4_release_file+0x5f/0x1c0 fs/ext4/file.c:169
__fput+0x299/0x630 fs/file_table.c:394
____fput+0x15/0x20 fs/file_table.c:422
task_work_run+0x135/0x1a0 kernel/task_work.c:180
exit_task_work include/linux/task_work.h:38 [inline]
do_exit+0x604/0x16d0 kernel/exit.c:871
do_group_exit+0x101/0x150 kernel/exit.c:1021
get_signal+0xf4e/0x10a0 kernel/signal.c:2904
arch_do_signal_or_restart+0x95/0x4b0 arch/x86/kernel/signal.c:309
exit_to_user_mode_loop+0x6f/0xe0 kernel/entry/common.c:168
exit_to_user_mode_prepare+0x6c/0xb0 kernel/entry/common.c:204
irqentry_exit_to_user_mode+0x9/0x20 kernel/entry/common.c:309
irqentry_exit+0x12/0x40 kernel/entry/common.c:412
exc_general_protection+0x339/0x4c0 arch/x86/kernel/traps.c:642
asm_exc_general_protection+0x26/0x30 arch/x86/include/asm/idtentry.h:564

value changed: 0x000000000001d4f0 -> 0x000000000001d500

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 9507 Comm: syz-executor.5 Not tainted 6.7.0-rc4-syzkaller-00009-gbee0e7762ad2 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages