[moderation] [block?] KCSAN: data-race in 0x0 / blk_account_io_start

0 views
Skip to first unread message

syzbot

unread,
7:00 PM (1 hour ago) 7:00 PM
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 666539eecdf4 Merge tag 'assoc-array-fixes-v2'
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=166435a1580000
kernel config: https://syzkaller.appspot.com/x/.config?x=b949a9d3c1d44ceb
dashboard link: https://syzkaller.appspot.com/bug?extid=251c5bf92bba96a3b8d1
compiler: Debian clang version 22.1.8 (1~deb13u4), Debian LLD 22.1.8
CC: [ax...@kernel.dk linux...@vger.kernel.org linux-...@vger.kernel.org]

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/a943b9915869/disk-666539ee.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/9bfd839d7ea5/vmlinux-666539ee.xz
kernel image: https://storage.googleapis.com/syzbot-assets/0f20b9720a71/bzImage-666539ee.xz

AI-generated root cause summary:
In blk_time_get_ns() (block/blk.h), the block layer attempts to cache timestamps
for plugged I/O submissions by updating current->flags |= PF_BLOCK_TS using a
plain, unannotated read-modify-write without disabling interrupts or preemption.
When KCSAN places a watchpoint on current->flags at offset 0x2c of task_struct
during blk_account_io_start(), task preemption under PREEMPT(lazy) allows the
task to yield and later be scheduled back in on CPU 0. During context switch in
finish_task_switch(), blk_plug_invalidate_ts() performs a plain 4-byte read of
current->flags & PF_BLOCK_TS while the unwinder cannot resolve frames during
task switch, triggering a data-race report against blk_time_get_ns().
Furthermore, non-atomic bitwise operations on current->flags violate concurrent
access invariants when flags are inspected or cleared asynchronously across
preemption points.

full analysis: https://syzkaller.appspot.com/x/ai_root_cause?x=251c5bf92bba96a3b8d1

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

==================================================================
BUG: KCSAN: data-race in 0x0 / blk_account_io_start

read to 0xffff8881045e67ac of 4 bytes by task 3288 on cpu 0:

read-write to 0xffff8881045e67ac of 4 bytes by task 3288 on cpu 0:
blk_time_get_ns block/blk.h:760 [inline]
blk_account_io_start+0x3b3/0x480 block/blk-mq.c:1120
blk_mq_bio_to_request block/blk-mq.c:2700 [inline]
blk_mq_submit_bio+0xd8a/0x1310 block/blk-mq.c:3217
__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
mpage_bio_submit_read fs/mpage.c:74 [inline]
mpage_readahead+0x32f/0x380 fs/mpage.c:379
blkdev_readahead+0x1c/0x30 block/fops.c:508
read_pages+0xa8/0x5c0 mm/readahead.c:174
page_cache_ra_unbounded+0x307/0x3f0 mm/readahead.c:315
do_page_cache_ra mm/readahead.c:348 [inline]
force_page_cache_ra+0x190/0x1d0 mm/readahead.c:378
page_cache_sync_ra+0x133/0x580 mm/readahead.c:602
filemap_get_pages+0x314/0x1020 mm/filemap.c:2743
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

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 3288 Comm: udevd Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
==================================================================


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