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: 99d, last: 4d01h
Discussions (2)
Title Replies (including bot) Last reply
[PATCH v2] pid: annotate data-races around pid_ns->pid_allocated 4 (4) 2025/04/28 08:30
[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 1596d 1610d 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 275d 356d 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 1463d 1476d 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 432d 432d 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 1522d 1539d 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 1955d 2060d 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 0xffff88811525c268 of 4 bytes by task 3831 on cpu 1:
 free_pid+0x77/0x180 kernel/pid.c:126
 free_pids+0x54/0xb0 kernel/pid.c:159
 release_task+0x9a9/0xb60 kernel/exit.c:295
 exit_notify kernel/exit.c:782 [inline]
 do_exit+0xd85/0x1590 kernel/exit.c:975
 do_group_exit+0xff/0x140 kernel/exit.c:1104
 get_signal+0xe59/0xf70 kernel/signal.c:3034
 arch_do_signal_or_restart+0x96/0x480 arch/x86/kernel/signal.c:337
 exit_to_user_mode_loop+0x7a/0x100 kernel/entry/common.c:111
 exit_to_user_mode_prepare include/linux/entry-common.h:330 [inline]
 syscall_exit_to_user_mode_work include/linux/entry-common.h:414 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:449 [inline]
 do_syscall_64+0x1d6/0x200 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff88811525c268 of 4 bytes by task 3312 on cpu 0:
 zap_pid_ns_processes+0x1ff/0x2d0 kernel/pid_namespace.c:271
 find_child_reaper kernel/exit.c:622 [inline]
 forget_original_parent kernel/exit.c:711 [inline]
 exit_notify kernel/exit.c:748 [inline]
 do_exit+0x13e0/0x1590 kernel/exit.c:975
 do_group_exit+0xff/0x140 kernel/exit.c:1104
 get_signal+0xe59/0xf70 kernel/signal.c:3034
 arch_do_signal_or_restart+0x96/0x480 arch/x86/kernel/signal.c:337
 exit_to_user_mode_loop+0x7a/0x100 kernel/entry/common.c:111
 exit_to_user_mode_prepare include/linux/entry-common.h:330 [inline]
 syscall_exit_to_user_mode_work include/linux/entry-common.h:414 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:449 [inline]
 do_syscall_64+0x1d6/0x200 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: 0 UID: 0 PID: 3312 Comm: syz-executor Not tainted 6.16.0-rc1-syzkaller-00010-g2c4a1f3fe03e #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
==================================================================

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/06/12 15:05 upstream 2c4a1f3fe03e 98683f8f .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/06/03 21:37 upstream 546b1c9e93c2 a30356b7 .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/05/28 11:05 upstream feacb1774bd5 874a1386 .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/05/09 11:35 upstream 2c89c1b655c0 bb813bcc .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/05/08 20:33 upstream 2c89c1b655c0 dbf35fa1 .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/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.