syzbot


DATA RACE in tmpfs.AddSeals

Status: fixed on 2022/11/16 03:57
Fix commit: 374e716c7ce2 AddSeals has to take the write lock to modify seals
First crash: 744d, last: 744d

Sample crash report:
WARNING: DATA RACE
Write at 0x00c000e72540 by goroutine 224:
  gvisor.dev/gvisor/pkg/sentry/fsimpl/tmpfs.AddSeals()
      pkg/sentry/fsimpl/tmpfs/regular_file.go:797 +0x344
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux/vfs2.Fcntl()
      pkg/sentry/syscalls/linux/vfs2/fd.go:271 +0x1924
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall()
      pkg/sentry/kernel/task_syscall.go:142 +0xab7
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke()
      pkg/sentry/kernel/task_syscall.go:322 +0x8d
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter()
      pkg/sentry/kernel/task_syscall.go:282 +0xc4
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall()
      pkg/sentry/kernel/task_syscall.go:257 +0x53a
  gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:253 +0x1e2a
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:94 +0x2c1
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Start.func1()
      pkg/sentry/kernel/task_start.go:378 +0x47

Previous read at 0x00c000e72540 by goroutine 205:
  gvisor.dev/gvisor/pkg/sentry/fsimpl/tmpfs.GetSeals()
      pkg/sentry/fsimpl/tmpfs/regular_file.go:769 +0x179
  gvisor.dev/gvisor/pkg/sentry/syscalls/linux/vfs2.Fcntl()
      pkg/sentry/syscalls/linux/vfs2/fd.go:265 +0x181c
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall()
      pkg/sentry/kernel/task_syscall.go:142 +0xab7
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke()
      pkg/sentry/kernel/task_syscall.go:322 +0x8d
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter()
      pkg/sentry/kernel/task_syscall.go:282 +0xc4
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall()
      pkg/sentry/kernel/task_syscall.go:257 +0x53a
  gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute()
      pkg/sentry/kernel/task_run.go:253 +0x1e2a
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run()
      pkg/sentry/kernel/task_run.go:94 +0x2c1
  gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Start.func1()
      pkg/sentry/kernel/task_start.go:378 +0x47

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/11/13 02:38 gvisor 4b63ff222d43 f42ee5d8 .config console log report syz C ci-gvisor-ptrace-3-race-cover DATA RACE in tmpfs.AddSeals
2022/11/12 16:57 gvisor 4b63ff222d43 f42ee5d8 .config console log report syz C ci-gvisor-ptrace-2-race DATA RACE in tmpfs.AddSeals
2022/11/12 16:55 gvisor 4b63ff222d43 f42ee5d8 .config console log report syz C ci-gvisor-ptrace-1-race DATA RACE in tmpfs.AddSeals
2022/11/12 16:40 gvisor 4b63ff222d43 f42ee5d8 .config console log report syz C ci-gvisor-ptrace-3-race DATA RACE in tmpfs.AddSeals
* Struck through repros no longer work on HEAD.