syzbot


DATA RACE in vfs.(*Mount).setMountOptions

Status: fixed on 2023/10/25 19:22
Fix commit: ea4f0073d4a1 Fix data race between getting mount options and updating mount options.
First crash: 401d, last: 401d

Sample crash report:
WARNING: DATA RACE
Write at 0x00c00080daf0 by goroutine 11252:
  gvisor.dev/gvisor/pkg/sentry/vfs.(*Mount).setMountOptions()
      pkg/sentry/vfs/mount.go:163 +0xca
  gvisor.dev/gvisor/pkg/sentry/vfs.(*VirtualFilesystem).RemountAt()
      pkg/sentry/vfs/mount.go:536 +0x304
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux.Mount()
      pkg/sentry/syscalls/linux/sys_mount.go:101 +0xb6d
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall()
      pkg/sentry/kernel/task_syscall.go:142 +0x8b4
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke()
      pkg/sentry/kernel/task_syscall.go:322 +0x6b
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter()
      pkg/sentry/kernel/task_syscall.go:282 +0x86
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall()
      pkg/sentry/kernel/task_syscall.go:257 +0x4ef
  gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:269 +0x1e07
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:98 +0x43a
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Start.func1()
      pkg/sentry/kernel/task_start.go:391 +0x44

Previous read at 0x00c00080daf0 by goroutine 11211:
  gvisor.dev/gvisor/pkg/sentry/vfs.(*VirtualFilesystem).OpenAt()
      pkg/sentry/vfs/vfs.go:480 +0x607
  gvisor.dev/gvisor/pkg/sentry/loader.openPath()
      pkg/sentry/loader/loader.go:124 +0x1eb
  gvisor.dev/gvisor/pkg/sentry/loader.loadExecutable()
      pkg/sentry/loader/loader.go:179 +0x16f
  gvisor.dev/gvisor/pkg/sentry/loader.Load()
      pkg/sentry/loader/loader.go:250 +0xe7
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Kernel).LoadTaskImage()
      pkg/sentry/kernel/task_image.go:145 +0x209
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux.execveat()
      pkg/sentry/syscalls/linux/sys_thread.go:182 +0xe3e
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux.Execve()
      pkg/sentry/syscalls/linux/sys_thread.go:70 +0x3d
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall()
      pkg/sentry/kernel/task_syscall.go:142 +0x8b4
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke()
      pkg/sentry/kernel/task_syscall.go:322 +0x6b
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter()
      pkg/sentry/kernel/task_syscall.go:282 +0x86
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall()
      pkg/sentry/kernel/task_syscall.go:257 +0x4ef
  gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:269 +0x1e07
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:98 +0x43a
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Start.func1()
      pkg/sentry/kernel/task_start.go:391 +0x44

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/10/21 22:47 gvisor 57606c7aa115 361b23dc .config console log report syz C ci-gvisor-systrap-1-race DATA RACE in vfs.(*Mount).setMountOptions
2023/10/21 22:32 gvisor 57606c7aa115 361b23dc .config console log report syz C ci-gvisor-ptrace-3-race DATA RACE in vfs.(*Mount).setMountOptions
2023/10/21 20:33 gvisor 57606c7aa115 361b23dc .config console log report syz C ci-gvisor-ptrace-1-race DATA RACE in vfs.(*Mount).setMountOptions
2023/10/21 20:10 gvisor 57606c7aa115 361b23dc .config console log report syz C ci-gvisor-ptrace-2-race DATA RACE in vfs.(*Mount).setMountOptions
2023/10/21 19:52 gvisor 57606c7aa115 361b23dc .config console log report info ci-gvisor-ptrace-2-race DATA RACE in vfs.(*Mount).setMountOptions
* Struck through repros no longer work on HEAD.