syzbot


KCSAN: data-race in memchr / number (3)

Status: moderation: reported on 2024/06/01 04:52
Subsystems: ext4
[Documentation on labels]
Reported-by: syzbot+c6474413e6cf4c5f6fa4@syzkaller.appspotmail.com
First crash: 17d, last: 17d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in memchr / number (2) block 1 54d 54d 0/27 auto-obsoleted due to no activity on 2024/05/30 03:24
upstream KCSAN: data-race in memchr / number kernel 1 345d 345d 0/27 auto-obsoleted due to no activity on 2023/08/13 11:35

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

write to 0xffffffff883cfc92 of 1 bytes by task 6180 on cpu 1:
 number+0x85f/0xa90 lib/vsprintf.c:564
 vsnprintf+0xa44/0xe30 lib/vsprintf.c:2890
 va_format lib/vsprintf.c:1683 [inline]
 pointer+0x8a1/0xd20 lib/vsprintf.c:2455
 vsnprintf+0x861/0xe30 lib/vsprintf.c:2828
 vscnprintf+0x42/0x90 lib/vsprintf.c:2930
 printk_sprint+0x30/0x2d0 kernel/printk/printk.c:2162
 vprintk_store+0x4a4/0x810 kernel/printk/printk.c:2244
 vprintk_emit+0x10c/0x5e0 kernel/printk/printk.c:2326
 vprintk_default+0x26/0x30 kernel/printk/printk.c:2360
 vprintk+0x75/0x80 kernel/printk/printk_safe.c:45
 _printk+0x7a/0xa0 kernel/printk/printk.c:2370
 __ext4_grp_locked_error+0x5b0/0x7b0 fs/ext4/super.c:1063
 ext4_mb_generate_buddy+0x247/0x2d0 fs/ext4/mballoc.c:1217
 ext4_mb_init_cache+0x848/0xbc0 fs/ext4/mballoc.c:1406
 ext4_mb_init_group+0x210/0x3b0 fs/ext4/mballoc.c:1543
 ext4_mb_good_group_nolock fs/ext4/mballoc.c:2704 [inline]
 ext4_mb_regular_allocator+0xb13/0x2370 fs/ext4/mballoc.c:2903
 ext4_mb_new_blocks+0x801/0x2020 fs/ext4/mballoc.c:6219
 ext4_ext_map_blocks+0x10a1/0x33b0 fs/ext4/extents.c:4318
 ext4_map_blocks+0x72a/0xf50 fs/ext4/inode.c:623
 mpage_map_one_extent fs/ext4/inode.c:2163 [inline]
 mpage_map_and_submit_extent fs/ext4/inode.c:2216 [inline]
 ext4_do_writepages+0xd85/0x2110 fs/ext4/inode.c:2679
 ext4_writepages+0x159/0x2e0 fs/ext4/inode.c:2768
 do_writepages+0x1d8/0x480 mm/page-writeback.c:2634
 filemap_fdatawrite_wbc+0xdb/0x100 mm/filemap.c:397
 __filemap_fdatawrite_range mm/filemap.c:430 [inline]
 file_write_and_wait_range+0xc8/0x170 mm/filemap.c:788
 generic_buffers_fsync_noflush+0x4c/0x130 fs/buffer.c:602
 ext4_fsync_nojournal fs/ext4/fsync.c:88 [inline]
 ext4_sync_file+0x20b/0x6c0 fs/ext4/fsync.c:151
 vfs_fsync_range+0x122/0x140 fs/sync.c:188
 generic_write_sync include/linux/fs.h:2794 [inline]
 ext4_buffered_write_iter+0x338/0x380 fs/ext4/file.c:305
 ext4_file_write_iter+0x29f/0xe30
 do_iter_readv_writev+0x339/0x3e0
 vfs_writev+0x2e4/0x890 fs/read_write.c:971
 do_pwritev fs/read_write.c:1072 [inline]
 __do_sys_pwritev2 fs/read_write.c:1131 [inline]
 __se_sys_pwritev2+0x10c/0x1d0 fs/read_write.c:1122
 __x64_sys_pwritev2+0x78/0x90 fs/read_write.c:1122
 x64_sys_call+0x274f/0x2d70 arch/x86/include/generated/asm/syscalls_64.h:329
 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

read to 0xffffffff883cfc92 of 1 bytes by task 6189 on cpu 0:
 memchr+0x2a/0x50 lib/string.c:791
 count_lines kernel/printk/printk_ringbuffer.c:1797 [inline]
 copy_data kernel/printk/printk_ringbuffer.c:1843 [inline]
 prb_read kernel/printk/printk_ringbuffer.c:1936 [inline]
 _prb_read_valid+0xa26/0xba0 kernel/printk/printk_ringbuffer.c:2113
 prb_read_valid_info+0x67/0x90 kernel/printk/printk_ringbuffer.c:2216
 find_first_fitting_seq+0x1bc/0x310 kernel/printk/printk.c:1535
 syslog_print_all+0x11d/0x5a0 kernel/printk/printk.c:1667
 do_syslog+0x41c/0x7d0 kernel/printk/printk.c:1745
 __do_sys_syslog kernel/printk/printk.c:1823 [inline]
 __se_sys_syslog kernel/printk/printk.c:1821 [inline]
 __x64_sys_syslog+0x43/0x50 kernel/printk/printk.c:1821
 x64_sys_call+0x26cd/0x2d70 arch/x86/include/generated/asm/syscalls_64.h:104
 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: 0x41 -> 0x39

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 6189 Comm: syz-executor.4 Not tainted 6.10.0-rc1-syzkaller-00104-gd8ec19857b09 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/06/01 04:52 upstream d8ec19857b09 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in memchr / number
* Struck through repros no longer work on HEAD.