syzbot


KCSAN: data-race in init_file / prepare_creds

Status: moderation: reported on 2025/05/30 02:49
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+f10040a9f8081a725699@syzkaller.appspotmail.com
First crash: 3d00h, last: 3d00h

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

write to 0xffff888100967528 of 4 bytes by task 26120 on cpu 1:
 get_cred_many include/linux/cred.h:202 [inline]
 get_cred include/linux/cred.h:218 [inline]
 init_file+0x2e/0x1d0 fs/file_table.c:155
 alloc_empty_file+0x8b/0x200 fs/file_table.c:238
 alloc_file fs/file_table.c:351 [inline]
 alloc_file_pseudo+0xc6/0x160 fs/file_table.c:380
 sock_alloc_file+0x9c/0x1e0 net/socket.c:470
 sock_map_fd net/socket.c:500 [inline]
 __sys_socket+0x116/0x180 net/socket.c:1692
 __do_sys_socket net/socket.c:1697 [inline]
 __se_sys_socket net/socket.c:1695 [inline]
 __x64_sys_socket+0x3f/0x50 net/socket.c:1695
 x64_sys_call+0x285a/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:42
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd2/0x200 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff888100967480 of 184 bytes by task 26123 on cpu 0:
 prepare_creds+0x6c/0x4c0 kernel/cred.c:219
 install_process_keyring security/keys/process_keys.c:296 [inline]
 lookup_user_key+0x1fa/0xd10 security/keys/process_keys.c:653
 __do_sys_add_key security/keys/keyctl.c:126 [inline]
 __se_sys_add_key+0x263/0x350 security/keys/keyctl.c:74
 __x64_sys_add_key+0x67/0x80 security/keys/keyctl.c:74
 x64_sys_call+0x1d0d/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:249
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd2/0x200 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: 26123 Comm: syz.4.6648 Tainted: G        W           6.15.0-syzkaller-08297-ge0797d3b91de #0 PREEMPT(voluntary) 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/30 02:49 upstream e0797d3b91de 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in init_file / prepare_creds
* Struck through repros no longer work on HEAD.