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: 41d, last: 14d
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 207d 412d 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 1536d 1508d 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 888d 1040d 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 1089d 1177d 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 738d 831d 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 125d 125d 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 1816d 1913d 0/28 auto-closed as invalid on 2020/04/13 07:50

Sample crash report:
loop7: detected capacity change from 0 to 8192
==================================================================
BUG: KCSAN: data-race in relay_switch_subbuf / relay_switch_subbuf

write to 0xffff8881043f5638 of 8 bytes by task 14797 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_flush_plug_list+0xe9c/0xef0 block/blk-mq.c:2891
 __blk_flush_plug+0x216/0x290 block/blk-core.c:1213
 blk_finish_plug block/blk-core.c:1240 [inline]
 __submit_bio+0x280/0x470 block/blk-core.c:637
 __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:4046
 __generic_file_write_iter+0xa1/0x120 mm/filemap.c:4147
 generic_file_write_iter+0x77/0x1c0 mm/filemap.c:4173
 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 0xffff8881043f5638 of 8 bytes by task 14791 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_unplug+0x76/0xb0 kernel/trace/blktrace.c:969
 trace_block_unplug include/trace/events/block.h:475 [inline]
 blk_mq_flush_plug_list+0xe9c/0xef0 block/blk-mq.c:2891
 __blk_flush_plug+0x216/0x290 block/blk-core.c:1213
 blk_finish_plug block/blk-core.c:1240 [inline]
 __submit_bio+0x280/0x470 block/blk-core.c:637
 __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]
 write_dirty_buffer+0xf4/0x120 fs/buffer.c:2832
 fat_sync_bhs+0x4b/0x140 fs/fat/misc.c:367
 fat_ent_write+0x8f/0xe0 fs/fat/fatent.c:419
 fat_chain_add+0x15f/0x400 fs/fat/misc.c:136
 fat_add_cluster fs/fat/inode.c:112 [inline]
 __fat_get_block fs/fat/inode.c:154 [inline]
 fat_get_block+0x46b/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
 cont_expand_zero fs/buffer.c:2504 [inline]
 cont_write_begin+0x18b/0x860 fs/buffer.c:2567
 fat_write_begin+0x51/0xe0 fs/fat/inode.c:228
 generic_cont_expand_simple+0xaa/0x150 fs/buffer.c:2468
 fat_cont_expand+0x3a/0x160 fs/fat/file.c:223
 fat_fallocate+0x17c/0x1d0 fs/fat/file.c:301
 vfs_fallocate+0x368/0x3b0 fs/open.c:327
 ksys_fallocate fs/open.c:351 [inline]
 __do_sys_fallocate fs/open.c:356 [inline]
 __se_sys_fallocate fs/open.c:354 [inline]
 __x64_sys_fallocate+0x78/0xc0 fs/open.c:354
 x64_sys_call+0x43c/0x2dc0 arch/x86/include/generated/asm/syscalls_64.h:286
 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: 1 UID: 0 PID: 14791 Comm: syz.7.4431 Not tainted 6.13.0-rc6-syzkaller-00059-g643e2e259c2b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
==================================================================

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/01/10 03:01 upstream 643e2e259c2b 67d7ec0a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in relay_switch_subbuf / relay_switch_subbuf
2025/01/09 12:07 upstream eea6e4b4dfb8 9220929f .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/22 02:21 upstream 48f506ad0b68 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/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.