syzbot


panic: WARNING: circular locking detected: mm.activeRWMutex -> kernfs.filesystemRWMutex:

Status: fixed on 2023/06/09 02:12
Fix commit: 8c975e6e6e68 Mark some kernfs inode as Anonymous.
First crash: 568d, last: 568d

Sample crash report:
panic: WARNING: circular locking detected: mm.activeRWMutex -> kernfs.filesystemRWMutex:
goroutine 1487 [running]:
gvisor.dev/gvisor/pkg/sync/locking.(*ancestorsAtomicPtrMap).RangeRepeatable(0xc000240a40, 0xc000b97710)
	bazel-out/k8-fastbuild-ST-3dcbe13c9b87/bin/pkg/sync/locking/atomicptrmap_ancestors_unsafe.go:440 +0x1dc
gvisor.dev/gvisor/pkg/sync/locking.checkLock(0xc000240750, 0xc000240a20, {0x0, 0x0, 0x0})
	pkg/sync/locking/lockdep.go:112 +0x48d
gvisor.dev/gvisor/pkg/sync/locking.AddGLock(0xc000240750, 0xffffffffffffffff)
	pkg/sync/locking/lockdep.go:144 +0x2dc
gvisor.dev/gvisor/pkg/sentry/fsimpl/kernfs.(*filesystemRWMutex).RLock(0xc0003ca190)
	bazel-out/k8-fastbuild-ST-3dcbe13c9b87/bin/pkg/sentry/fsimpl/kernfs/filesystem_mutex.go:59 +0x45
gvisor.dev/gvisor/pkg/sentry/fsimpl/kernfs.(*Dentry).InotifyWithParent(0xc0001d8360, {0x82c058, 0xc00098d500}, 0x8, 0xc0?, 0xb0?)
	pkg/sentry/fsimpl/kernfs/kernfs.go:517 +0xa8
gvisor.dev/gvisor/pkg/sentry/vfs.(*Dentry).InotifyWithParent(...)
	pkg/sentry/vfs/dentry.go:187
gvisor.dev/gvisor/pkg/sentry/vfs.(*FileDescription).DecRef.func1()
	pkg/sentry/vfs/file_description.go:167 +0xdf
gvisor.dev/gvisor/pkg/sentry/vfs.(*FileDescriptionRefs).DecRef(0xc00057e6c0, 0xc000b97b38)
	bazel-out/k8-fastbuild-ST-3dcbe13c9b87/bin/pkg/sentry/vfs/file_description_refs.go:131 +0x5f
gvisor.dev/gvisor/pkg/sentry/vfs.(*FileDescription).DecRef(0xc00057e6c0, {0x82c058, 0xc00098d500})
	pkg/sentry/vfs/file_description.go:161 +0x6f
gvisor.dev/gvisor/pkg/sentry/socket/control.(*RightsFiles).Release(0xc000454ca8, {0x82c058, 0xc00098d500})
	pkg/sentry/socket/control/control.go:707 +0x85
gvisor.dev/gvisor/pkg/sentry/socket/unix/transport.(*streamQueueReceiver).Recv(0xc000709e60, {0x82c058, 0xc00098d500}, {0xc0005fa918, 0x1, 0x1}, 0x0, 0x0, 0x0)
	pkg/sentry/socket/unix/transport/unix.go:552 +0x902
gvisor.dev/gvisor/pkg/sentry/socket/unix/transport.(*baseEndpoint).RecvMsg(0xc000b57340, {0x82c058, 0xc00098d500}, {0xc0005fa918, 0x1, 0x1}, 0x4?, 0x4?, 0x0?, 0x0)
	pkg/sentry/socket/unix/transport/unix.go:871 +0x10b
gvisor.dev/gvisor/pkg/sentry/socket/unix.(*EndpointReader).ReadToBlocks.func1({0xc0005fa918, 0x1, 0x1})
	pkg/sentry/socket/unix/io.go:115 +0x14d
gvisor.dev/gvisor/pkg/safemem.FromVecReaderFunc.ReadToBlocks({0x3c0?}, {0x7f6c2f6003c0?, 0x0?, 0x1000?, 0xffffffffffffffff?})
	pkg/safemem/io.go:282 +0x38c
gvisor.dev/gvisor/pkg/sentry/socket/unix.(*EndpointReader).ReadToBlocks(0xc0007f5580, {0x7f6c2f6003c0?, 0x0?, 0x200013c0?, 0x200003c0?})
	pkg/sentry/socket/unix/io.go:124 +0x7f
gvisor.dev/gvisor/pkg/sentry/mm.(*MemoryManager).withInternalMappings(0xc000996000, {0x82c058, 0xc00098d500}, {0x14ab432?, 0x12d2819?}, {0xd7?, 0x43?, 0x2d?}, 0x1?, 0xc000b98648)
	pkg/sentry/mm/io.go:522 +0x196
gvisor.dev/gvisor/pkg/sentry/mm.(*MemoryManager).withVecInternalMappings(0xc000996000, {0x82c058, 0xc00098d500}, {0x0?, 0xc000b98680?, 0xc00098d500?, 0x2764c00?}, {0x0, 0x1, 0x0}, ...)
	pkg/sentry/mm/io.go:591 +0x6c5
gvisor.dev/gvisor/pkg/sentry/mm.(*MemoryManager).CopyOutFrom(0xc000996000, {0x82c058, 0xc00098d500}, {0x0?, 0x0?, 0xc00083d080?, 0x0?}, {0x80fe40?, 0xc0007f5580?}, {0x0, ...})
	pkg/sentry/mm/io.go:273 +0x2a9
gvisor.dev/gvisor/pkg/usermem.IOSequence.CopyOutFrom(...)
	pkg/usermem/usermem.go:508
gvisor.dev/gvisor/pkg/sentry/socket/unix.(*Socket).RecvMsg.func1()
	pkg/sentry/socket/unix/unix.go:715 +0xf9
gvisor.dev/gvisor/pkg/sentry/socket/unix.(*Socket).RecvMsg(0xc00057e780, 0xc00098d500, {{0x826250, 0xc000996000}, {0x0, 0x1, 0x200003c0, 0x1000}, {0x0, 0x1}}, ...)
	pkg/sentry/socket/unix/unix.go:772 +0x886
gvisor.dev/gvisor/pkg/sentry/syscalls/linux.recvSingleMsg(0xc00098d500, {0x83cd48, 0xc00057e780}, 0x20001580, 0x0, 0x0?, {0xc00098d501?})
	pkg/sentry/syscalls/linux/sys_socket.go:812 +0x268
gvisor.dev/gvisor/pkg/sentry/syscalls/linux.RecvMMsg(0xc00098d500, 0x3?, {{0x4}, {0x20001580}, {0x1}, {0x0}, {0x0}, {0x0}})
	pkg/sentry/syscalls/linux/sys_socket.go:730 +0x905
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall(0xc00098d500, 0x12b, {{0x4}, {0x20001580}, {0x1}, {0x0}, {0x0}, {0x0}})
	pkg/sentry/kernel/task_syscall.go:142 +0x9c2
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke(0xc00098d500, 0x12e287a?, {{0x4}, {0x20001580}, {0x1}, {0x0}, {0x0}, {0x0}})
	pkg/sentry/kernel/task_syscall.go:322 +0x7d
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter(0x0?, 0x0?, {{0x4}, {0x20001580}, {0x1}, {0x0}, {0x0}, {0x0}})
	pkg/sentry/kernel/task_syscall.go:282 +0x8f
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall(0xc00098d500)
	pkg/sentry/kernel/task_syscall.go:257 +0x4c5
gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute(0xc00098d500?, 0xc00098d500)
	pkg/sentry/kernel/task_run.go:269 +0x1d4b
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run(0xc00098d500, 0x45)
	pkg/sentry/kernel/task_run.go:98 +0x41b
created by gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).Start
	pkg/sentry/kernel/task_start.go:377 +0x1ad

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/05/08 11:37 gvisor 0b76fe6c0038 90c93c40 .config console log report syz C ci-gvisor-systrap-1-race panic: WARNING: circular locking detected: mm.activeRWMutex -> kernfs.filesystemRWMutex:
2023/05/08 11:28 gvisor 0b76fe6c0038 90c93c40 .config console log report syz C ci-gvisor-ptrace-1-race panic: WARNING: circular locking detected: mm.activeRWMutex -> kernfs.filesystemRWMutex:
2023/05/08 11:28 gvisor 0b76fe6c0038 90c93c40 .config console log report syz C ci-gvisor-ptrace-3-race panic: WARNING: circular locking detected: mm.activeRWMutex -> kernfs.filesystemRWMutex:
2023/05/08 10:47 gvisor 0b76fe6c0038 90c93c40 .config console log report info ci-gvisor-systrap-1-race-cover panic: WARNING: circular locking detected: mm.activeRWMutex -> kernfs.filesystemRWMutex:
* Struck through repros no longer work on HEAD.