Hello,
syzbot found the following issue on:
HEAD commit: 8dac6df92a2e Merge tag 'nfsd-7.4-1' of git://git.kernel.or..
git tree: upstream
console output:
https://syzkaller.appspot.com/x/log.txt?x=108d4d4d580000
kernel config:
https://syzkaller.appspot.com/x/.config?x=886d2ddd2d6b664e
dashboard link:
https://syzkaller.appspot.com/bug?extid=809b5f50e670f71bc255
compiler: Debian clang version 22.1.8 (1~deb13u4), Debian LLD 22.1.8
CC: [
Ja...@zx2c4.com ax...@kernel.dk linux...@vger.kernel.org linux-...@vger.kernel.org net...@vger.kernel.org wire...@lists.zx2c4.com]
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/dfc787d10469/disk-8dac6df9.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/db7a8e4799da/vmlinux-8dac6df9.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/169073a123bc/bzImage-8dac6df9.xz
AI-generated root cause summary:
KCSAN reports a data race on struct work_struct::data between an unmarked read
in process_one_work() (via process_scheduled_works()) and a marked atomic bit
operation in queue_work_on(). When set_printk_work is already queued and being
claimed by a kworker in process_one_work() with pool->lock held (before
WORK_STRUCT_PENDING_BIT is cleared), another CPU calls
schedule_work(&set_printk_work) -> queue_work_on(), which executes
test_and_set_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(work)) without holding
pool->lock. Meanwhile, process_one_work() reads work_data =
*work_data_bits(work) using a plain (unmarked) load instead of
atomic_long_read(&work->data) or READ_ONCE(), triggering the KCSAN report
despite the race being benign.
full analysis:
https://syzkaller.appspot.com/x/ai_root_cause?x=809b5f50e670f71bc255
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+809b5f...@syzkaller.appspotmail.com
==================================================================
BUG: KCSAN: data-race in process_scheduled_works / queue_work_on
read-write (marked) to 0xffff888100a0cc90 of 8 bytes by task 4143 on cpu 0:
instrument_atomic_read_write include/linux/instrumented.h:113 [inline]
test_and_set_bit include/asm-generic/bitops/instrumented-atomic.h:71 [inline]
queue_work_on+0x42/0x150 kernel/workqueue.c:2597
queue_work include/linux/workqueue.h:700 [inline]
loop_queue_work drivers/block/loop.c:769 [inline]
loop_queue_rq+0x5d2/0x6a0 drivers/block/loop.c:1811
__blk_mq_issue_directly block/blk-mq.c:2718 [inline]
blk_mq_try_issue_directly+0x290/0x500 block/blk-mq.c:2778
blk_mq_submit_bio+0xf7d/0x1310 block/blk-mq.c:3242
__submit_bio+0x68/0x250 block/blk-core.c:674
__submit_bio_noacct_mq block/blk-core.c:757 [inline]
submit_bio_noacct_nocheck+0x168/0x650 block/blk-core.c:791
submit_bio_noacct+0x810/0xa80 block/blk-core.c:929
submit_bio+0x2a4/0x2c0 block/blk-core.c:970
blk_crypto_submit_bio include/linux/blk-crypto.h:212 [inline]
__bh_submit+0x427/0x460 fs/buffer.c:1148
bh_submit fs/buffer.c:1162 [inline]
block_read_full_folio+0x60e/0x650 fs/buffer.c:2386
blkdev_read_folio+0x1c/0x30 block/fops.c:503
filemap_read_folio+0x40/0x150 mm/filemap.c:2549
filemap_update_page mm/filemap.c:2636 [inline]
filemap_get_pages+0xe98/0x1020 mm/filemap.c:2766
filemap_read+0x20d/0x8d0 mm/filemap.c:2853
blkdev_read_iter+0x29c/0x390 block/fops.c:892
new_sync_read fs/read_write.c:473 [inline]
vfs_read+0x6ac/0x7d0 fs/read_write.c:554
ksys_read+0xdc/0x1a0 fs/read_write.c:696
__do_sys_read fs/read_write.c:705 [inline]
__se_sys_read fs/read_write.c:703 [inline]
__x64_sys_read+0x40/0x50 fs/read_write.c:703
x64_sys_call+0x2135/0x2550 arch/x86/include/generated/asm/syscalls_64.h:1
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x11e/0x3a0 arch/x86/entry/syscall_64.c:89
entry_SYSCALL_64_after_hwframe+0x77/0x7f
read to 0xffff888100a0cc90 of 8 bytes by task 366 on cpu 1:
process_one_work kernel/workqueue.c:3419 [inline]
process_scheduled_works+0x2fd/0xab0 kernel/workqueue.c:3578
worker_thread+0x56c/0x770 kernel/workqueue.c:3659
kthread+0x248/0x2a0 kernel/kthread.c:436
ret_from_fork+0x146/0x330 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 366 Comm: kworker/u8:6 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
Workqueue: loop2 loop_rootcg_workfn
==================================================================
---
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