syzbot


DATA RACE in fs.(*lockedReader).Read

Status: fixed on 2019/06/26 21:55
Reported-by: syzbot+d0282d6d901f96a4a4fb@syzkaller.appspotmail.com
Fix commit: 8ab0848c70fc gvisor/fs: don't update file.offset for sockets, pipes, etc
First crash: 1998d, last: 1998d

Sample crash report:
WARNING: DATA RACE
Read at 0x00c00125e980 by goroutine 559:
  gvisor.googlesource.com/gvisor/pkg/sentry/fs.(*lockedReader).Read()
      pkg/sentry/fs/file.go:522 +0x283
  io.(*LimitedReader).Read()
      GOROOT/src/io/io.go:448 +0xc7
  io.copyBuffer()
      GOROOT/src/io/io.go:402 +0x143
  gvisor.googlesource.com/gvisor/pkg/sentry/fs.Splice()
      GOROOT/src/io/io.go:364 +0x60f
  gvisor.googlesource.com/gvisor/pkg/sentry/syscalls/linux.doSplice()
      pkg/sentry/syscalls/linux/sys_splice.go:38 +0x13c
  gvisor.googlesource.com/gvisor/pkg/sentry/syscalls/linux.Splice()
      pkg/sentry/syscalls/linux/sys_splice.go:241 +0x481
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).executeSyscall()
      pkg/sentry/kernel/task_syscall.go:165 +0x407
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke()
      pkg/sentry/kernel/task_syscall.go:283 +0xb4
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter()
      pkg/sentry/kernel/task_syscall.go:244 +0x109
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).doSyscall()
      pkg/sentry/kernel/task_syscall.go:219 +0x1b6
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:219 +0x1523
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:91 +0x2e5

Previous write at 0x00c00125e980 by goroutine 623:
  sync/atomic.StoreInt64()
      bazel-out/k8-fastbuild/bin/external/io_bazel_rules_go/linux_amd64_static_race_stripped/stdlib%/src/runtime/race_amd64.s:234 +0xb
  gvisor.googlesource.com/gvisor/pkg/sentry/fs.(*File).Writev()
      pkg/sentry/fs/file.go:334 +0x325
  gvisor.googlesource.com/gvisor/pkg/sentry/syscalls/linux.writev()
      pkg/sentry/syscalls/linux/sys_write.go:295 +0x5c8
  gvisor.googlesource.com/gvisor/pkg/sentry/syscalls/linux.Write()
      pkg/sentry/syscalls/linux/sys_write.go:71 +0x293
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).executeSyscall()
      pkg/sentry/kernel/task_syscall.go:165 +0x407
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke()
      pkg/sentry/kernel/task_syscall.go:283 +0xb4
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter()
      pkg/sentry/kernel/task_syscall.go:244 +0x109
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).doSyscall()
      pkg/sentry/kernel/task_syscall.go:219 +0x1b6
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:219 +0x1523
  gvisor.googlesource.com/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:91 +0x2e5

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/06/07 18:03 https://gvisor.googlesource.com/gvisor master e5fb3aab122c cf9c3a50 .config console log report ci-gvisor-ptrace-proxy-sandbox-race
* Struck through repros no longer work on HEAD.