syzbot


DATA RACE in fs.(*Dirent).hashChildParentSet

Status: fixed on 2018/10/15 18:23
Fix commit: 8d318aac5532 fs: Hold Dirent.mu when calling Dirent.flush().
First crash: 2289d, last: 2286d

Sample crash report:
WARNING: DATA RACE
Write at 0x00c4201ee840 by goroutine 301:
  runtime.mapassign_faststr()
      GOROOT/src/runtime/hashmap_fast.go:694 +0x0
  gvisor.googlesource.com/gvisor/pkg/sentry/fs.(*Dirent).hashChildParentSet()
      pkg/sentry/fs/dirent.go:301 +0x176
  gvisor.googlesource.com/gvisor/pkg/sentry/fs.(*Dirent).hashChild()
      pkg/sentry/fs/dirent.go:286 +0xda
  gvisor.googlesource.com/gvisor/pkg/sentry/fs.(*Dirent).walk()
      pkg/sentry/fs/dirent.go:592 +0x537
  gvisor.googlesource.com/gvisor/pkg/sentry/fs.(*Dirent).Walk()
      pkg/sentry/fs/dirent.go:617 +0xd5
  gvisor.googlesource.com/gvisor/pkg/sentry/fs.(*MountNamespace).FindLink()
      pkg/sentry/fs/mounts.go:401 +0x202
  gvisor.googlesource.com/gvisor/pkg/sentry/fs.(*MountNamespace).FindInode()
      pkg/sentry/fs/mounts.go:439 +0x93
  gvisor.googlesource.com/gvisor/pkg/sentry/syscalls/linux.mkdirAt.func1()
      pkg/sentry/syscalls/linux/sys_file.go:995 +0x1a2
  gvisor.googlesource.com/gvisor/pkg/sentry/syscalls/linux.fileOpAt.func1()
      pkg/sentry/syscalls/linux/sys_file.go:58 +0x66
  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.fileOpAt()
      pkg/sentry/syscalls/linux/sys_file.go:57 +0x17e
  gvisor.googlesource.com/gvisor/pkg/sentry/syscalls/linux.mkdirAt()
      pkg/sentry/syscalls/linux/sys_file.go:989 +0x162
  gvisor.googlesource.com/gvisor/pkg/sentry/syscalls/linux.Mkdir()
      pkg/sentry/syscalls/linux/sys_file.go:1022 +0x58
  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:280 +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 +0x19e
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:219 +0x1501
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:95 +0x264

Previous read at 0x00c4201ee840 by goroutine 277:
  runtime.mapiterinit()
      GOROOT/src/runtime/hashmap.go:691 +0x0
  gvisor.googlesource.com/gvisor/pkg/sentry/fs.(*Dirent).flush()
      pkg/sentry/fs/dirent.go:1018 +0x12d
  gvisor.googlesource.com/gvisor/pkg/sentry/fs.Rename()
      pkg/sentry/fs/dirent.go:1589 +0xc24
  gvisor.googlesource.com/gvisor/pkg/sentry/syscalls/linux.renameAt.func1.1()
      pkg/sentry/syscalls/linux/sys_file.go:1831 +0x18d
  gvisor.googlesource.com/gvisor/pkg/sentry/syscalls/linux.fileOpAt.func1()
      pkg/sentry/syscalls/linux/sys_file.go:58 +0x66
  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.fileOpAt()
      pkg/sentry/syscalls/linux/sys_file.go:57 +0x17e
  gvisor.googlesource.com/gvisor/pkg/sentry/syscalls/linux.renameAt.func1()
      pkg/sentry/syscalls/linux/sys_file.go:1820 +0x20a
  gvisor.googlesource.com/gvisor/pkg/sentry/syscalls/linux.fileOpAt.func1()
      pkg/sentry/syscalls/linux/sys_file.go:58 +0x66
  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.fileOpAt()
      pkg/sentry/syscalls/linux/sys_file.go:57 +0x17e
  gvisor.googlesource.com/gvisor/pkg/sentry/syscalls/linux.renameAt()
      pkg/sentry/syscalls/linux/sys_file.go:1805 +0x1ef
  gvisor.googlesource.com/gvisor/pkg/sentry/syscalls/linux.Rename()
      pkg/sentry/syscalls/linux/sys_file.go:1840 +0x60
  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:280 +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 +0x19e
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:219 +0x1501
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:95 +0x264

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/08/22 07:56 https://github.com/dvyukov/gvisor.git race d4d5ed1d9def 95b5c82b .config console log report syz ci-gvisor-ptrace-proxy-sandbox-race
2018/08/22 07:49 https://github.com/dvyukov/gvisor.git race d4d5ed1d9def 95b5c82b .config console log report syz ci-gvisor-kvm-direct-overlay-host-race
2018/08/21 12:41 https://github.com/dvyukov/gvisor.git race d4d5ed1d9def 95b5c82b .config console log report syz ci-gvisor-ptrace-proxy-sandbox-race
2018/08/21 12:16 https://github.com/dvyukov/gvisor.git race d4d5ed1d9def 95b5c82b .config console log report syz ci-gvisor-kvm-direct-overlay-host-race
2018/08/24 08:26 https://github.com/dvyukov/gvisor.git race d4d5ed1d9def 95b5c82b .config console log report ci-gvisor-kvm-direct-overlay-host-race
2018/08/24 00:01 https://github.com/dvyukov/gvisor.git race d4d5ed1d9def 95b5c82b .config console log report ci-gvisor-kvm-direct-overlay-host-race
2018/08/22 07:22 https://github.com/dvyukov/gvisor.git race d4d5ed1d9def 95b5c82b .config console log report ci-gvisor-kvm-direct-overlay-host-race
2018/08/21 11:48 https://github.com/dvyukov/gvisor.git race d4d5ed1d9def 95b5c82b .config console log report ci-gvisor-kvm-direct-overlay-host-race
* Struck through repros no longer work on HEAD.