syzbot


DATA RACE in cgroupfs.(*memsData).Write

Status: fixed on 2022/04/19 01:03
Fix commit: 5f9bd8a53b20 cgroupfs: Synchronize access to cpuset controller bitmaps.
First crash: 960d, last: 960d

Sample crash report:
WARNING: DATA RACE
Write at 0x00c00034a270 by goroutine 281:
  gvisor.dev/gvisor/pkg/sentry/fsimpl/cgroupfs.(*memsData).Write()
      pkg/sentry/fsimpl/cgroupfs/cpuset.go:170 +0x78a
  gvisor.dev/gvisor/pkg/sentry/vfs.(*DynamicBytesFileDescriptionImpl).pwriteLocked()
      pkg/sentry/vfs/file_description_impl_util.go:381 +0x2c3
  gvisor.dev/gvisor/pkg/sentry/vfs.(*DynamicBytesFileDescriptionImpl).Write()
      pkg/sentry/vfs/file_description_impl_util.go:402 +0x11c
  gvisor.dev/gvisor/pkg/sentry/fsimpl/kernfs.(*DynamicBytesFD).Write()
      pkg/sentry/fsimpl/kernfs/dynamic_bytes_file.go:125 +0x9a
  gvisor.dev/gvisor/pkg/sentry/vfs.(*FileDescription).Write()
      pkg/sentry/vfs/file_description.go:665 +0x124
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux/vfs2.write()
      pkg/sentry/syscalls/linux/vfs2/read_write.go:348 +0x9c
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux/vfs2.Write()
      pkg/sentry/syscalls/linux/vfs2/read_write.go:317 +0x2c4
  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·236()
      pkg/sentry/kernel/task_start.go:340 +0x47

Previous read at 0x00c00034a270 by goroutine 280:
  gvisor.dev/gvisor/pkg/sentry/fsimpl/cgroupfs.(*cpusetController).Clone()
      pkg/sentry/fsimpl/cgroupfs/cpuset.go:69 +0x164
  gvisor.dev/gvisor/pkg/sentry/fsimpl/cgroupfs.(*filesystem).newCgroupInode()
      pkg/sentry/fsimpl/cgroupfs/base.go:179 +0x809
  gvisor.dev/gvisor/pkg/sentry/fsimpl/cgroupfs.(*dir).NewDir.func1()
      pkg/sentry/fsimpl/cgroupfs/cgroupfs.go:460 +0xd8
  gvisor.dev/gvisor/pkg/sentry/fsimpl/kernfs.(*OrderedChildren).Inserter()
      pkg/sentry/fsimpl/kernfs/inode_impl_util.go:533 +0x121
  gvisor.dev/gvisor/pkg/sentry/fsimpl/cgroupfs.(*dir).NewDir()
      pkg/sentry/fsimpl/cgroupfs/cgroupfs.go:458 +0x131
  gvisor.dev/gvisor/pkg/sentry/fsimpl/cgroupfs.(*cgroupInode).NewDir()
      <autogenerated>:1 +0x8e
  gvisor.dev/gvisor/pkg/sentry/fsimpl/kernfs.(*Filesystem).MkdirAt()
      pkg/sentry/fsimpl/kernfs/filesystem.go:427 +0x3e1
  gvisor.dev/gvisor/pkg/sentry/fsimpl/cgroupfs.(*filesystem).MkdirAt()
      <autogenerated>:1 +0x76
  gvisor.dev/gvisor/pkg/sentry/vfs.(*VirtualFilesystem).MkdirAt()
      pkg/sentry/vfs/vfs.go:327 +0x27a
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux/vfs2.mkdirat()
      pkg/sentry/syscalls/linux/vfs2/filesystem.go:99 +0x275
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux/vfs2.Mkdir()
      pkg/sentry/syscalls/linux/vfs2/filesystem.go:78 +0x3d
  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·236()
      pkg/sentry/kernel/task_start.go:340 +0x47

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/04/10 19:07 gvisor 370672e9897b e22c3da3 .config console log report syz C ci-gvisor-ptrace-2-race DATA RACE in cgroupfs.(*memsData).Write
2022/04/10 19:03 gvisor 370672e9897b e22c3da3 .config console log report syz C ci-gvisor-ptrace-1-race DATA RACE in cgroupfs.(*memsData).Write
2022/04/10 18:45 gvisor 370672e9897b e22c3da3 .config console log report syz C ci-gvisor-ptrace-3-race DATA RACE in cgroupfs.(*memsData).Write
2022/04/10 18:31 gvisor 370672e9897b e22c3da3 .config console log report info ci-gvisor-ptrace-3-race DATA RACE in cgroupfs.(*memsData).Write
* Struck through repros no longer work on HEAD.