syzbot


panic: WARNING: circular locking detected: stack.neighborEntryRWMutex -> stack.nicRWMutex:

Status: fixed on 2023/05/15 23:52
Fix commit: 38823be81914 Don't lock before accessing nic.networkEndpoints
First crash: 592d, last: 592d

Sample crash report:
panic: WARNING: circular locking detected: stack.neighborEntryRWMutex -> stack.nicRWMutex:
goroutine 985462 [running]:
gvisor.dev/gvisor/pkg/sync/locking.(*ancestorsAtomicPtrMap).RangeRepeatable(0xc0002d78e0, 0xc001d5ae30)
	bazel-out/k8-fastbuild-ST-3dcbe13c9b87/bin/pkg/sync/locking/atomicptrmap_ancestors_unsafe.go:440 +0x31d
gvisor.dev/gvisor/pkg/sync/locking.checkLock(0xc0002d7950, 0xc0002d78c0, {0x0, 0x0, 0x0})
	pkg/sync/locking/lockdep.go:112 +0x4e6
gvisor.dev/gvisor/pkg/sync/locking.AddGLock(0xc0002d7950, 0xffffffffffffffff)
	pkg/sync/locking/lockdep.go:144 +0x385
gvisor.dev/gvisor/pkg/tcpip/stack.(*nicRWMutex).RLock(0xc000c8a778)
	bazel-out/k8-fastbuild-ST-3dcbe13c9b87/bin/pkg/tcpip/stack/nic_mutex.go:59 +0x58
gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).getNetworkEndpoint(0xc000c8a600, 0x10?)
	pkg/tcpip/stack/nic.go:211 +0x74
gvisor.dev/gvisor/pkg/tcpip/stack.(*neighborEntry).handleConfirmationLocked(0xc0007fc000, {0x0, 0x0}, {0x10?, 0x0?, 0x0?})
	pkg/tcpip/stack/neighbor_entry.go:572 +0x517
gvisor.dev/gvisor/pkg/tcpip/stack.(*neighborCache).handleConfirmation(0xc0007a84e0, {0xc00b59f1a0, 0x10}, {0x0, 0x0}, {0xbb?, 0x6e?, 0x22?})
	pkg/tcpip/stack/neighbor_cache.go:288 +0x125
gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).HandleNeighborConfirmation(0xc000c8a600, 0x10?, {0xc00b59f1a0, 0x10}, {0x0, 0x0}, {0x10?, 0x0?, 0x0?})
	pkg/tcpip/stack/nic.go:981 +0x105
gvisor.dev/gvisor/pkg/tcpip/network/ipv6.(*endpoint).handleICMP(0xc000886a80, {0x0?}, 0x0, 0xc0015e1ae8?)
	pkg/tcpip/network/ipv6/icmp.go:643 +0x29a9
gvisor.dev/gvisor/pkg/tcpip/network/ipv6.(*endpoint).processIPv6RawPayloadHeader(0xc000886a80, 0xc0015e1ef0, 0x10?, {0xc0002d7710?}, 0xffffffffffffffff?, 0x0, 0x0?)
	pkg/tcpip/network/ipv6/ipv6.go:1517 +0x4b0
gvisor.dev/gvisor/pkg/tcpip/network/ipv6.(*endpoint).processExtensionHeader(0xc000886a80, 0xc004b707e0, 0xc0015e22f0, {0xc00157d88e, 0x28, 0x72}, 0xc0015e2200, 0xc0015e219e, 0x0)
	pkg/tcpip/network/ipv6/ipv6.go:1435 +0x7c5
gvisor.dev/gvisor/pkg/tcpip/network/ipv6.(*endpoint).processExtensionHeaders(0x1000000012269c5?, {0xc00157d88e, 0x28, 0x72}, {0xc00028c000}, 0xe0?)
	pkg/tcpip/network/ipv6/ipv6.go:1480 +0x43e
gvisor.dev/gvisor/pkg/tcpip/network/ipv6.(*endpoint).deliverPacketLocally(0xc000886a80, {0xc00157d88e, 0x28, 0x72}, {0xc004b70570?}, {0xc000963de9, 0x7})
	pkg/tcpip/network/ipv6/ipv6.go:1369 +0x187
gvisor.dev/gvisor/pkg/tcpip/network/ipv6.(*endpoint).handleValidatedPacket(0xc000886a80, {0xc00157d88e, 0x28, 0x72}, {0xc000963de9?}, {0xc000963de9, 0x7})
	pkg/tcpip/network/ipv6/ipv6.go:1331 +0x439
gvisor.dev/gvisor/pkg/tcpip/network/ipv6.(*endpoint).HandlePacket(0xc000886a80, {0x8?})
	pkg/tcpip/network/ipv6/ipv6.go:1128 +0x76b
gvisor.dev/gvisor/pkg/tcpip/stack.(*groDispatcher).dispatch(0xc000d12e60?, {0x1226ebb?}, 0x86dd, {0x756488, 0xc000886a80})
	pkg/tcpip/stack/gro.go:424 +0x13b
gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).DeliverNetworkPacket(0xc000c8a600, 0x86dd, {0x1?})
	pkg/tcpip/stack/nic.go:740 +0x158
gvisor.dev/gvisor/pkg/tcpip/link/nested.(*Endpoint).DeliverNetworkPacket(0xc000d12e60, 0x1226ebb?, {0x27ecde0?})
	pkg/tcpip/link/nested/nested.go:59 +0xc6
gvisor.dev/gvisor/pkg/tcpip/link/packetsocket.(*endpoint).DeliverNetworkPacket(0xc000d12e60, 0xaf58580?, {0xe?})
	pkg/tcpip/link/packetsocket/packetsocket.go:46 +0x65
gvisor.dev/gvisor/pkg/tcpip/link/channel.(*Endpoint).InjectInbound(0xc000587d40, 0x0?, {0xc00157d800?})
	pkg/tcpip/link/channel/channel.go:202 +0xc6
gvisor.dev/gvisor/pkg/tcpip/link/tun.(*Device).Write(0xc0007cc368, 0xc0060ae300?)
	pkg/tcpip/link/tun/device.go:249 +0x7b3
gvisor.dev/gvisor/pkg/sentry/devices/tundev.(*tunFD).Write(0xc0007cc300, {0x757c78?, 0xc008deea80}, {{0x7520f0, 0xc007087000}, {0x0, 0x1, 0x20000100, 0x4e}, {0x0, ...}}, ...)
	pkg/sentry/devices/tundev/tundev.go:164 +0x55f
gvisor.dev/gvisor/pkg/sentry/vfs.(*FileDescription).Write(0xc0007cc300, {0x757c78, 0xc008deea80}, {{0x7520f0, 0xc007087000}, {0x0, 0x1, 0x20000100, 0x4e}, {0x0, ...}}, ...)
	pkg/sentry/vfs/file_description.go:679 +0x152
gvisor.dev/gvisor/pkg/sentry/syscalls/linux.write(0xc008deea80?, 0x0?, {{0x7520f0, 0xc007087000}, {0x0, 0x1, 0x20000100, 0x4e}, {0x0, 0x1}}, ...)
	pkg/sentry/syscalls/linux/sys_read_write.go:347 +0xae
gvisor.dev/gvisor/pkg/sentry/syscalls/linux.Write(0xc008deea80, 0xc007c935d0?, {{0xc8}, {0x20000100}, {0x4e}, {0x4e}, {0x0}, {0x0}})
	pkg/sentry/syscalls/linux/sys_read_write.go:316 +0x34f
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall(0xc008deea80, 0x1, {{0xc8}, {0x20000100}, {0x4e}, {0x4e}, {0x0}, {0x0}})
	pkg/sentry/kernel/task_syscall.go:142 +0xabf
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke(0xc008deea80, 0x1?, {{0xc8}, {0x20000100}, {0x4e}, {0x4e}, {0x0}, {0x0}})
	pkg/sentry/kernel/task_syscall.go:322 +0x8e
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter(0xc00a623c20?, 0xc007c93b37?, {{0xc8}, {0x20000100}, {0x4e}, {0x4e}, {0x0}, {0x0}})
	pkg/sentry/kernel/task_syscall.go:282 +0xc5
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall(0xc008deea80)
	pkg/sentry/kernel/task_syscall.go:257 +0x53b
gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute(0xc008deea80?, 0xc008deea80)
	pkg/sentry/kernel/task_run.go:269 +0x22b4
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run(0xc008deea80, 0x4c89)
	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 (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/04/14 00:29 gvisor 114a033bd038 3cfcaa1b .config console log report info ci-gvisor-ptrace-1-race-cover panic: WARNING: circular locking detected: stack.neighborEntryRWMutex -> stack.nicRWMutex:
* Struck through repros no longer work on HEAD.