syzbot


DATA RACE in log.GoogleEmitter.Emit

Status: fixed on 2020/11/21 02:21
Fix commit: 9c553f2d4e4b Remove racy stringification of socket fds from /proc/net/*.
First crash: 1473d, last: 1467d
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
gvisor DATA RACE in log.GoogleEmitter.Emit (4) 1 116d 116d 26/26 fixed on 2024/08/03 02:02
gvisor DATA RACE in log.GoogleEmitter.Emit (3) 1 133d 133d 26/26 fixed on 2024/07/17 10:25
gvisor DATA RACE in log.GoogleEmitter.Emit (2) 3 554d 556d 26/26 fixed on 2023/05/25 09:13

Sample crash report:
WARNING: DATA RACE
Read at 0x00c0000341a8 by goroutine 291:
  reflect.typedmemmove()
      GOROOT/src/runtime/mbarrier.go:177 +0x0
  reflect.packEface()
      GOROOT/src/reflect/value.go:120 +0x12f
  reflect.valueInterface()
      GOROOT/src/reflect/value.go:1045 +0x1cd
  reflect.Value.Interface()
      GOROOT/src/reflect/value.go:1015 +0x3aa4
  fmt.(*pp).printValue()
      GOROOT/src/fmt/print.go:726 +0x3aa5
  fmt.(*pp).printValue()
      GOROOT/src/fmt/print.go:880 +0x25fc
  fmt.(*pp).printArg()
      GOROOT/src/fmt/print.go:716 +0x26b
  fmt.(*pp).doPrintf()
      GOROOT/src/fmt/print.go:1030 +0x326
  fmt.Sprintf()
      GOROOT/src/fmt/print.go:219 +0x73
  gvisor.dev/gvisor/pkg/log.GoogleEmitter.Emit()
      pkg/log/glog.go:81 +0x1ba
  gvisor.dev/gvisor/pkg/log.(*BasicLogger).DebugfAtDepth()
      pkg/log/log.go:217 +0x127
  gvisor.dev/gvisor/pkg/log.Debugf()
      pkg/log/log.go:275 +0x98
  gvisor.dev/gvisor/pkg/sentry/fsimpl/proc.commonGenerateTCP()
      pkg/sentry/fsimpl/proc/task_net.go:354 +0x1024
  gvisor.dev/gvisor/pkg/sentry/fsimpl/proc.(*netTCPData).Generate()
      pkg/sentry/fsimpl/proc/task_net.go:477 +0xa4
  gvisor.dev/gvisor/pkg/sentry/vfs.(*DynamicBytesFileDescriptionImpl).Seek()
      pkg/sentry/vfs/file_description_impl_util.go:340 +0x227
  gvisor.dev/gvisor/pkg/sentry/fsimpl/kernfs.(*DynamicBytesFD).Seek()
      pkg/sentry/fsimpl/kernfs/dynamic_bytes_file.go:102 +0x6a
  gvisor.dev/gvisor/pkg/sentry/vfs.(*FileDescription).Seek()
      pkg/sentry/vfs/file_description.go:627 +0x1247
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux/vfs2.Sendfile()
      pkg/sentry/syscalls/linux/vfs2/splice.go:405 +0x1226
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall()
      pkg/sentry/kernel/task_syscall.go:104 +0x452
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke()
      pkg/sentry/kernel/task_syscall.go:239 +0xb9
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter()
      pkg/sentry/kernel/task_syscall.go:199 +0x10e
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall()
      pkg/sentry/kernel/task_syscall.go:174 +0x1e9
  gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:282 +0x1266
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:97 +0x397

Previous write at 0x00c0000341a8 by goroutine 207:
  sync/atomic.AddInt32()
      src/runtime/race_amd64.s:269 +0xb
  sync.(*Mutex).Unlock()
      GOROOT/src/sync/mutex.go:186 +0x51
  gvisor.dev/gvisor/pkg/sentry/vfs.(*FileDescription).DecRef.func1()
      pkg/sentry/vfs/file_description.go:161 +0xe8
  gvisor.dev/gvisor/pkg/sentry/vfs.(*FileDescriptionRefs).DecRef()
      bazel-out/k8-fastbuild-ST-85f86a41aebae9b44e06a227fc2c34bde1094098ba6d32170f99a32414da6482/bin/pkg/sentry/vfs/file_description_refs.go:128 +0x7c
  gvisor.dev/gvisor/pkg/sentry/vfs.(*FileDescription).DecRef()
      pkg/sentry/vfs/file_description.go:156 +0x76
  gvisor.dev/gvisor/pkg/sentry/kernel.(*FDTable).dropVFS2()
      pkg/sentry/kernel/fd_table.go:171 +0x1bc
  gvisor.dev/gvisor/pkg/sentry/kernel.(*FDTable).RemoveIf()
      pkg/sentry/kernel/fd_table.go:672 +0x224
  gvisor.dev/gvisor/pkg/sentry/kernel.(*FDTable).DecRef.func1()
      pkg/sentry/kernel/fd_table.go:186 +0x64
  gvisor.dev/gvisor/pkg/sentry/kernel.(*FDTableRefs).DecRef()
      bazel-out/k8-fastbuild-ST-85f86a41aebae9b44e06a227fc2c34bde1094098ba6d32170f99a32414da6482/bin/pkg/sentry/kernel/fd_table_refs.go:128 +0x7c
  gvisor.dev/gvisor/pkg/sentry/kernel.(*FDTable).DecRef()
      pkg/sentry/kernel/fd_table.go:185 +0x76
  gvisor.dev/gvisor/pkg/sentry/kernel.(*runExitMain).execute()
      pkg/sentry/kernel/task_exit.go:276 +0x306
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:97 +0x397

Crashes (34):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/11/14 09:29 gvisor 182c126013a2 1bf9a662 .config console log report syz C ci-gvisor-ptrace-proxy-sandbox-race
2020/11/20 04:15 gvisor 27ee4fe76ad5 0767f13f .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/19 17:17 gvisor e5650d124032 0767f13f .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/19 04:50 gvisor 9d148627f82f 0767f13f .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/18 16:19 gvisor ee6dd8cb9712 09323409 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/18 12:10 gvisor ee6dd8cb9712 09323409 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/18 12:02 gvisor ee6dd8cb9712 09323409 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/18 08:52 gvisor ee6dd8cb9712 09323409 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/18 03:00 gvisor 938aabeecb93 09323409 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/18 01:00 gvisor 938aabeecb93 09323409 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/18 00:37 gvisor 938aabeecb93 09323409 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/18 00:28 gvisor 938aabeecb93 09323409 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/17 23:22 gvisor 938aabeecb93 09323409 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/17 21:02 gvisor 938aabeecb93 09323409 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/17 20:50 gvisor 938aabeecb93 09323409 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/17 15:32 gvisor 938aabeecb93 1bf9a662 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/16 17:25 gvisor 43dd7a200569 1bf9a662 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/16 17:22 gvisor 43dd7a200569 1bf9a662 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/16 17:03 gvisor 43dd7a200569 1bf9a662 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/16 16:06 gvisor 43dd7a200569 1bf9a662 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/16 15:54 gvisor 43dd7a200569 1bf9a662 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/16 13:20 gvisor 43dd7a200569 1bf9a662 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/15 22:39 gvisor 182c126013a2 1bf9a662 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/15 16:47 gvisor 182c126013a2 1bf9a662 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/15 04:09 gvisor 182c126013a2 1bf9a662 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/15 04:09 gvisor 182c126013a2 1bf9a662 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/14 20:32 gvisor 182c126013a2 1bf9a662 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/14 19:33 gvisor 182c126013a2 1bf9a662 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/14 19:23 gvisor 182c126013a2 1bf9a662 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/14 16:58 gvisor 182c126013a2 1bf9a662 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/14 12:53 gvisor 182c126013a2 1bf9a662 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/14 09:13 gvisor 182c126013a2 1bf9a662 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/14 09:12 gvisor 182c126013a2 1bf9a662 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
2020/11/14 09:11 gvisor 182c126013a2 1bf9a662 .config console log report info ci-gvisor-ptrace-proxy-sandbox-race
* Struck through repros no longer work on HEAD.