syzbot


KCSAN: data-race in data_push_tail / hex_string

Status: auto-closed as invalid on 2021/08/27 18:21
Subsystems: kernel
[Documentation on labels]
First crash: 1006d, last: 1006d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in data_push_tail / hex_string (2) kernel 1 131d 131d 0/26 auto-obsoleted due to no activity on 2024/01/19 21:50

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

write to 0xffffffff84162a16 of 1 bytes by task 12624 on cpu 1:
 hex_string+0x265/0x350 lib/vsprintf.c:1179
 pointer+0x15d/0x820 lib/vsprintf.c:2399
 vsnprintf+0x8a1/0xed0 lib/vsprintf.c:2801
 vscnprintf+0x29/0x80 lib/vsprintf.c:2900
 printk_sprint kernel/printk/printk.c:2012 [inline]
 vprintk_store+0x4c1/0x9c0 kernel/printk/printk.c:2115
 vprintk_emit+0xca/0x3d0 kernel/printk/printk.c:2157
 vprintk_default+0x22/0x30 kernel/printk/printk.c:2185
 vprintk+0x15a/0x170 kernel/printk/printk_safe.c:392
 printk+0x62/0x87 kernel/printk/printk.c:2216
 show_opcodes+0xc1/0xe0 arch/x86/kernel/dumpstack.c:129
 show_ip arch/x86/kernel/dumpstack.c:150 [inline]
 show_iret_regs+0x2f/0x60 arch/x86/kernel/dumpstack.c:155
 __show_regs+0x1e/0x330 arch/x86/kernel/process_64.c:74
 show_regs_if_on_stack arch/x86/kernel/dumpstack.c:173 [inline]
 show_trace_log_lvl+0x548/0x600 arch/x86/kernel/dumpstack.c:298
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xb7/0x103 lib/dump_stack.c:105
 dump_stack+0x11/0x1a lib/dump_stack.c:112
 fail_dump lib/fault-inject.c:52 [inline]
 should_fail+0x23c/0x250 lib/fault-inject.c:146
 __should_failslab+0x81/0x90 mm/failslab.c:33
 should_failslab+0x5/0x20 mm/slab_common.c:1326
 slab_pre_alloc_hook mm/slab.h:494 [inline]
 slab_alloc mm/slab.c:3306 [inline]
 __do_kmalloc mm/slab.c:3700 [inline]
 __kmalloc_track_caller+0x64/0x340 mm/slab.c:3717
 memdup_user mm/util.c:173 [inline]
 strndup_user+0x73/0x120 mm/util.c:232
 copy_mount_string fs/namespace.c:3143 [inline]
 __do_sys_mount fs/namespace.c:3441 [inline]
 __se_sys_mount+0x4e/0x2e0 fs/namespace.c:3433
 __x64_sys_mount+0x63/0x70 fs/namespace.c:3433
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0x90 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

read to 0xffffffff84162a10 of 8 bytes by task 12635 on cpu 0:
 data_make_reusable kernel/printk/printk_ringbuffer.c:587 [inline]
 data_push_tail+0x125/0x460 kernel/printk/printk_ringbuffer.c:672
 data_alloc+0xbc/0x2b0 kernel/printk/printk_ringbuffer.c:1043
 prb_reserve+0x8f0/0xbc0 kernel/printk/printk_ringbuffer.c:1549
 vprintk_store+0x3e9/0x9c0 kernel/printk/printk.c:2105
 vprintk_emit+0xca/0x3d0 kernel/printk/printk.c:2157
 vprintk_default+0x22/0x30 kernel/printk/printk.c:2185
 vprintk+0x15a/0x170 kernel/printk/printk_safe.c:392
 printk+0x62/0x87 kernel/printk/printk.c:2216
 fail_dump lib/fault-inject.c:45 [inline]
 should_fail+0x223/0x250 lib/fault-inject.c:146
 should_fail_usercopy+0x16/0x20 lib/fault-inject-usercopy.c:37
 _copy_to_user+0x1c/0x90 lib/usercopy.c:29
 copy_to_user include/linux/uaccess.h:200 [inline]
 simple_read_from_buffer+0xab/0x120 fs/libfs.c:741
 proc_fail_nth_read+0xf6/0x140 fs/proc/base.c:1422
 vfs_read+0x154/0x5d0 fs/read_write.c:494
 ksys_read+0xce/0x180 fs/read_write.c:634
 __do_sys_read fs/read_write.c:644 [inline]
 __se_sys_read fs/read_write.c:642 [inline]
 __x64_sys_read+0x3e/0x50 fs/read_write.c:642
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0x90 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

value changed: 0x00000000fffff999 -> 0x6666203a65646f43

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 12635 Comm: syz-executor.5 Not tainted 5.14.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/07/23 18:14 upstream 8baef6386baa bc5f1d88 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in data_push_tail / hex_string
* Struck through repros no longer work on HEAD.