syzbot


KCSAN: data-race in selinux_cred_prepare / selinux_inode_permission

Status: moderation: reported on 2025/06/26 17:33
Subsystems: selinux
[Documentation on labels]
Reported-by: syzbot+1bda53d1be2c7e599411@syzkaller.appspotmail.com
First crash: 56d, last: 4d08h

Sample crash report:
==================================================================
BUG: KCSAN: data-race in selinux_cred_prepare / selinux_inode_permission

write to 0xffff88811a5a50a0 of 4 bytes by task 5817 on cpu 0:
 task_avdcache_search security/selinux/hooks.c:3146 [inline]
 selinux_inode_permission+0x3ac/0x740 security/selinux/hooks.c:3221
 security_inode_permission+0x6d/0xb0 security/security.c:2324
 inode_permission+0x106/0x310 fs/namei.c:601
 may_lookup fs/namei.c:1836 [inline]
 link_path_walk+0x162/0x900 fs/namei.c:2445
 path_openat+0x1de/0x2170 fs/namei.c:4042
 do_filp_open+0x109/0x230 fs/namei.c:4073
 do_sys_openat2+0xa6/0x110 fs/open.c:1435
 do_sys_open fs/open.c:1450 [inline]
 __do_sys_openat fs/open.c:1466 [inline]
 __se_sys_openat fs/open.c:1461 [inline]
 __x64_sys_openat+0xf2/0x120 fs/open.c:1461
 x64_sys_call+0x2e9c/0x2ff0 arch/x86/include/generated/asm/syscalls_64.h:258
 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 0xffff88811a5a5080 of 104 bytes by task 5815 on cpu 1:
 selinux_cred_prepare+0x60/0x70 security/selinux/hooks.c:4163
 security_prepare_creds+0xbb/0x120 security/security.c:3276
 prepare_creds+0x34a/0x4c0 kernel/cred.c:242
 prepare_exec_creds+0x14/0xe0 kernel/cred.c:261
 prepare_bprm_creds fs/exec.c:1364 [inline]
 bprm_execve+0x70/0x970 fs/exec.c:1734
 do_execveat_common+0x6e6/0x750 fs/exec.c:1860
 do_execveat fs/exec.c:1945 [inline]
 __do_sys_execveat fs/exec.c:2019 [inline]
 __se_sys_execveat fs/exec.c:2013 [inline]
 __x64_sys_execveat+0x73/0x90 fs/exec.c:2013
 x64_sys_call+0x1fec/0x2ff0 arch/x86/include/generated/asm/syscalls_64.h:323
 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: 1 UID: 0 PID: 5815 Comm: syz.4.777 Not tainted 6.17.0-rc1-syzkaller-00214-g99bade344cfa #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/08/17 14:44 upstream 99bade344cfa 1804e95e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in selinux_cred_prepare / selinux_inode_permission
2025/07/30 13:18 upstream 4b290aae788e f8f2b4da .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in selinux_cred_prepare / selinux_inode_permission
2025/06/26 17:32 upstream ee88bddf7f2f 803ce19b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in selinux_cred_prepare / selinux_inode_permission
* Struck through repros no longer work on HEAD.