syzbot


KCSAN: data-race in free_pid / zap_pid_ns_processes (7)

Status: moderation: reported on 2025/03/08 17:45
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+adcaa842b762a1762e7d@syzkaller.appspotmail.com
First crash: 48d, last: 11d
Discussions (2)
Title Replies (including bot) Last reply
[PATCH v2] pid: annotate data-races around pid_ns->pid_allocated 3 (3) 2025/04/25 10:07
[PATCH v1] pid: annotate data-races around pid_ns->pid_allocated 7 (7) 2025/04/25 05:37
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in free_pid / zap_pid_ns_processes (2) kernel 2 1545d 1559d 0/28 auto-closed as invalid on 2021/03/08 05:19
upstream KCSAN: data-race in free_pid / zap_pid_ns_processes (6) kernel 7 224d 305d 0/28 auto-obsoleted due to no activity on 2024/10/19 00:02
upstream KCSAN: data-race in free_pid / zap_pid_ns_processes (4) kernel 2 1411d 1425d 0/28 auto-closed as invalid on 2021/07/19 14:02
upstream KCSAN: data-race in free_pid / zap_pid_ns_processes (5) kernel 1 381d 381d 0/28 auto-obsoleted due to no activity on 2024/05/15 08:15
upstream KCSAN: data-race in free_pid / zap_pid_ns_processes (3) kernel 2 1471d 1488d 0/28 auto-closed as invalid on 2021/05/20 16:55
upstream KCSAN: data-race in free_pid / zap_pid_ns_processes kernel 12 1904d 2009d 0/28 auto-closed as invalid on 2020/04/18 12:14

Sample crash report:
==================================================================
BUG: KCSAN: data-race in free_pid / zap_pid_ns_processes

read-write to 0xffff88811613a148 of 4 bytes by task 4822 on cpu 0:
 free_pid+0x7e/0x180 kernel/pid.c:125
 free_pids+0x7a/0xb0 kernel/pid.c:158
 release_task+0xa32/0xba0 kernel/exit.c:289
 exit_notify kernel/exit.c:790 [inline]
 do_exit+0xef8/0x17e0 kernel/exit.c:973
 do_group_exit+0x102/0x150 kernel/exit.c:1102
 get_signal+0xf35/0x1080 kernel/signal.c:3034
 arch_do_signal_or_restart+0x9a/0x4b0 arch/x86/kernel/signal.c:337
 exit_to_user_mode_loop kernel/entry/common.c:111 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
 syscall_exit_to_user_mode+0x62/0x120 kernel/entry/common.c:218
 do_syscall_64+0xd6/0x1c0 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff88811613a148 of 4 bytes by task 3312 on cpu 1:
 zap_pid_ns_processes+0x1f9/0x2d0 kernel/pid_namespace.c:271
 find_child_reaper kernel/exit.c:630 [inline]
 forget_original_parent kernel/exit.c:719 [inline]
 exit_notify kernel/exit.c:756 [inline]
 do_exit+0x1533/0x17e0 kernel/exit.c:973
 do_group_exit+0x102/0x150 kernel/exit.c:1102
 get_signal+0xf35/0x1080 kernel/signal.c:3034
 arch_do_signal_or_restart+0x9a/0x4b0 arch/x86/kernel/signal.c:337
 exit_to_user_mode_loop kernel/entry/common.c:111 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
 syscall_exit_to_user_mode+0x62/0x120 kernel/entry/common.c:218
 do_syscall_64+0xd6/0x1c0 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x00000002 -> 0x00000001

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 3312 Comm: syz-executor Not tainted 6.15.0-rc2-syzkaller #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/04/14 21:00 upstream 8ffd015db85f 0bd6db41 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in free_pid / zap_pid_ns_processes
2025/04/07 17:13 upstream 0af2f6be1b42 a2ada0e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in free_pid / zap_pid_ns_processes
2025/03/08 17:44 upstream 2a520073e74f 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in free_pid / zap_pid_ns_processes
* Struck through repros no longer work on HEAD.