syzbot


KCSAN: data-race in data_push_tail / hex_string (2)

Status: auto-obsoleted due to no activity on 2024/01/19 21:50
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+c14ab23aa665ac80ecd2@syzkaller.appspotmail.com
First crash: 140d, last: 140d
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 kernel 1 1015d 1015d 0/26 auto-closed as invalid on 2021/08/27 18:21

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

write to 0xffffffff86ee22e0 of 1 bytes by task 28744 on cpu 0:
 hex_string+0x2c1/0x310 lib/vsprintf.c:1186
 pointer+0x308/0xd10 lib/vsprintf.c:2422
 vsnprintf+0x861/0xe20 lib/vsprintf.c:2823
 vscnprintf+0x42/0x80 lib/vsprintf.c:2925
 printk_sprint+0x30/0x2d0 kernel/printk/printk.c:2124
 vprintk_store+0x56f/0x800 kernel/printk/printk.c:2238
 vprintk_emit+0xd0/0x5d0 kernel/printk/printk.c:2284
 vprintk_default+0x26/0x30 kernel/printk/printk.c:2318
 vprintk+0x71/0x80 kernel/printk/printk_safe.c:45
 _printk+0x7a/0xa0 kernel/printk/printk.c:2328
 show_opcodes+0x145/0x170 arch/x86/kernel/dumpstack.c:123
 show_ip arch/x86/kernel/dumpstack.c:144 [inline]
 show_iret_regs+0x39/0x60 arch/x86/kernel/dumpstack.c:149
 __show_regs+0x2b/0x430 arch/x86/kernel/process_64.c:75
 show_trace_log_lvl+0x3d2/0x510 arch/x86/kernel/dumpstack.c:301
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xda/0x130 lib/dump_stack.c:106
 dump_stack+0x15/0x20 lib/dump_stack.c:113
 fail_dump lib/fault-inject.c:52 [inline]
 should_fail_ex+0x21f/0x230 lib/fault-inject.c:153
 should_fail+0xb/0x10 lib/fault-inject.c:163
 should_fail_usercopy+0x1a/0x20 lib/fault-inject-usercopy.c:37
 _copy_to_user+0x1e/0x90 lib/usercopy.c:37
 copy_to_user include/linux/uaccess.h:191 [inline]
 copy_to_sockptr_offset include/linux/sockptr.h:85 [inline]
 copy_to_sockptr include/linux/sockptr.h:92 [inline]
 do_ipv6_getsockopt+0xac5/0x1420 net/ipv6/ipv6_sockglue.c:1466
 ipv6_getsockopt+0x75/0x1e0 net/ipv6/ipv6_sockglue.c:1482
 dccp_getsockopt+0xb9/0x1500 net/dccp/proto.c:687
 sock_common_getsockopt+0x57/0x70 net/core/sock.c:3684
 do_sock_getsockopt net/socket.c:2373 [inline]
 __sys_getsockopt+0x1bf/0x230 net/socket.c:2402
 __do_sys_getsockopt net/socket.c:2412 [inline]
 __se_sys_getsockopt net/socket.c:2409 [inline]
 __x64_sys_getsockopt+0x66/0x80 net/socket.c:2409
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b

read to 0xffffffff86ee22e0 of 8 bytes by task 28759 on cpu 1:
 data_make_reusable kernel/printk/printk_ringbuffer.c:590 [inline]
 data_push_tail+0x102/0x430 kernel/printk/printk_ringbuffer.c:675
 data_alloc+0xbe/0x2c0 kernel/printk/printk_ringbuffer.c:1046
 prb_reserve+0x893/0xbc0 kernel/printk/printk_ringbuffer.c:1555
 vprintk_store+0x53e/0x800 kernel/printk/printk.c:2228
 vprintk_emit+0xd0/0x5d0 kernel/printk/printk.c:2284
 vprintk_default+0x26/0x30 kernel/printk/printk.c:2318
 vprintk+0x71/0x80 kernel/printk/printk_safe.c:45
 _printk+0x7a/0xa0 kernel/printk/printk.c:2328
 fail_dump lib/fault-inject.c:45 [inline]
 should_fail_ex+0x207/0x230 lib/fault-inject.c:153
 should_fail+0xb/0x10 lib/fault-inject.c:163
 should_fail_usercopy+0x1a/0x20 lib/fault-inject-usercopy.c:37
 _copy_from_user+0x1e/0xd0 lib/usercopy.c:15
 copy_from_user include/linux/uaccess.h:183 [inline]
 copy_from_sockptr_offset include/linux/sockptr.h:48 [inline]
 copy_from_sockptr include/linux/sockptr.h:55 [inline]
 do_ipv6_getsockopt+0x12d/0x1420 net/ipv6/ipv6_sockglue.c:1123
 ipv6_getsockopt+0x75/0x1e0 net/ipv6/ipv6_sockglue.c:1482
 dccp_getsockopt+0xb9/0x1500 net/dccp/proto.c:687
 sock_common_getsockopt+0x57/0x70 net/core/sock.c:3684
 do_sock_getsockopt net/socket.c:2373 [inline]
 __sys_getsockopt+0x1bf/0x230 net/socket.c:2402
 __do_sys_getsockopt net/socket.c:2412 [inline]
 __se_sys_getsockopt net/socket.c:2409 [inline]
 __x64_sys_getsockopt+0x66/0x80 net/socket.c:2409
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b

value changed: 0x000000010000413c -> 0x3020303020303020

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 28759 Comm: syz-executor.0 Not tainted 6.7.0-rc5-syzkaller-00134-g3f7168591ebf #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
==================================================================
CPU: 1 PID: 28759 Comm: syz-executor.0 Not tainted 6.7.0-rc5-syzkaller-00134-g3f7168591ebf #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xda/0x130 lib/dump_stack.c:106
 dump_stack+0x15/0x20 lib/dump_stack.c:113
 fail_dump lib/fault-inject.c:52 [inline]
 should_fail_ex+0x21f/0x230 lib/fault-inject.c:153
 should_fail+0xb/0x10 lib/fault-inject.c:163
 should_fail_usercopy+0x1a/0x20 lib/fault-inject-usercopy.c:37
 _copy_from_user+0x1e/0xd0 lib/usercopy.c:15
 copy_from_user include/linux/uaccess.h:183 [inline]
 copy_from_sockptr_offset include/linux/sockptr.h:48 [inline]
 copy_from_sockptr include/linux/sockptr.h:55 [inline]
 do_ipv6_getsockopt+0x12d/0x1420 net/ipv6/ipv6_sockglue.c:1123
 ipv6_getsockopt+0x75/0x1e0 net/ipv6/ipv6_sockglue.c:1482
 dccp_getsockopt+0xb9/0x1500 net/dccp/proto.c:687
 sock_common_getsockopt+0x57/0x70 net/core/sock.c:3684
 do_sock_getsockopt net/socket.c:2373 [inline]
 __sys_getsockopt+0x1bf/0x230 net/socket.c:2402
 __do_sys_getsockopt net/socket.c:2412 [inline]
 __se_sys_getsockopt net/socket.c:2409 [inline]
 __x64_sys_getsockopt+0x66/0x80 net/socket.c:2409
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7fac42906ba9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fac41c890c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000037
RAX: ffffffffffffffda RBX: 00007fac42a25f80 RCX: 00007fac42906ba9
RDX: 000000000000000b RSI: 0000000000000029 RDI: 0000000000000003
RBP: 00007fac41c89120 R08: 0000000020000140 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 000000000000000b R14: 00007fac42a25f80 R15: 00007fffd6961278
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/12/15 21:49 upstream 3f7168591ebf 3222d10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in data_push_tail / hex_string
* Struck through repros no longer work on HEAD.