[moderation] [mm?] [fs?] KCSAN: data-race in fprop_new_period / fprop_reflect_period_percpu (11)

0 views
Skip to first unread message

syzbot

unread,
Jun 29, 2024, 11:47:23 PM (13 hours ago) Jun 29
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 27b31deb900d Merge tag 'xfs-6.10-fixes-5' of git://git.ker..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1191738e980000
kernel config: https://syzkaller.appspot.com/x/.config?x=7e87b541dc1fc960
dashboard link: https://syzkaller.appspot.com/bug?extid=d775c6bb22ea9b8e2b9a
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/c6422ad17065/disk-27b31deb.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/7fd7229b4967/vmlinux-27b31deb.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9237cef57ba3/bzImage-27b31deb.xz

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

==================================================================
BUG: KCSAN: data-race in fprop_new_period / fprop_reflect_period_percpu

read-write to 0xffffffff8841e0e8 of 4 bytes by interrupt on cpu 1:
fprop_new_period+0xaa/0xe0 lib/flex_proportions.c:79
writeout_period+0x59/0xe0 mm/page-writeback.c:613
call_timer_fn+0x3a/0x300 kernel/time/timer.c:1792
expire_timers kernel/time/timer.c:1843 [inline]
__run_timers kernel/time/timer.c:2417 [inline]
__run_timer_base+0x417/0x640 kernel/time/timer.c:2428
run_timer_base kernel/time/timer.c:2437 [inline]
run_timer_softirq+0x45/0x70 kernel/time/timer.c:2448
handle_softirqs+0xc3/0x280 kernel/softirq.c:554
__do_softirq kernel/softirq.c:588 [inline]
invoke_softirq kernel/softirq.c:428 [inline]
__irq_exit_rcu kernel/softirq.c:637 [inline]
irq_exit_rcu+0x3e/0x90 kernel/softirq.c:649
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
sysvec_apic_timer_interrupt+0x73/0x80 arch/x86/kernel/apic/apic.c:1043
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
kcsan_setup_watchpoint+0x404/0x410 kernel/kcsan/core.c:705
mpage_prepare_extent_to_map+0x369/0xb80 fs/ext4/inode.c:2408
ext4_do_writepages+0xa20/0x2110 fs/ext4/inode.c:2677
ext4_writepages+0x159/0x2e0 fs/ext4/inode.c:2768
do_writepages+0x1d8/0x480 mm/page-writeback.c:2634
filemap_fdatawrite_wbc+0xdb/0x100 mm/filemap.c:397
__filemap_fdatawrite_range mm/filemap.c:430 [inline]
__filemap_fdatawrite mm/filemap.c:436 [inline]
filemap_flush+0x61/0x90 mm/filemap.c:463
ext4_alloc_da_blocks+0x50/0x130 fs/ext4/inode.c:3069
ext4_release_file+0x5f/0x1c0 fs/ext4/file.c:169
__fput+0x2c2/0x660 fs/file_table.c:422
____fput+0x15/0x20 fs/file_table.c:450
task_work_run+0x13a/0x1a0 kernel/task_work.c:180
exit_task_work include/linux/task_work.h:38 [inline]
do_exit+0x5d5/0x1710 kernel/exit.c:874
do_group_exit+0x102/0x150 kernel/exit.c:1023
get_signal+0xf2f/0x1080 kernel/signal.c:2909
arch_do_signal_or_restart+0x95/0x4b0 arch/x86/kernel/signal.c:310
exit_to_user_mode_loop kernel/entry/common.c:111 [inline]
exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
irqentry_exit_to_user_mode+0x94/0x130 kernel/entry/common.c:231
irqentry_exit+0x12/0x50 kernel/entry/common.c:334
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623

read to 0xffffffff8841e0e8 of 4 bytes by task 5591 on cpu 0:
fprop_reflect_period_percpu+0x22/0x1a0 lib/flex_proportions.c:111
__fprop_add_percpu lib/flex_proportions.c:142 [inline]
__fprop_add_percpu_max+0x58/0x180 lib/flex_proportions.c:200
wb_domain_writeout_add mm/page-writeback.c:560 [inline]
__wb_writeout_add+0x77/0x1d0 mm/page-writeback.c:584
__folio_end_writeback+0x215/0x4a0 mm/page-writeback.c:3042
folio_end_writeback+0x74/0x1f0 mm/filemap.c:1632
ext4_finish_bio+0x476/0x8e0 fs/ext4/page-io.c:144
ext4_release_io_end+0x8c/0x1f0 fs/ext4/page-io.c:159
ext4_end_io_end fs/ext4/page-io.c:193 [inline]
ext4_do_flush_completed_IO fs/ext4/page-io.c:258 [inline]
ext4_end_io_rsv_work+0x2d3/0x370 fs/ext4/page-io.c:272
process_one_work kernel/workqueue.c:3248 [inline]
process_scheduled_works+0x483/0x9a0 kernel/workqueue.c:3329
worker_thread+0x526/0x720 kernel/workqueue.c:3409
kthread+0x1d1/0x210 kernel/kthread.c:389
ret_from_fork+0x4b/0x60 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

value changed: 0x00000025 -> 0x00000026

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 5591 Comm: kworker/u8:12 Tainted: G W 6.10.0-rc5-syzkaller-00280-g27b31deb900d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Workqueue: ext4-rsv-conversion ext4_end_io_rsv_work
==================================================================


---
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