syzbot


panic: WARNING: circular locking detected: stack.packetEndpointListRWMutex -> fasync.fileMutex:

Status: fixed on 2023/06/09 02:12
Fix commit: f3d87d3be121 fasync: release the FileAsync mutex before sending the signal
First crash: 539d, last: 539d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
gvisor panic: WARNING: circular locking detected: stack.packetEndpointListRWMutex -> fasync.fileMutex: (2) 2 525d 526d 26/26 fixed on 2023/06/26 09:18

Sample crash report:
panic: WARNING: circular locking detected: stack.packetEndpointListRWMutex -> fasync.fileMutex:
goroutine 2472060 [running]:
gvisor.dev/gvisor/pkg/sync/locking.(*ancestorsAtomicPtrMap).RangeRepeatable(0xc000334890, 0xc0107ea698)
	bazel-out/k8-fastbuild-ST-3dcbe13c9b87/bin/pkg/sync/locking/atomicptrmap_ancestors_unsafe.go:440 +0x1dc
gvisor.dev/gvisor/pkg/sync/locking.checkLock(0xc000334e10, 0xc000334870, {0xc0107d4c90, 0x2, 0x2})
	pkg/sync/locking/lockdep.go:112 +0x48d
gvisor.dev/gvisor/pkg/sync/locking.checkLock.func1(0xc000334040?, 0xc0107ea7c0?)
	pkg/sync/locking/lockdep.go:115 +0x65
gvisor.dev/gvisor/pkg/sync/locking.(*ancestorsAtomicPtrMap).RangeRepeatable(0xc000334020, 0xc0107ea8d0)
	bazel-out/k8-fastbuild-ST-3dcbe13c9b87/bin/pkg/sync/locking/atomicptrmap_ancestors_unsafe.go:440 +0x1dc
gvisor.dev/gvisor/pkg/sync/locking.checkLock(0xc000334e10, 0xc000334000, {0xc0107c2f10, 0x1, 0x1})
	pkg/sync/locking/lockdep.go:112 +0x48d
gvisor.dev/gvisor/pkg/sync/locking.checkLock.func1(0xc000247cf0?, 0xc0107ea9f8?)
	pkg/sync/locking/lockdep.go:115 +0x65
gvisor.dev/gvisor/pkg/sync/locking.(*ancestorsAtomicPtrMap).RangeRepeatable(0xc000247cd0, 0xc0107eab08)
	bazel-out/k8-fastbuild-ST-3dcbe13c9b87/bin/pkg/sync/locking/atomicptrmap_ancestors_unsafe.go:440 +0x1dc
gvisor.dev/gvisor/pkg/sync/locking.checkLock(0xc000334e10, 0xc000247cb0, {0x0, 0x0, 0x0})
	pkg/sync/locking/lockdep.go:112 +0x48d
gvisor.dev/gvisor/pkg/sync/locking.AddGLock(0xc000334e10, 0xffffffffffffffff)
	pkg/sync/locking/lockdep.go:144 +0x2dc
gvisor.dev/gvisor/pkg/sentry/kernel/fasync.(*fileMutex).Lock(0xc01075df48)
	bazel-out/k8-fastbuild-ST-3dcbe13c9b87/bin/pkg/sentry/kernel/fasync/file_mutex.go:33 +0x45
gvisor.dev/gvisor/pkg/sentry/kernel/fasync.(*FileAsync).NotifyEvent(0xc01075df10, 0x41)
	pkg/sentry/kernel/fasync/fasync.go:90 +0x65
gvisor.dev/gvisor/pkg/waiter.(*Queue).Notify(0xc011302d50, 0x41)
	pkg/waiter/waiter.go:238 +0xae
gvisor.dev/gvisor/pkg/tcpip/transport/packet.(*endpoint).HandlePacket(0xc0108fe380, 0x2f2de, 0x800, 0xc00cd143c0)
	pkg/tcpip/transport/packet/endpoint.go:473 +0x6af
gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).DeliverLinkPacket.func2({0x8261a0, 0xc0108fe380})
	pkg/tcpip/stack/nic.go:772 +0x31e
gvisor.dev/gvisor/pkg/tcpip/stack.(*packetEndpointList).forEach(0xc011302e10, 0xc0107ebce8)
	pkg/tcpip/stack/nic.go:130 +0x122
gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).DeliverLinkPacket(0xc00114c000, 0x800, 0xc0012ad180)
	pkg/tcpip/stack/nic.go:787 +0x236
gvisor.dev/gvisor/pkg/tcpip/link/nested.(*Endpoint).DeliverLinkPacket(0xc009a1def0, 0x1a95f45?, 0x0?)
	pkg/tcpip/link/nested/nested.go:69 +0x99
gvisor.dev/gvisor/pkg/tcpip/link/packetsocket.(*endpoint).WritePackets(0xc009a1def0, {{0xc0107c2ef8, 0x1, 0x1}})
	pkg/tcpip/link/packetsocket/packetsocket.go:52 +0x9f
gvisor.dev/gvisor/pkg/tcpip/stack.(*delegatingQueueingDiscipline).WritePacket(0xc0108958c0, 0x1321045?)
	pkg/tcpip/stack/nic.go:146 +0x98
gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).writeRawPacket(0xc00114c000, 0xc0012ad180)
	pkg/tcpip/stack/nic.go:392 +0x85
gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).writePacket(0xc00114c000, 0x0?)
	pkg/tcpip/stack/nic.go:386 +0x5a
gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).WritePacket(0xc00114c000, 0xc00000ffde?, 0xc0012ad180)
	pkg/tcpip/stack/nic.go:347 +0x206
gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).writePacketPostRouting(0xc001136d00, 0xc0107b8a80, 0xc0012ad180, 0x0)
	pkg/tcpip/network/ipv4/ipv4.go:588 +0x4db
gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).writePacket(0xc001136d00, 0x0?, 0x4?)
	pkg/tcpip/network/ipv4/ipv4.go:538 +0x2d4
gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).WritePacket(0x30f320?, 0xc0107b8a80, {0x800?, 0x0?, 0x0?}, 0x0?)
	pkg/tcpip/network/ipv4/ipv4.go:506 +0x1a5
gvisor.dev/gvisor/pkg/tcpip/stack.(*Route).WritePacket(0xc0107b8a80, {0x108a72d8?, 0xc0?, 0x0?}, 0x1c1c520?)
	pkg/tcpip/stack/route.go:495 +0xf9
gvisor.dev/gvisor/pkg/tcpip/transport/internal/network.(*WriteContext).WritePacket(0xc0107ec928, 0xc0012ad180, 0x0)
	pkg/tcpip/transport/internal/network/endpoint.go:320 +0x1ed
gvisor.dev/gvisor/pkg/tcpip/transport/raw.(*endpoint).write(0xc0108a7180, {0x831970?, 0xc0376654a0}, {0xc0107cdac0, 0x0, 0x1, 0x0, {0x0, 0x0, 0x0, ...}})
	pkg/tcpip/transport/raw/endpoint.go:385 +0x8d5
gvisor.dev/gvisor/pkg/tcpip/transport/raw.(*endpoint).Write(0xc0108a7180, {0x831970, 0xc0376654a0}, {0xc0107cdac0, 0x0, 0x1, 0x0, {0x0, 0x0, 0x0, ...}})
	pkg/tcpip/transport/raw/endpoint.go:320 +0x1a5
gvisor.dev/gvisor/pkg/sentry/socket/netstack.(*sock).SendMsg(0xc0100d9a40, 0xc010913500, {{0x83c230, 0xc01088f000}, {0x0, 0x0, 0x0, 0x0}, {0x0, 0x1}}, ...)
	pkg/sentry/socket/netstack/netstack.go:2942 +0x896
gvisor.dev/gvisor/pkg/sentry/syscalls/linux.sendSingleMsg(0xc010913500, {0x853110, 0xc0100d9a40}, 0xc0107c2db8?, 0xc00033e300?, 0x4080)
	pkg/sentry/syscalls/linux/sys_socket.go:1111 +0x664
gvisor.dev/gvisor/pkg/sentry/syscalls/linux.SendMMsg(0xc010913500, 0x17a7211?, {{0x3}, {0x20005340}, {0x1}, {0x4080}, {0x0}, {0x0}})
	pkg/sentry/syscalls/linux/sys_socket.go:1035 +0x4df
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall(0xc010913500, 0x133, {{0x3}, {0x20005340}, {0x1}, {0x4080}, {0x0}, {0x0}})
	pkg/sentry/kernel/task_syscall.go:142 +0x9c2
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke(0xc010913500, 0x0?, {{0x3}, {0x20005340}, {0x1}, {0x4080}, {0x0}, {0x0}})
	pkg/sentry/kernel/task_syscall.go:322 +0x7d
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter(0xc010acc4e0?, 0xc0100d9c20?, {{0x3}, {0x20005340}, {0x1}, {0x4080}, {0x0}, {0x0}})
	pkg/sentry/kernel/task_syscall.go:282 +0x8f
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall(0xc010913500)
	pkg/sentry/kernel/task_syscall.go:257 +0x4c5
gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute(0xc010913500?, 0xc010913500)
	pkg/sentry/kernel/task_run.go:269 +0x1d4b
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run(0xc010913500, 0x760d)
	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 (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/06/05 16:15 gvisor 7fa1ad884022 a4ae4f42 .config console log report info ci-gvisor-ptrace-1-race panic: WARNING: circular locking detected: stack.packetEndpointListRWMutex -> fasync.fileMutex:
* Struck through repros no longer work on HEAD.