syzbot


DATA RACE in fs.(*Watch).Notify

Status: fixed on 2018/07/04 09:14
Fix commit: 34af9a61741f Fix data race on inotify.Watch.mask.
First crash: 2339d, last: 2338d

Sample crash report:
WARNING: DATA RACE
Read at 0x00c420573e0c by goroutine 205:
  gvisor.googlesource.com/gvisor/pkg/sentry/fs.(*Watch).Notify()
      pkg/sentry/fs/inotify_watch.go:76 +0x40
  gvisor.googlesource.com/gvisor/pkg/sentry/fs.(*Watches).Notify()
      pkg/sentry/fs/inode_inotify.go:129 +0x142
  gvisor.googlesource.com/gvisor/pkg/sentry/fs.(*Dirent).InotifyEvent()
      pkg/sentry/fs/dirent.go:1345 +0x1f5
  gvisor.googlesource.com/gvisor/pkg/sentry/syscalls/linux.writev()
      pkg/sentry/syscalls/linux/sys_write.go:195 +0x16c
  gvisor.googlesource.com/gvisor/pkg/sentry/syscalls/linux.Write()
      pkg/sentry/syscalls/linux/sys_write.go:67 +0x295
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).executeSyscall()
      pkg/sentry/kernel/task_syscall.go:162 +0x14e
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke()
      pkg/sentry/kernel/task_syscall.go:278 +0x7d
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter()
      pkg/sentry/kernel/task_syscall.go:241 +0xc3
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).doSyscall()
      pkg/sentry/kernel/task_syscall.go:216 +0x19c
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:217 +0x157c
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:95 +0x264

Previous write at 0x00c420573e0c by goroutine 244:
  gvisor.googlesource.com/gvisor/pkg/sentry/fs.(*Inotify).AddWatch()
      pkg/sentry/fs/inotify.go:287 +0x18e
  gvisor.googlesource.com/gvisor/pkg/sentry/syscalls/linux.InotifyAddWatch.func1()
      pkg/sentry/syscalls/linux/sys_inotify.go:117 +0x68
  gvisor.googlesource.com/gvisor/pkg/sentry/syscalls/linux.fileOpOn()
      pkg/sentry/syscalls/linux/sys_file.go:111 +0x235
  gvisor.googlesource.com/gvisor/pkg/sentry/syscalls/linux.InotifyAddWatch()
      pkg/sentry/syscalls/linux/sys_inotify.go:110 +0x24b
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).executeSyscall()
      pkg/sentry/kernel/task_syscall.go:162 +0x14e
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke()
      pkg/sentry/kernel/task_syscall.go:278 +0x7d
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter()
      pkg/sentry/kernel/task_syscall.go:241 +0xc3
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).doSyscall()
      pkg/sentry/kernel/task_syscall.go:216 +0x19c
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:217 +0x157c
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:95 +0x264

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/07/02 15:41 https://github.com/dvyukov/gvisor.git race 082553a8233a b9f93868 .config console log report syz ci-gvisor-ptrace-proxy-sandbox-race
2018/07/02 15:21 https://github.com/dvyukov/gvisor.git race 082553a8233a b9f93868 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
* Struck through repros no longer work on HEAD.