KCSAN: data-race in __alloc_file / copy_creds

4 views
Skip to first unread message

syzbot

unread,
Nov 8, 2019, 8:24:10 AM11/8/19
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 05f22368 x86, kcsan: Enable KCSAN for x86
git tree: https://github.com/google/ktsan.git kcsan
console output: https://syzkaller.appspot.com/x/log.txt?x=13822fd8e00000
kernel config: https://syzkaller.appspot.com/x/.config?x=87d111955f40591f
dashboard link: https://syzkaller.appspot.com/bug?extid=11d36ae6a74de730709b
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
CC: [Anna.Sc...@Netapp.com ca...@schaufler-ca.com
dhow...@redhat.com ja...@google.com kees...@chromium.org
kste...@linuxfoundation.org linux-...@vger.kernel.org ne...@suse.com
tg...@linutronix.de el...@google.com]

Unfortunately, I don't have any reproducer for this crash yet.

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+11d36a...@syzkaller.appspotmail.com

==================================================================
BUG: KCSAN: data-race in __alloc_file / copy_creds

write to 0xffff88809f078bd8 of 4 bytes by task 8300 on cpu 1:
get_cred include/linux/cred.h:253 [inline]
copy_creds+0x206/0x340 kernel/cred.c:345
copy_process+0x926/0x3b50 kernel/fork.c:1884
_do_fork+0xfe/0x6e0 kernel/fork.c:2366
__do_sys_clone kernel/fork.c:2521 [inline]
__se_sys_clone kernel/fork.c:2502 [inline]
__x64_sys_clone+0x12b/0x160 kernel/fork.c:2502
do_syscall_64+0xcc/0x370 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x44/0xa9

write to 0xffff88809f078bd8 of 4 bytes by task 8323 on cpu 0:
get_cred include/linux/cred.h:253 [inline]
__alloc_file+0x74/0x210 fs/file_table.c:105
alloc_empty_file+0x8f/0x180 fs/file_table.c:151
path_openat+0x74/0x36e0 fs/namei.c:3514
do_filp_open+0x11e/0x1b0 fs/namei.c:3555
do_sys_open+0x3b3/0x4f0 fs/open.c:1097
__do_sys_open fs/open.c:1115 [inline]
__se_sys_open fs/open.c:1110 [inline]
__x64_sys_open+0x55/0x70 fs/open.c:1110
do_syscall_64+0xcc/0x370 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x44/0xa9

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 8323 Comm: syz-executor.3 Not tainted 5.4.0-rc3+ #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
==================================================================
Kernel panic - not syncing: panic_on_warn set ...
CPU: 0 PID: 8323 Comm: syz-executor.3 Not tainted 5.4.0-rc3+ #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0xf5/0x159 lib/dump_stack.c:113
panic+0x210/0x640 kernel/panic.c:221
kcsan_report.cold+0xc/0x10 kernel/kcsan/report.c:302
__kcsan_setup_watchpoint+0x32e/0x4a0 kernel/kcsan/core.c:411
__tsan_write4 kernel/kcsan/kcsan.c:35 [inline]
__tsan_write4+0x32/0x40 kernel/kcsan/kcsan.c:35
get_cred include/linux/cred.h:253 [inline]
__alloc_file+0x74/0x210 fs/file_table.c:105
alloc_empty_file+0x8f/0x180 fs/file_table.c:151
path_openat+0x74/0x36e0 fs/namei.c:3514
do_filp_open+0x11e/0x1b0 fs/namei.c:3555
do_sys_open+0x3b3/0x4f0 fs/open.c:1097
__do_sys_open fs/open.c:1115 [inline]
__se_sys_open fs/open.c:1110 [inline]
__x64_sys_open+0x55/0x70 fs/open.c:1110
do_syscall_64+0xcc/0x370 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x413c91
Code: 75 14 b8 02 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 04 19 00 00 c3 48
83 ec 08 e8 0a fa ff ff 48 89 04 24 b8 02 00 00 00 0f 05 <48> 8b 3c 24 48
89 c2 e8 53 fa ff ff 48 89 d0 48 83 c4 08 48 3d 01
RSP: 002b:00007fae1f0a1a80 EFLAGS: 00000293 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 0000000020000168 RCX: 0000000000413c91
RDX: 00007fae1f0a1b0a RSI: 0000000000000002 RDI: 00007fae1f0a1b00
RBP: 0000000000000001 R08: 0000000000000000 R09: 000000000000000a
R10: 0000000000000075 R11: 0000000000000293 R12: 0000000000000003
R13: 00000000004c9567 R14: 00000000004e0c80 R15: 00000000ffffffff
Kernel Offset: disabled
Rebooting in 86400 seconds..


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Jan 17, 2020, 8:33:07 AM1/17/20
to syzkaller-upst...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages