syzbot


KCSAN: data-race in lookup_user_key / prepare_creds

Status: moderation: reported on 2025/04/27 14:25
Subsystems: keyrings lsm
[Documentation on labels]
Reported-by: syzbot+6d08dc40c9fea86cb03a@syzkaller.appspotmail.com
First crash: 6d19h, last: 6d19h

Sample crash report:
==================================================================
BUG: KCSAN: data-race in lookup_user_key / prepare_creds

write to 0xffff88811a5763a8 of 4 bytes by task 3982 on cpu 1:
 get_cred_many include/linux/cred.h:202 [inline]
 get_cred include/linux/cred.h:218 [inline]
 lookup_user_key+0xb6/0xd10 security/keys/process_keys.c:626
 keyctl_invalidate_key+0x1f/0x120 security/keys/keyctl.c:428
 __do_sys_keyctl security/keys/keyctl.c:1972 [inline]
 __se_sys_keyctl+0x2a6/0xb80 security/keys/keyctl.c:1874
 __x64_sys_keyctl+0x67/0x80 security/keys/keyctl.c:1874
 x64_sys_call+0x2e7f/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:251
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd0/0x1a0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff88811a576300 of 184 bytes by task 3981 on cpu 0:
 prepare_creds+0x6c/0x4c0 kernel/cred.c:219
 __do_sys_capset kernel/capability.c:247 [inline]
 __se_sys_capset+0x2a3/0x450 kernel/capability.c:216
 __x64_sys_capset+0x31/0x40 kernel/capability.c:216
 x64_sys_call+0x1426/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:127
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd0/0x1a0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 3981 Comm: syz.3.164 Not tainted 6.15.0-rc3-syzkaller-00342-g5bc1018675ec #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/04/27 14:24 upstream 5bc1018675ec c6b4fb39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in lookup_user_key / prepare_creds
* Struck through repros no longer work on HEAD.