syzbot


panic: WARNING: circular locking detected: stack.packetEndpointListRWMutex -> kernel.taskSetRWMutex:

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 -> kernel.taskSetRWMutex: (2) C 3 525d 525d 26/26 fixed on 2023/06/26 09:18

Sample crash report:
panic: WARNING: circular locking detected: stack.packetEndpointListRWMutex -> kernel.taskSetRWMutex:
goroutine 264 [running]:
gvisor.dev/gvisor/pkg/sync/locking.(*ancestorsAtomicPtrMap).RangeRepeatable(0xc0003b0020, 0xc0006e2958)
	bazel-out/k8-fastbuild-ST-3dcbe13c9b87/bin/pkg/sync/locking/atomicptrmap_ancestors_unsafe.go:440 +0x31d
gvisor.dev/gvisor/pkg/sync/locking.checkLock(0xc0003b0a20, 0xc0003b0000, {0xc00098a848, 0x1, 0x1})
	pkg/sync/locking/lockdep.go:112 +0x4e6
gvisor.dev/gvisor/pkg/sync/locking.checkLock.func1(0xc0002d7cf0?, 0xc0006e2a88?)
	pkg/sync/locking/lockdep.go:115 +0x7a
gvisor.dev/gvisor/pkg/sync/locking.(*ancestorsAtomicPtrMap).RangeRepeatable(0xc0002d7cd0, 0xc0006e2b98)
	bazel-out/k8-fastbuild-ST-3dcbe13c9b87/bin/pkg/sync/locking/atomicptrmap_ancestors_unsafe.go:440 +0x31d
gvisor.dev/gvisor/pkg/sync/locking.checkLock(0xc0003b0a20, 0xc0002d7cb0, {0x0, 0x0, 0x0})
	pkg/sync/locking/lockdep.go:112 +0x4e6
gvisor.dev/gvisor/pkg/sync/locking.AddGLock(0xc0003b0a20, 0xffffffffffffffff)
	pkg/sync/locking/lockdep.go:144 +0x385
gvisor.dev/gvisor/pkg/sentry/kernel.(*taskSetRWMutex).RLock(0xc0005e4c40)
	bazel-out/k8-fastbuild-ST-3dcbe13c9b87/bin/pkg/sentry/kernel/taskset_mutex.go:59 +0x58
gvisor.dev/gvisor/pkg/sentry/kernel.(*ThreadGroup).Leader(0xc000a64800)
	pkg/sentry/kernel/threads.go:403 +0x8b
gvisor.dev/gvisor/pkg/sentry/kernel/fasync.(*FileAsync).NotifyEvent(0xc0005e48c0, 0x41)
	pkg/sentry/kernel/fasync/fasync.go:101 +0x225
gvisor.dev/gvisor/pkg/waiter.(*Queue).Notify(0xc0006e9770, 0x41)
	pkg/waiter/waiter.go:238 +0x106
gvisor.dev/gvisor/pkg/tcpip/transport/packet.(*endpoint).HandlePacket(0xc0002ca700, 0x1, 0x800, 0xc00028c640)
	pkg/tcpip/transport/packet/endpoint.go:473 +0x785
gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).DeliverLinkPacket.func2({0x753200, 0xc0002ca700})
	pkg/tcpip/stack/nic.go:772 +0x3af
gvisor.dev/gvisor/pkg/tcpip/stack.(*packetEndpointList).forEach(0xc0006e98c0, 0xc0006e3e38)
	pkg/tcpip/stack/nic.go:130 +0x166
gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).DeliverLinkPacket(0xc000c2a000, 0x800, 0xc00028c3c0)
	pkg/tcpip/stack/nic.go:787 +0x2a7
gvisor.dev/gvisor/pkg/tcpip/link/nested.(*Endpoint).DeliverLinkPacket(0xc0002095e0, 0x1?, 0x0?)
	pkg/tcpip/link/nested/nested.go:69 +0xc6
gvisor.dev/gvisor/pkg/tcpip/link/packetsocket.(*endpoint).WritePackets(0xc0002095e0, {{0xc00098a828, 0x1, 0x1}})
	pkg/tcpip/link/packetsocket/packetsocket.go:52 +0xc5
gvisor.dev/gvisor/pkg/tcpip/stack.(*delegatingQueueingDiscipline).WritePacket(0xc00089b6a0, 0xc0002095e0?)
	pkg/tcpip/stack/nic.go:146 +0xa9
gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).writeRawPacket(0xc000c2a000, 0xc00028c3c0)
	pkg/tcpip/stack/nic.go:392 +0x93
gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).writePacket(0xc000c2a000, 0x0?)
	pkg/tcpip/stack/nic.go:386 +0x71
gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).WritePacket(0xc000c2a000, 0xc00000ffde?, 0xc00028c3c0)
	pkg/tcpip/stack/nic.go:347 +0x246
gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).writePacketPostRouting(0xc000578400, 0xc000546540, 0xc00028c3c0, 0x0)
	pkg/tcpip/network/ipv4/ipv4.go:588 +0x5fd
gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).writePacket(0xc000578400, 0x0?, 0x4?)
	pkg/tcpip/network/ipv4/ipv4.go:538 +0x2de
gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).WritePacket(0x30f320?, 0xc000546540, {0x800?, 0x0?, 0x0?}, 0x12787db?)
	pkg/tcpip/network/ipv4/ipv4.go:506 +0x205
gvisor.dev/gvisor/pkg/tcpip/stack.(*Route).WritePacket(0xc000546540, {0x572858?, 0xc0?, 0x0?}, 0x1276bac?)
	pkg/tcpip/stack/route.go:495 +0x139
gvisor.dev/gvisor/pkg/tcpip/transport/internal/network.(*WriteContext).WritePacket(0xc0006e4a78, 0xc00028c3c0, 0x0)
	pkg/tcpip/transport/internal/network/endpoint.go:320 +0x218
gvisor.dev/gvisor/pkg/tcpip/transport/raw.(*endpoint).write(0xc000572700, {0x75e9d0?, 0xc00083a3c0}, {0xc000665700, 0x0, 0x1, 0x0, {0x0, 0x0, 0x0, ...}})
	pkg/tcpip/transport/raw/endpoint.go:385 +0x866
gvisor.dev/gvisor/pkg/tcpip/transport/raw.(*endpoint).Write(0xc000572700, {0x75e9d0, 0xc00083a3c0}, {0xc000665700, 0x0, 0x1, 0x0, {0x0, 0x0, 0x0, ...}})
	pkg/tcpip/transport/raw/endpoint.go:320 +0x1cd
gvisor.dev/gvisor/pkg/sentry/socket/netstack.(*sock).SendMsg(0xc00021c1e0, 0xc000b7aa80, {{0x769290, 0xc000b59000}, {0x0, 0x0, 0x0, 0x0}, {0x0, 0x1}}, ...)
	pkg/sentry/socket/netstack/netstack.go:2942 +0x8f0
gvisor.dev/gvisor/pkg/sentry/syscalls/linux.sendSingleMsg(0xc000b7aa80, {0x77fef0, 0xc00021c1e0}, 0xc0006e5520?, 0x1?, 0x4080)
	pkg/sentry/syscalls/linux/sys_socket.go:1111 +0x6ef
gvisor.dev/gvisor/pkg/sentry/syscalls/linux.SendMMsg(0xc000b7aa80, 0x1?, {{0x3}, {0x20005340}, {0x1}, {0x4080}, {0x0}, {0x0}})
	pkg/sentry/syscalls/linux/sys_socket.go:1035 +0x675
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall(0xc000b7aa80, 0x133, {{0x3}, {0x20005340}, {0x1}, {0x4080}, {0x0}, {0x0}})
	pkg/sentry/kernel/task_syscall.go:142 +0xabf
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke(0xc000b7aa80, 0x1?, {{0x3}, {0x20005340}, {0x1}, {0x4080}, {0x0}, {0x0}})
	pkg/sentry/kernel/task_syscall.go:322 +0x8e
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter(0xc0001ca2d0?, 0xc0006e5b37?, {{0x3}, {0x20005340}, {0x1}, {0x4080}, {0x0}, {0x0}})
	pkg/sentry/kernel/task_syscall.go:282 +0xc5
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall(0xc000b7aa80)
	pkg/sentry/kernel/task_syscall.go:257 +0x53b
gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute(0xc000b7aa80?, 0xc000b7aa80)
	pkg/sentry/kernel/task_run.go:269 +0x22b4
gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run(0xc000b7aa80, 0x9)
	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 (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/06/05 17:01 gvisor 7fa1ad884022 a4ae4f42 .config console log report syz C ci-gvisor-systrap-1-race-cover panic: WARNING: circular locking detected: stack.packetEndpointListRWMutex -> kernel.taskSetRWMutex:
2023/06/05 16:50 gvisor 7fa1ad884022 a4ae4f42 .config console log report syz C ci-gvisor-ptrace-2-race panic: WARNING: circular locking detected: stack.packetEndpointListRWMutex -> kernel.taskSetRWMutex:
2023/06/05 16:47 gvisor 7fa1ad884022 a4ae4f42 .config console log report syz C ci-gvisor-systrap-1-race panic: WARNING: circular locking detected: stack.packetEndpointListRWMutex -> kernel.taskSetRWMutex:
* Struck through repros no longer work on HEAD.