syzbot


panic: nested locking: kernfs.filesystemRWMutex: (5)

Status: fixed on 2023/06/15 20:22
Fix commit: bb5ada8caffd Defer dec refing mounts in InvalidateDentry.
First crash: 531d, last: 530d
Similar bugs (8)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
gvisor panic: nested locking: kernfs.filesystemRWMutex: (7) 4 459d 461d 26/26 fixed on 2023/08/30 02:45
gvisor panic: nested locking: kernfs.filesystemRWMutex: (3) syz 19 649d 674d 18/26 fixed on 2023/02/17 22:08
gvisor panic: nested locking: kernfs.filesystemRWMutex: (6) C 8 462d 477d 26/26 fixed on 2023/08/23 02:32
gvisor panic: nested locking: kernfs.filesystemRWMutex: (9) 1 196d 196d 0/26 auto-obsoleted due to no activity on 2024/08/20 13:26
gvisor panic: nested locking: kernfs.filesystemRWMutex: (2) C 8 756d 807d 0/26 closed as invalid on 2023/01/19 20:51
gvisor panic: nested locking: kernfs.filesystemRWMutex: (4) C 31 532d 626d 26/26 fixed on 2023/06/13 14:23
gvisor panic: nested locking: kernfs.filesystemRWMutex: (8) 1 351d 344d 0/26 auto-obsoleted due to no activity on 2024/03/10 05:57
gvisor panic: nested locking: kernfs.filesystemRWMutex: C 5 850d 851d 0/26 closed as invalid on 2022/08/09 17:49

Sample crash report:
panic: nested locking: kernfs.filesystemRWMutex:
goroutine 3140903 [running]:
gvisor.dev/gvisor/pkg/sentry/fsimpl/kernfs.(*filesystemRWMutex).Lock(0xc0005cecd0)
	bazel-out/k8-fastbuild-ST-3dcbe13c9b87/bin/pkg/sentry/fsimpl/kernfs/filesystem_mutex.go:31 +0x58
gvisor.dev/gvisor/pkg/sentry/fsimpl/kernfs.(*Filesystem).Release(0xc0005cec80, {0x773000, 0xc04903e000})
	pkg/sentry/fsimpl/kernfs/filesystem.go:262 +0x9b
gvisor.dev/gvisor/pkg/sentry/fsimpl/proc.(*filesystem).Release(0xc0005cec80, {0x773000, 0xc04903e000})
	pkg/sentry/fsimpl/proc/filesystem.go:104 +0xc5
gvisor.dev/gvisor/pkg/sentry/vfs.(*Filesystem).DecRef.func1()
	pkg/sentry/vfs/filesystem.go:81 +0x119
gvisor.dev/gvisor/pkg/sentry/vfs.(*FilesystemRefs).DecRef(0xc0005cec80, 0xc0076a07c8)
	bazel-out/k8-fastbuild-ST-3dcbe13c9b87/bin/pkg/sentry/vfs/filesystem_refs.go:132 +0xb2
gvisor.dev/gvisor/pkg/sentry/vfs.(*Filesystem).DecRef(0xc0005cec80, {0x773000, 0xc04903e000})
	pkg/sentry/vfs/filesystem.go:77 +0x87
gvisor.dev/gvisor/pkg/sentry/vfs.(*Mount).destroy(0xc00404a100, {0x773000, 0xc04903e000})
	pkg/sentry/vfs/mount.go:753 +0x1b7
gvisor.dev/gvisor/pkg/sentry/vfs.(*Mount).DecRef(0xc00404a100, {0x773000, 0xc04903e000})
	pkg/sentry/vfs/mount.go:737 +0xcc
gvisor.dev/gvisor/pkg/sentry/vfs.(*VirtualFilesystem).forgetDeadMountpoint(0xc0002a7de0, {0x773000, 0xc04903e000}, 0xc0084667e0, 0x1)
	pkg/sentry/vfs/dentry.go:346 +0x2cc
gvisor.dev/gvisor/pkg/sentry/vfs.(*VirtualFilesystem).InvalidateDentry(0xc0037c3320?, {0x773000, 0xc04903e000}, 0xc0084667e0)
	pkg/sentry/vfs/dentry.go:250 +0xb3
gvisor.dev/gvisor/pkg/sentry/fsimpl/kernfs.(*Filesystem).revalidateChildLocked(0x312840?, {0x773000, 0xc04903e000}, 0x4?, 0xc0006b63f0, {0xc0408ea50c, 0x4}, 0xc0084667e0)
	pkg/sentry/fsimpl/kernfs/filesystem.go:121 +0x1da
gvisor.dev/gvisor/pkg/sentry/fsimpl/kernfs.(*Filesystem).stepExistingLocked(0xc0037b5b00?, {0x773000, 0xc04903e000}, 0xc0037b5b00, 0xc0006b63f0)
	pkg/sentry/fsimpl/kernfs/filesystem.go:75 +0x525
gvisor.dev/gvisor/pkg/sentry/fsimpl/kernfs.(*Filesystem).walkExistingLocked(0xc000477f90?, {0x773000, 0xc04903e000}, 0xc0037b5b00)
	pkg/sentry/fsimpl/kernfs/filesystem.go:163 +0x11b
gvisor.dev/gvisor/pkg/sentry/fsimpl/kernfs.(*Filesystem).OpenAt(0xc000477f40, {0x773000, 0xc04903e000}, 0xc0037b5b00, {0x8001, 0x0, 0x0})
	pkg/sentry/fsimpl/kernfs/filesystem.go:486 +0x18d
gvisor.dev/gvisor/pkg/sentry/vfs.(*VirtualFilesystem).OpenAt(0xc0063857c0?, {0x773000, 0xc04903e000}, 0xc0006a1b00?, 0xc0076a1428, 0xc0076a12f8)
	pkg/sentry/vfs/vfs.go:460 +0x6bc
gvisor.dev/gvisor/pkg/sentry/syscalls/linux.openat(0xc04903e000, 0x287a7c4?, 0x1?, 0x80001, 0x0)
	pkg/sentry/syscalls/linux/sys_file.go:112 +0x365
gvisor.dev/gvisor/pkg/sentry/syscalls/linux.Openat(0x0?, 0xc0076a15d0?, {{0xffffff9c}, {0x562df6516d5a}, {0x80001}, {0x0}, {0x0}, {0x7f14ccf15030}})
	pkg/sentry/syscalls/linux/sys_file.go:91 +0xcb
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall(0xc04903e000, 0x101, {{0xffffff9c}, {0x562df6516d5a}, {0x80001}, {0x0}, {0x0}, {0x7f14ccf15030}})
	pkg/sentry/kernel/task_syscall.go:142 +0xabf
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke(0xc04903e000, 0x1?, {{0xffffff9c}, {0x562df6516d5a}, {0x80001}, {0x0}, {0x0}, {0x7f14ccf15030}})
	pkg/sentry/kernel/task_syscall.go:322 +0x8e
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter(0xc049fdc0f0?, 0xc0076a1b37?, {{0xffffff9c}, {0x562df6516d5a}, {0x80001}, {0x0}, {0x0}, {0x7f14ccf15030}})
	pkg/sentry/kernel/task_syscall.go:282 +0xc5
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall(0xc04903e000)
	pkg/sentry/kernel/task_syscall.go:257 +0x53b
gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute(0xc04903e000?, 0xc04903e000)
	pkg/sentry/kernel/task_run.go:269 +0x22b4
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run(0xc04903e000, 0xada)
	pkg/sentry/kernel/task_run.go:98 +0x35b
created by gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Start
	pkg/sentry/kernel/task_start.go:377 +0x1da

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/06/15 10:09 gvisor a435ed7c0951 ee64538c .config console log report info ci-gvisor-ptrace-1-race-cover panic: nested locking: kernfs.filesystemRWMutex:
2023/06/14 21:14 gvisor 2ca109d47c72 76decb82 .config console log report info ci-gvisor-ptrace-1-race-cover panic: nested locking: kernfs.filesystemRWMutex:
2023/06/14 04:43 gvisor 30f3409d4f25 d2ee9228 .config console log report info ci-gvisor-ptrace-2-race-cover panic: nested locking: kernfs.filesystemRWMutex:
2023/06/13 16:35 gvisor 084a5022563f 2f9d8e43 .config console log report info ci-gvisor-ptrace-1-race-cover panic: nested locking: kernfs.filesystemRWMutex:
2023/06/13 16:17 gvisor 084a5022563f 2f9d8e43 .config console log report info ci-gvisor-ptrace-2-race-cover panic: nested locking: kernfs.filesystemRWMutex:
* Struck through repros no longer work on HEAD.