syzbot


DATA RACE in vfs.(*VirtualFilesystem).GenerateProcMountInfo

Status: fixed on 2022/11/01 08:39
Fix commit: 20ef2127a102 Lock around optional tag generation.
First crash: 759d, last: 757d

Sample crash report:
WARNING: DATA RACE
Read at 0x00c000a1ced0 by goroutine 333:
  gvisor.dev/gvisor/pkg/sentry/vfs.(*VirtualFilesystem).GenerateProcMountInfo()
      pkg/sentry/vfs/mount.go:1388 +0xa97
  gvisor.dev/gvisor/pkg/sentry/fsimpl/proc.(*mountInfoData).Generate()
      pkg/sentry/fsimpl/proc/task_files.go:1125 +0x228
  gvisor.dev/gvisor/pkg/sentry/vfs.(*DynamicBytesFileDescriptionImpl).preadLocked()
      pkg/sentry/vfs/file_description_impl_util.go:311 +0x154
  gvisor.dev/gvisor/pkg/sentry/vfs.(*DynamicBytesFileDescriptionImpl).PRead()
      pkg/sentry/vfs/file_description_impl_util.go:330 +0xcf
  gvisor.dev/gvisor/pkg/sentry/fsimpl/kernfs.(*DynamicBytesFD).PRead()
      pkg/sentry/fsimpl/kernfs/dynamic_bytes_file.go:127 +0xae
  gvisor.dev/gvisor/pkg/sentry/vfs.(*FileDescription).PRead()
      pkg/sentry/vfs/file_description.go:628 +0x189
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux/vfs2.pread()
      pkg/sentry/syscalls/linux/vfs2/read_write.go:251 +0xac
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux/vfs2.Preadv()
      pkg/sentry/syscalls/linux/vfs2/read_write.go:199 +0x2cf
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall()
      pkg/sentry/kernel/task_syscall.go:142 +0x9b7
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke()
      pkg/sentry/kernel/task_syscall.go:322 +0x7c
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter()
      pkg/sentry/kernel/task_syscall.go:282 +0x8e
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall()
      pkg/sentry/kernel/task_syscall.go:257 +0x495
  gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:253 +0x18f8
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:94 +0x353
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Start.func1()
      pkg/sentry/kernel/task_start.go:380 +0x47

Previous write at 0x00c000a1ced0 by goroutine 273:
  gvisor.dev/gvisor/pkg/sentry/vfs.(*VirtualFilesystem).setPropagation()
      pkg/sentry/vfs/mount.go:232 +0x357
  gvisor.dev/gvisor/pkg/sentry/vfs.(*VirtualFilesystem).umountRecursiveLocked()
      pkg/sentry/vfs/mount.go:760 +0x390
  gvisor.dev/gvisor/pkg/sentry/vfs.(*VirtualFilesystem).umountAtRecursiveLocked()
      pkg/sentry/vfs/mount.go:693 +0xdd
  gvisor.dev/gvisor/pkg/sentry/vfs.(*VirtualFilesystem).UmountAt()
      pkg/sentry/vfs/mount.go:666 +0x6fb
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux/vfs2.Umount2()
      pkg/sentry/syscalls/linux/vfs2/mount.go:171 +0x3d9
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall()
      pkg/sentry/kernel/task_syscall.go:142 +0x9b7
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke()
      pkg/sentry/kernel/task_syscall.go:322 +0x7c
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter()
      pkg/sentry/kernel/task_syscall.go:282 +0x8e
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall()
      pkg/sentry/kernel/task_syscall.go:257 +0x495
  gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:253 +0x18f8
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:94 +0x353
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Start.func1()
      pkg/sentry/kernel/task_start.go:380 +0x47

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/10/29 01:51 gvisor 6b3b5493d0ea bc17b3a4 .config console log report syz C ci-gvisor-ptrace-1-race DATA RACE in vfs.(*VirtualFilesystem).GenerateProcMountInfo
2022/10/30 22:23 gvisor 6b3b5493d0ea 2a71366b .config console log report info ci-gvisor-ptrace-2-race DATA RACE in vfs.(*VirtualFilesystem).GenerateProcMountInfo
* Struck through repros no longer work on HEAD.