syzbot


KCSAN: data-race in relay_switch_subbuf / relay_switch_subbuf (8)

Status: moderation: reported on 2024/12/13 19:16
Subsystems: block trace
[Documentation on labels]
Reported-by: syzbot+33cd3ee18319284d41c7@syzkaller.appspotmail.com
First crash: 7d18h, last: 11h43m
Similar bugs (7)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in relay_switch_subbuf / relay_switch_subbuf (6) trace block 65 173d 378d 0/28 auto-obsoleted due to no activity on 2024/08/04 19:00
upstream KCSAN: data-race in relay_switch_subbuf / relay_switch_subbuf (2) block trace 3 1503d 1475d 0/28 auto-closed as invalid on 2020/12/21 11:49
upstream KCSAN: data-race in relay_switch_subbuf / relay_switch_subbuf (4) block trace 11 854d 1007d 0/28 auto-closed as invalid on 2022/09/24 02:55
upstream KCSAN: data-race in relay_switch_subbuf / relay_switch_subbuf (3) block trace 6 1055d 1143d 0/28 auto-closed as invalid on 2022/03/06 18:39
upstream KCSAN: data-race in relay_switch_subbuf / relay_switch_subbuf (5) block trace 19 704d 797d 0/28 auto-obsoleted due to no activity on 2023/04/10 19:57
upstream KCSAN: data-race in relay_switch_subbuf / relay_switch_subbuf (7) block trace 1 92d 92d 0/28 auto-obsoleted due to no activity on 2024/10/25 05:49
upstream KCSAN: data-race in relay_switch_subbuf / relay_switch_subbuf trace block 17 1783d 1879d 0/28 auto-closed as invalid on 2020/04/13 07:50

Sample crash report:
==================================================================
BUG: KCSAN: data-race in relay_switch_subbuf / relay_switch_subbuf

write to 0xffff888129346e38 of 8 bytes by task 23692 on cpu 1:
 relay_switch_subbuf+0x39e/0x3b0 kernel/relay.c:708
 relay_reserve include/linux/relay.h:248 [inline]
 __blk_add_trace+0x66a/0x730 kernel/trace/blktrace.c:276
 blk_add_trace_plug+0x4c/0x70 kernel/trace/blktrace.c:949
 trace_block_plug include/trace/events/block.h:430 [inline]
 blk_add_rq_to_plug+0x31b/0x3d0 block/blk-mq.c:1378
 blk_mq_submit_bio+0x96c/0xe40 block/blk-mq.c:3146
 __submit_bio+0xf2/0x470 block/blk-core.c:629
 __submit_bio_noacct_mq block/blk-core.c:710 [inline]
 submit_bio_noacct_nocheck+0x295/0x6e0 block/blk-core.c:739
 submit_bio_noacct+0x766/0x9a0 block/blk-core.c:868
 submit_bio+0x218/0x230 block/blk-core.c:910
 submit_bh_wbc+0x2ed/0x330 fs/buffer.c:2814
 submit_bh fs/buffer.c:2819 [inline]
 __sync_dirty_buffer+0x171/0x250 fs/buffer.c:2857
 sync_dirty_buffer+0x1a/0x20 fs/buffer.c:2870
 fat_mirror_bhs+0x278/0x330 fs/fat/fatent.c:400
 fat_alloc_clusters+0x994/0xa80 fs/fat/fatent.c:543
 fat_add_cluster fs/fat/inode.c:107 [inline]
 __fat_get_block fs/fat/inode.c:154 [inline]
 fat_get_block+0x25c/0x5e0 fs/fat/inode.c:189
 __block_write_begin_int+0x417/0xfa0 fs/buffer.c:2116
 block_write_begin fs/buffer.c:2226 [inline]
 cont_write_begin+0x546/0x860 fs/buffer.c:2577
 fat_write_begin+0x51/0xe0 fs/fat/inode.c:228
 generic_perform_write+0x1a8/0x4a0 mm/filemap.c:4055
 __generic_file_write_iter+0xa1/0x120 mm/filemap.c:4156
 generic_file_write_iter+0x77/0x1c0 mm/filemap.c:4182
 new_sync_write fs/read_write.c:586 [inline]
 vfs_write+0x77f/0x920 fs/read_write.c:679
 ksys_write+0xe8/0x1b0 fs/read_write.c:731
 __do_sys_write fs/read_write.c:742 [inline]
 __se_sys_write fs/read_write.c:739 [inline]
 __x64_sys_write+0x42/0x50 fs/read_write.c:739
 x64_sys_call+0x287e/0x2dc0 arch/x86/include/generated/asm/syscalls_64.h:2
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

write to 0xffff888129346e38 of 8 bytes by task 23695 on cpu 0:
 relay_switch_subbuf+0x39e/0x3b0 kernel/relay.c:708
 relay_reserve include/linux/relay.h:248 [inline]
 __blk_add_trace+0x66a/0x730 kernel/trace/blktrace.c:276
 blk_add_trace_unplug+0x76/0xb0 kernel/trace/blktrace.c:969
 trace_block_unplug include/trace/events/block.h:475 [inline]
 blk_mq_dispatch_plug_list block/blk-mq.c:2850 [inline]
 blk_mq_flush_plug_list+0xd61/0xef0 block/blk-mq.c:2913
 __blk_flush_plug+0x216/0x290 block/blk-core.c:1213
 blk_flush_plug include/linux/blkdev.h:1061 [inline]
 io_schedule_prepare kernel/sched/core.c:7650 [inline]
 io_schedule+0x37/0x60 kernel/sched/core.c:7680
 bit_wait_io+0xc/0x50 kernel/sched/wait_bit.c:247
 __wait_on_bit+0xd0/0x160 kernel/sched/wait_bit.c:49
 out_of_line_wait_on_bit+0x97/0xc0 kernel/sched/wait_bit.c:64
 wait_on_bit_io include/linux/wait_bit.h:105 [inline]
 __wait_on_buffer+0x59/0x70 fs/buffer.c:123
 wait_on_buffer include/linux/buffer_head.h:414 [inline]
 fat_sync_bhs+0xaf/0x140 fs/fat/misc.c:370
 fat_alloc_clusters+0x941/0xa80 fs/fat/fatent.c:541
 fat_add_cluster fs/fat/inode.c:107 [inline]
 __fat_get_block fs/fat/inode.c:154 [inline]
 fat_get_block+0x25c/0x5e0 fs/fat/inode.c:189
 __block_write_begin_int+0x417/0xfa0 fs/buffer.c:2116
 block_write_begin fs/buffer.c:2226 [inline]
 cont_write_begin+0x546/0x860 fs/buffer.c:2577
 fat_write_begin+0x51/0xe0 fs/fat/inode.c:228
 generic_perform_write+0x1a8/0x4a0 mm/filemap.c:4055
 __generic_file_write_iter+0xa1/0x120 mm/filemap.c:4156
 generic_file_write_iter+0x77/0x1c0 mm/filemap.c:4182
 aio_write+0x2f7/0x420 fs/aio.c:1633
 io_submit_one+0xb0c/0x1230 fs/aio.c:2052
 __do_sys_io_submit fs/aio.c:2111 [inline]
 __se_sys_io_submit+0xf5/0x280 fs/aio.c:2081
 __x64_sys_io_submit+0x43/0x50 fs/aio.c:2081
 x64_sys_call+0x2c20/0x2dc0 arch/x86/include/generated/asm/syscalls_64.h:210
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x0000000000000030 -> 0x0000000000000038

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 23695 Comm: syz.5.31127 Not tainted 6.13.0-rc3-syzkaller-00193-ge9b8ffafd20a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/25/2024
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/12/21 02:09 upstream e9b8ffafd20a d7f584ee .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in relay_switch_subbuf / relay_switch_subbuf
2024/12/16 18:47 upstream 78d4f34e2115 eec85da6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in relay_switch_subbuf / relay_switch_subbuf
2024/12/16 18:46 upstream 78d4f34e2115 eec85da6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in relay_switch_subbuf / relay_switch_subbuf
2024/12/13 19:15 upstream 243f750a2df0 3547e30f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in relay_switch_subbuf / relay_switch_subbuf
* Struck through repros no longer work on HEAD.