[moderation] [fs?] [mm?] KCSAN: data-race in __wb_writeout_add / writeout_period (4)

3 views
Skip to first unread message

syzbot

unread,
Dec 7, 2023, 7:07:29 PM12/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=1157c4f2e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=ac34c1f29a8029df
dashboard link: https://syzkaller.appspot.com/bug?extid=f8a138eda1477afcb03f
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+f8a138...@syzkaller.appspotmail.com

==================================================================
BUG: KCSAN: data-race in __wb_writeout_add / writeout_period

write to 0xffffffff86ef7d90 of 8 bytes by interrupt on cpu 1:
writeout_period+0xa6/0xe0 mm/page-writeback.c:614
call_timer_fn+0x37/0x2f0 kernel/time/timer.c:1700
expire_timers kernel/time/timer.c:1751 [inline]
__run_timers+0x46c/0x650 kernel/time/timer.c:2022
run_timer_softirq+0x31/0x40 kernel/time/timer.c:2037
__do_softirq+0xc4/0x279 kernel/softirq.c:553
invoke_softirq kernel/softirq.c:427 [inline]
__irq_exit_rcu kernel/softirq.c:632 [inline]
irq_exit_rcu+0x3b/0x90 kernel/softirq.c:644
sysvec_apic_timer_interrupt+0x6d/0x80 arch/x86/kernel/apic/apic.c:1076
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645
kcsan_setup_watchpoint+0x3fe/0x410 kernel/kcsan/core.c:705
sg_assign_page include/linux/scatterlist.h:119 [inline]
sg_set_page include/linux/scatterlist.h:139 [inline]
__blk_bvec_map_sg block/blk-merge.c:501 [inline]
__blk_bios_map_sg block/blk-merge.c:548 [inline]
__blk_rq_map_sg+0x4b3/0x8a0 block/blk-merge.c:575
scsi_alloc_sgtables+0x1c9/0x4b0 drivers/scsi/scsi_lib.c:1048
sd_setup_read_write_cmnd drivers/scsi/sd.c:1200 [inline]
sd_init_command+0x492/0xe80 drivers/scsi/sd.c:1325
scsi_prepare_cmd drivers/scsi/scsi_lib.c:1605 [inline]
scsi_queue_rq+0x1389/0x1a30 drivers/scsi/scsi_lib.c:1739
blk_mq_dispatch_rq_list+0x2d9/0x1090 block/blk-mq.c:2049
__blk_mq_do_dispatch_sched block/blk-mq-sched.c:170 [inline]
blk_mq_do_dispatch_sched block/blk-mq-sched.c:184 [inline]
__blk_mq_sched_dispatch_requests+0x5ec/0xd20 block/blk-mq-sched.c:309
blk_mq_sched_dispatch_requests+0x99/0x100 block/blk-mq-sched.c:333
blk_mq_run_hw_queue+0x2a4/0x4c0 block/blk-mq.c:2264
blk_mq_flush_plug_list+0x7b6/0xdc0 block/blk-mq.c:2812
blk_add_rq_to_plug+0x108/0x3e0 block/blk-mq.c:1294
blk_mq_submit_bio+0x61a/0xd90 block/blk-mq.c:3008
__submit_bio+0x11c/0x350 block/blk-core.c:607
__submit_bio_noacct_mq block/blk-core.c:686 [inline]
submit_bio_noacct_nocheck+0x449/0x5e0 block/blk-core.c:715
submit_bio_noacct+0x70c/0x8c0 block/blk-core.c:809
submit_bio+0xb7/0xc0 block/blk-core.c:842
ext4_io_submit+0x8a/0xa0 fs/ext4/page-io.c:378
ext4_do_writepages+0xb3a/0x2100 fs/ext4/inode.c:2705
ext4_writepages+0x15e/0x2e0 fs/ext4/inode.c:2774
do_writepages+0x1c2/0x340 mm/page-writeback.c:2553
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

read to 0xffffffff86ef7d90 of 8 bytes by task 39 on cpu 0:
wb_domain_writeout_add mm/page-writeback.c:563 [inline]
__wb_writeout_add+0x8a/0x1d0 mm/page-writeback.c:584
__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

value changed: 0x0000000100003e9d -> 0x0000000100003fc9

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 39 Comm: kworker/u4:2 Not tainted 6.7.0-rc4-syzkaller-00009-gbee0e7762ad2 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
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