syzbot


DATA RACE in kernel.(*ThreadGroup).endGroupStopLocked

Status: fixed on 2025/03/31 22:12
Fix commit: 8221e477b5c4 Protect Task.ptraceSeized with TaskSet mutex and Signal mutex.
First crash: 158d, last: 157d

Sample crash report:
WARNING: DATA RACE
Read at 0x00c001871c28 by goroutine 2198:
  gvisor.dev/gvisor/pkg/sentry/kernel.(*ThreadGroup).endGroupStopLocked()
      pkg/sentry/kernel/task_signals.go:829 +0x333
  gvisor.dev/gvisor/pkg/sentry/kernel.(*ThreadGroup).applySignalSideEffectsLocked()
      pkg/sentry/kernel/task_signals.go:497 +0x169
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).sendSignalTimerLocked()
      pkg/sentry/kernel/task_signals.go:419 +0x124
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).sendSignalLocked()
      pkg/sentry/kernel/task_signals.go:402 +0x4c
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).SendSignal()
      pkg/sentry/kernel/task_signals.go:380 +0xd3
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux.Tgkill()
      pkg/sentry/syscalls/linux/sys_signal.go:241 +0x238
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall()
      pkg/sentry/kernel/task_syscall.go:143 +0xb9e
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke()
      pkg/sentry/kernel/task_syscall.go:323 +0x84
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter()
      pkg/sentry/kernel/task_syscall.go:283 +0xc6
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall()
      pkg/sentry/kernel/task_syscall.go:258 +0x549
  gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:269 +0x2294
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:97 +0x41a
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Start.gowrap1()
      pkg/sentry/kernel/task_start.go:412 +0x44

Previous write at 0x00c001871c28 by goroutine 2207:
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).ptraceAttach()
      pkg/sentry/kernel/ptrace.go:528 +0x304
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Ptrace()
      pkg/sentry/kernel/ptrace.go:1023 +0x206
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux.Ptrace()
      pkg/sentry/syscalls/linux/sys_thread.go:789 +0xc5
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall()
      pkg/sentry/kernel/task_syscall.go:143 +0xb9e
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke()
      pkg/sentry/kernel/task_syscall.go:323 +0x84
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter()
      pkg/sentry/kernel/task_syscall.go:283 +0xc6
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall()
      pkg/sentry/kernel/task_syscall.go:258 +0x549
  gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:269 +0x2294
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:97 +0x41a
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Start.gowrap1()
      pkg/sentry/kernel/task_start.go:412 +0x44

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/03/26 21:34 gvisor b5f9bed90840 19e40f48 .config console log report syz / log ci-gvisor-systrap-1-race-cover DATA RACE in kernel.(*ThreadGroup).endGroupStopLocked
2025/03/26 21:19 gvisor b5f9bed90840 19e40f48 .config console log report syz / log ci-gvisor-ptrace-2-race-cover DATA RACE in kernel.(*ThreadGroup).endGroupStopLocked
2025/03/26 17:12 gvisor b5f9bed90840 19e40f48 .config console log report syz / log ci-gvisor-ptrace-2-race DATA RACE in kernel.(*ThreadGroup).endGroupStopLocked
2025/03/26 17:09 gvisor b5f9bed90840 19e40f48 .config console log report syz / log ci-gvisor-systrap-1-race DATA RACE in kernel.(*ThreadGroup).endGroupStopLocked
2025/03/26 17:07 gvisor b5f9bed90840 19e40f48 .config console log report syz / log ci-gvisor-ptrace-1-race DATA RACE in kernel.(*ThreadGroup).endGroupStopLocked
2025/03/26 04:41 gvisor 35686886763c 89d30d73 .config console log report info ci-gvisor-ptrace-1-race-cover DATA RACE in kernel.(*ThreadGroup).endGroupStopLocked
* Struck through repros no longer work on HEAD.