syzbot


DATA RACE in bitmap.(*Bitmap).Maximum

Status: fixed on 2022/03/11 00:26
Fix commit: 4503ba3f5efd Fix data race when using UNSHARE in close_range.
First crash: 1000d, last: 991d

Sample crash report:
WARNING: DATA RACE
Read at 0x00c0001bc010 by goroutine 326:
  gvisor.dev/gvisor/pkg/bitmap.(*Bitmap).Maximum()
      pkg/bitmap/bitmap.go:111 +0x2f9
  gvisor.dev/gvisor/pkg/sentry/kernel.(*FDTable).GetLastFd()
      pkg/sentry/kernel/fd_table.go:763 +0xc4
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux/vfs2.CloseRange()
      pkg/sentry/syscalls/linux/vfs2/fd.go:71 +0x92
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall()
      pkg/sentry/kernel/task_syscall.go:103 +0x4db
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke()
      pkg/sentry/kernel/task_syscall.go:238 +0x69
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter()
      pkg/sentry/kernel/task_syscall.go:198 +0x8e
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall()
      pkg/sentry/kernel/task_syscall.go:173 +0x3c4
  gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:254 +0x1697
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:95 +0x35a
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Start·dwrap·235()
      pkg/sentry/kernel/task_start.go:339 +0x47

Previous write at 0x00c0001bc010 by goroutine 328:
  gvisor.dev/gvisor/pkg/bitmap.(*Bitmap).Add()
      pkg/bitmap/bitmap.go:129 +0x54b
  gvisor.dev/gvisor/pkg/sentry/kernel.(*FDTable).NewFDsVFS2()
      pkg/sentry/kernel/fd_table.go:395 +0x330
  gvisor.dev/gvisor/pkg/sentry/kernel.(*FDTable).NewFDVFS2()
      pkg/sentry/kernel/fd_table.go:426 +0x8f
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).NewFDFromVFS2()
      pkg/sentry/kernel/task.go:793 +0x1b7
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux/vfs2.Socket()
      pkg/sentry/syscalls/linux/vfs2/socket.go:194 +0x171
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall()
      pkg/sentry/kernel/task_syscall.go:103 +0x4db
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke()
      pkg/sentry/kernel/task_syscall.go:238 +0x69
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter()
      pkg/sentry/kernel/task_syscall.go:198 +0x8e
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall()
      pkg/sentry/kernel/task_syscall.go:173 +0x3c4
  gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:254 +0x1697
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:95 +0x35a
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Start·dwrap·235()
      pkg/sentry/kernel/task_start.go:339 +0x47

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/03/02 07:34 gvisor 53385a9dc7f3 45a13a73 .config console log report syz C ci-gvisor-ptrace-2-race DATA RACE in bitmap.(*Bitmap).Maximum
2022/03/02 07:06 gvisor 53385a9dc7f3 45a13a73 .config console log report syz C ci-gvisor-ptrace-1-race DATA RACE in bitmap.(*Bitmap).Maximum
2022/03/10 16:42 gvisor 1fcaa119a53a 9e8eaa75 .config console log report info ci-gvisor-ptrace-3-race DATA RACE in bitmap.(*Bitmap).Maximum
2022/03/08 21:56 gvisor bbf4a590868e 9e8eaa75 .config console log report info ci-gvisor-ptrace-2-race DATA RACE in bitmap.(*Bitmap).Maximum
2022/03/07 11:37 gvisor e3f424c5c51c 7bdd8b2c .config console log report info ci-gvisor-ptrace-3-race DATA RACE in bitmap.(*Bitmap).Maximum
2022/03/04 22:41 gvisor c8b0aadfa9c3 45a13a73 .config console log report info ci-gvisor-ptrace-2-race DATA RACE in bitmap.(*Bitmap).Maximum
2022/03/03 04:13 gvisor 17b93a84fae9 45a13a73 .config console log report info ci-gvisor-ptrace-3-race DATA RACE in bitmap.(*Bitmap).Maximum
2022/03/02 06:49 gvisor 53385a9dc7f3 45a13a73 .config console log report info ci-gvisor-ptrace-1-race DATA RACE in bitmap.(*Bitmap).Maximum
* Struck through repros no longer work on HEAD.