witness: lock order reversal: 1st 0xffff800010fde9b0 sbufsnd (&so->so_snd.sb_lock) 2nd 0xfffffd806bdf0a38 inode (&ip->i_lock) lock order [1] sbufsnd (&so->so_snd.sb_lock) -> [2] inode (&ip->i_lock) lock order data 0xffffffff830beb84 -> 0xffffffff83071f68 is missing lock order [2] inode (&ip->i_lock) -> [3] sbufrcv (&so->so_rcv.sb_lock) #0 rw_enter+0x122 #1 sblock+0xb7 sys/kern/uipc_socket2.c:549 #2 soreceive+0x295 sys/kern/uipc_socket.c:945 #3 fifo_read+0x11a sys/miscfs/fifofs/fifo_vnops.c:264 #4 VOP_READ+0x102 sys/kern/vfs_vops.c:227 #5 vn_rdwr+0x15b #6 vndsetcred+0xa1 sys/dev/vnd.c:684 #7 vndioctl+0xe6c sys/dev/vnd.c:485 #8 VOP_IOCTL+0xac sys/kern/vfs_vops.c:264 #9 vn_ioctl+0xf6 sys/kern/vfs_vnops.c:525 #10 sys_ioctl+0x67c #11 syscall+0xbb6 mi_syscall sys/sys/syscall_mi.h:178 [inline] #11 syscall+0xbb6 sys/arch/amd64/amd64/trap.c:577 #12 Xsyscall+0x128 lock order [3] sbufrcv (&so->so_rcv.sb_lock) -> [1] sbufsnd (&so->so_snd.sb_lock) #0 rw_enter+0x122 #1 sblock+0xb7 sys/kern/uipc_socket2.c:549 #2 sosplice+0x3f4 sys/kern/uipc_socket.c:1454 #3 sys_setsockopt+0x2ba sys/kern/uipc_syscalls.c:1228 #4 syscall+0xbb6 mi_syscall sys/sys/syscall_mi.h:178 [inline] #4 syscall+0xbb6 sys/arch/amd64/amd64/trap.c:577 #5 Xsyscall+0x128 Stopped at db_enter+0x25: addq $0x8,%rsp ddb{0}> ddb{0}> set $lines = 0 ddb{0}> set $maxwidth = 0 ddb{0}> show panic the kernel did not panic ddb{0}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 witness_checkorder(fffffd806bdf0a38,9,0) at witness_checkorder+0x1047 rw_enter(fffffd806bdf0a28,1) at rw_enter+0x122 rrw_enter(fffffd806bdf0a28,1) at rrw_enter+0xbe sys/kern/kern_rwlock.c:464 VOP_LOCK(fffffd806b5dd2d8,2001) at VOP_LOCK+0xa6 sys/kern/vfs_vops.c:524 vn_lock(fffffd806b5dd2d8,2001) at vn_lock+0xa4 sys/kern/vfs_vnops.c:564 vfs_lookup(ffff8000372065f8) at vfs_lookup+0x109 sys/kern/vfs_lookup.c:418 namei(ffff8000372065f8) at namei+0x7aa sys/kern/vfs_lookup.c:250 unp_connect(ffff800010fde808,fffffd806e907e00,ffff8000ffff0cd0) at unp_connect+0x27d sys/kern/uipc_usrreq.c:868 uipc_dgram_send(ffff800010fde808,fffffd807adaad00,fffffd806e907e00,0) at uipc_dgram_send+0x131 sys/kern/uipc_usrreq.c:607 sosend(ffff800010fde808,fffffd806e907e00,ffff800037206888,0,0,0) at sosend+0xa40 sendit(ffff8000ffff0cd0,6,ffff800037206a00,0,ffff800037206ac0) at sendit+0x721 sys/kern/uipc_syscalls.c:786 sys_sendmsg(ffff8000ffff0cd0,ffff800037206b70,ffff800037206ac0) at sys_sendmsg+0x246 sys/kern/uipc_syscalls.c:604 syscall(ffff800037206b70) at syscall+0xbb6 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff800037206b70) at syscall+0xbb6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xfcd9b308ba0, count: -15 ddb{0}> show registers rdi 0 rsi 0x40000 acpi_pdirpa+0x2be71 rbp 0xffff800037206250 rbx 0xfffffd80042c8130 rdx 0xffff8000012a9f00 rcx 0xffff8000ffff0cd0 rax 0x3ffff acpi_pdirpa+0x2be70 r8 0xffff800037206130 r9 0x8080808080808080 r10 0x42a0e2f4ac182ada r11 0x38099290c5be3cbc r12 0 r13 0xfffffd8003adfe00 r14 0x3 r15 0xffffffff rip 0xffffffff812ecd15 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff800037206240 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor) tid=346813 pid=34300 tcnt=2 stat=onproc flags process=10 proc=4000000 runpri=32, usrpri=50, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff8000ffff1c00,0xffff8000ffff2a50 process=0xffff8000fffed6c8 user=0xffff800037201000, vmspace=0xfffffd806b8ae8e8 estcpu=36, cpticks=0, pctcpu=0.0, user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 85250 414781 29053 0 2 0 syz-executor 85250 389635 29053 0 3 0x4000080 fsleep syz-executor 34300 142304 79310 0 2 0x10 syz-executor *34300 346813 79310 0 7 0x4000010 syz-executor 68081 418449 81277 0 2 0 syz-executor 68081 48533 81277 0 3 0x4000080 msgwait syz-executor 68081 395076 81277 0 2 0x4000000 syz-executor 25349 181245 99996 0 2 0 syz-executor 25349 176474 99996 0 2 0x4000000 syz-executor 25349 94234 99996 0 2 0x4000000 syz-executor 25349 170267 99996 0 2 0x4000000 syz-executor 29082 455278 38538 0 2 0x10 syz-executor 29082 52086 38538 0 3 0x4000090 fsleep syz-executor 29082 349617 38538 0 3 0x4000090 fsleep syz-executor 24596 154392 70476 0 3 0x80 nanoslp syz-executor 24596 135774 70476 0 3 0x4000080 msgwait syz-executor 75387 293580 13883 0 3 0x80 nanoslp syz-executor 75387 500896 13883 0 3 0x4000080 kqsel syz-executor 75387 76957 13883 0 3 0x4000080 fsleep syz-executor 98025 9246 0 0 3 0x14200 bored sosplice 13249 359415 1 0 3 0x100083 ttyin getty 9984 498405 60903 0 3 0x100082 sbwait arp 60903 187773 2754 0 3 0x10008a sigsusp sh 79310 451419 337 0 3 0x82 nanoslp syz-executor 29053 75822 337 0 3 0x82 nanoslp syz-executor 13883 469488 337 0 3 0x82 nanoslp syz-executor 99996 401927 337 0 3 0x82 nanoslp syz-executor 81277 263577 337 0 3 0x82 nanoslp syz-executor 2754 240086 337 0 3 0x82 wait syz-executor 70476 213386 337 0 3 0x82 nanoslp syz-executor 38538 442708 337 0 3 0x82 nanoslp syz-executor 337 115306 94020 0 3 0x82 kqread syz-executor 94020 517008 37928 0 3 0x10008a sigsusp ksh 37928 167137 97965 0 3 0x98 kqread sshd-session 97965 64946 38430 0 3 0x92 kqread sshd-session 38430 285068 1 0 3 0x88 kqread sshd 32555 517534 70245 74 3 0x1100092 bpf pflogd 70245 467625 1 0 3 0x80 sbwait pflogd 94725 427663 52704 73 3 0x1100090 kqread syslogd 52704 253659 1 0 3 0x100082 sbwait syslogd 84044 119005 1 0 3 0x100080 kqread resolvd 5829 340349 6393 77 3 0x100092 kqread dhcpleased 29371 307993 6393 77 3 0x100092 kqread dhcpleased 6393 215558 1 0 3 0x80 kqread dhcpleased 85798 296644 0 0 3 0x14200 bored smr 65290 87366 0 0 2 0x14200 zerothread 48740 216973 0 0 3 0x14200 aiodoned aiodoned 78423 368870 0 0 3 0x14200 syncer update 66647 31143 0 0 3 0x14200 cleaner cleaner 29541 447229 0 0 3 0x14200 reaper reaper 2374 102832 0 0 3 0x14200 pgdaemon pagedaemon 12169 33950 0 0 3 0x14200 bored viomb 12768 435901 0 0 3 0x40014200 acpi0 acpi0 28165 374544 0 0 7 0x40014200 idle1 35898 195349 0 0 3 0x14200 bored softnet3 5433 279748 0 0 3 0x14200 bored softnet2 84648 315785 0 0 3 0x14200 bored softnet1 34001 45617 0 0 3 0x14200 bored softnet0 81500 74849 0 0 3 0x14200 bored systqmp 43041 217611 0 0 3 0x14200 bored systq 18501 505270 0 0 3 0x14200 tmoslp softclockmp 72736 332864 0 0 3 0x40014200 tmoslp softclock 48035 309558 0 0 3 0x40014200 idle0 1 177012 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 34300 (syz-executor) thread 0xffff8000ffff0cd0 (346813) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff836258d8) #0 witness_lock+0x5bb stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5bb sys/kern/subr_witness.c:1155 #1 unp_connect+0x26c sys/kern/uipc_usrreq.c:868 #2 uipc_dgram_send+0x131 sys/kern/uipc_usrreq.c:607 #3 sosend+0xa40 #4 sendit+0x721 sys/kern/uipc_syscalls.c:786 #5 sys_sendmsg+0x246 sys/kern/uipc_syscalls.c:604 #6 syscall+0xbb6 mi_syscall sys/sys/syscall_mi.h:178 [inline] #6 syscall+0xbb6 sys/arch/amd64/amd64/trap.c:577 #7 Xsyscall+0x128 exclusive rwlock sbufsnd r = 0 (0xffff800010fde9b0) #0 witness_lock+0x5bb stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5bb sys/kern/subr_witness.c:1155 #1 rw_enter+0x41b sys/kern/kern_rwlock.c:309 #2 sblock+0xb7 sys/kern/uipc_socket2.c:549 #3 sosend+0x2ff sys/kern/uipc_socket.c:681 #4 sendit+0x721 sys/kern/uipc_syscalls.c:786 #5 sys_sendmsg+0x246 sys/kern/uipc_syscalls.c:604 #6 syscall+0xbb6 mi_syscall sys/sys/syscall_mi.h:178 [inline] #6 syscall+0xbb6 sys/arch/amd64/amd64/trap.c:577 #7 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10199 11189K 11453K 166960K 11713 0 pcb 18 12K 12K 166960K 51 0 rtable 227 6K 7K 166960K 370 0 pf 35 17K 20K 166960K 60 0 ifaddr 41 7K 7K 166960K 46 0 ifgroup 55 2K 2K 166960K 64 0 counters 64 36K 36K 166960K 70 0 ioctlops 0 0K 4K 166960K 1498 0 iov 0 0K 12K 166960K 12 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1429 90K 90K 166960K 1671 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 6 0 VM map 2 1K 1K 166960K 2 0 sem 12 0K 0K 166960K 16 0 dirhash 12 2K 2K 166960K 18 0 ACPI 1690 195K 286K 166960K 12468 0 file desc 19 69K 97K 166960K 353 0 sigio 0 0K 0K 166960K 9 0 proc 72 91K 140K 166960K 566 0 subproc 104 6K 6K 166960K 104 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 30 0 in_multi 89 6K 6K 166960K 91 0 ether_multi 1 0K 0K 166960K 3 0 mrt 0 0K 0K 166960K 2 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 79 360K 360K 166960K 79 0 exec 0 0K 1K 166960K 391 0 fusefs mount 1 32K 32K 166960K 1 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 255 73K 77K 166960K 4933 0 UVM aobj 10 2K 2K 166960K 10 0 pinsyscall 45 90K 108K 166960K 1427 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 4 0 NDP 12 0K 1K 166960K 29 0 temp 51 6821K 6885K 166960K 27078 0 kqueue 14 22K 26K 166960K 67 0 SYN cache 2 16K 16K 166960K 2 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle plcache 128 24 0 0 1 0 1 1 0 8 0 rtpcb 120 53 0 48 1 0 1 1 0 8 0 rtentry 112 116 0 11 3 0 3 3 0 8 0 unpcb 144 229 0 209 5 3 2 4 0 8 1 syncache 336 5 0 5 3 2 1 1 0 8 1 tcpqe 32 1 0 1 1 0 1 1 0 8 1 tcpcb 808 78 0 73 2 0 2 2 0 8 1 arp 120 22 0 3 1 0 1 1 0 8 0 inpcb 336 356 0 343 7 0 7 7 0 8 5 nd6 136 22 0 0 1 0 1 1 0 8 0 kcovpl 48 8 0 0 1 0 1 1 0 8 0 ppxss 1168 2 0 2 1 0 1 1 0 8 1 pffrag 232 5 0 2 1 0 1 1 0 482 0 pffrnode 88 5 0 2 1 0 1 1 0 8 0 pffrent 40 15 0 12 1 0 1 1 0 8 0 pfosfp 40 1428 0 1005 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pfstitem 24 31 0 0 1 0 1 1 0 8 0 pfstkey 128 31 0 0 1 0 1 1 0 8 0 pfstate 376 31 0 0 4 0 4 4 0 8 0 pfrule 1344 23 0 17 2 0 2 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 423 0 8 27 0 27 27 0 8 0 art_table 32 424 0 8 4 0 4 4 0 8 0 art_node 16 114 0 19 1 0 1 1 0 8 0 sysvmsgpl 40 2 0 2 2 1 1 1 0 8 1 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 12 0 2 1 0 1 1 0 8 0 shmpl 112 7 0 0 1 0 1 1 0 8 0 dirhash 1024 21 0 4 3 0 3 3 0 8 0 dino2pl 256 2017 0 514 95 0 95 95 0 8 0 ffsino 272 2017 0 514 102 0 102 102 0 8 0 nchpl 144 2505 0 821 63 0 63 63 0 8 0 uvmvnodes 80 2299 0 0 47 0 47 47 0 8 0 vnodes 216 2299 0 0 128 0 128 128 0 8 0 namei 1024 8563 0 8562 3 2 1 2 0 8 0 percpumem 16 49 0 3 1 0 1 1 0 8 0 kstatmem 264 30 0 6 2 0 2 2 0 8 0 scxspl 216 7750 0 7750 3 2 1 2 1 8 1 plimitpl 152 118 0 101 1 0 1 1 0 8 0 sigapl 424 655 0 603 7 0 7 7 0 8 0 futexpl 64 3840 0 3836 1 0 1 1 0 8 0 knotepl 120 301 0 0 10 0 10 10 0 8 0 kqueuepl 216 73 0 62 1 0 1 1 0 8 0 pipepl 320 131 0 104 3 0 3 3 0 8 0 fdescpl 496 636 0 603 6 1 5 6 0 8 0 filepl 152 3440 0 3175 17 1 16 16 0 8 5 lockfpl 104 80 0 78 1 0 1 1 0 8 0 lockfspl 48 34 0 32 1 0 1 1 0 8 0 sessionpl 144 25 0 16 1 0 1 1 0 8 0 pgrppl 48 35 0 18 1 0 1 1 0 8 0 ucredpl 104 479 0 464 1 0 1 1 0 8 0 zombiepl 144 603 0 603 1 0 1 1 0 8 1 processpl 1160 655 0 603 5 0 5 5 0 8 0 procpl 648 1007 0 943 6 0 6 6 0 8 0 sockpl 664 643 0 606 14 5 9 9 0 8 5 mcl64k 65536 3 0 0 1 0 1 1 0 8 0 mcl16k 16384 2 0 0 1 0 1 1 0 8 0 mcl12k 12288 1 0 0 1 0 1 1 0 8 0 mcl9k 9216 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 5 0 0 1 0 1 1 0 8 0 mcl4k 4096 163 0 0 21 0 21 21 0 8 0 mcl2k 2048 34 0 0 5 0 5 5 0 8 0 mtagpl 96 9 0 0 1 0 1 1 0 8 0 mbufpl 256 214 0 0 14 0 14 14 0 8 0 bufpl 280 2965 0 100 205 0 205 205 0 8 0 anonpl 24 196373 0 187117 101 1 100 100 0 185 23 amapchunkpl 152 16728 0 16127 40 9 31 31 0 158 6 amappl16 200 5746 0 5443 41 2 39 39 0 8 14 amappl15 192 46 0 46 1 1 0 1 0 8 0 amappl14 184 119 0 106 1 0 1 1 0 8 0 amappl13 176 10 0 10 1 1 0 1 0 8 0 amappl12 168 1286 0 1251 4 1 3 3 0 8 0 amappl11 160 57 0 43 1 0 1 1 0 8 0 amappl10 152 77 0 77 1 1 0 1 0 8 0 amappl9 144 231 0 231 1 1 0 1 0 8 0 amappl8 136 27 0 23 1 0 1 1 0 8 0 amappl7 128 152 0 139 1 0 1 1 0 8 0 amappl6 120 180 0 177 1 0 1 1 0 8 0 amappl5 112 137 0 126 1 0 1 1 0 8 0 amappl4 104 334 0 314 1 0 1 1 0 8 0 amappl3 96 2692 0 2585 3 0 3 3 0 8 0 amappl2 88 906 0 820 3 0 3 3 0 8 0 amappl1 80 8581 0 7987 15 1 14 15 0 8 0 amappl 88 4540 0 4351 5 0 5 5 0 92 0 dma16384 16384 1 0 1 1 0 1 1 0 8 1 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma1024 1024 1 0 0 1 0 1 1 0 8 0 dma256 256 6 0 6 1 1 0 1 0 8 0 dma128 128 253 0 253 1 1 0 1 0 8 0 dma64 64 6 0 6 1 1 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 18 0 17 1 0 1 1 0 8 0 aobjpl 72 9 0 0 1 0 1 1 0 8 0 uaddrrnd 24 636 0 603 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 636 0 603 1 0 1 1 0 8 0 vmmpekpl 168 6731 0 6697 2 0 2 2 0 8 0 vmmpepl 168 49192 0 46963 115 4 111 111 0 357 8 vmsppl 448 635 0 603 6 1 5 5 0 8 0 rwobjpl 56 21083 0 17505 56 0 56 56 0 8 4 pdppl 4096 1279 0 1206 105 32 73 87 0 8 0 pvpl 32 23051 0 0 186 0 186 186 0 265 0 pmappl 248 635 0 603 3 0 3 3 0 8 0 extentpl 40 55 0 38 1 0 1 1 0 8 0 phpool 112 402 0 39 11 0 11 11 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 witness_checkorder(fffffd806bdf0a38,9,0) at witness_checkorder+0x1047 rw_enter(fffffd806bdf0a28,1) at rw_enter+0x122 rrw_enter(fffffd806bdf0a28,1) at rrw_enter+0xbe sys/kern/kern_rwlock.c:464 VOP_LOCK(fffffd806b5dd2d8,2001) at VOP_LOCK+0xa6 sys/kern/vfs_vops.c:524 vn_lock(fffffd806b5dd2d8,2001) at vn_lock+0xa4 sys/kern/vfs_vnops.c:564 vfs_lookup(ffff8000372065f8) at vfs_lookup+0x109 sys/kern/vfs_lookup.c:418 namei(ffff8000372065f8) at namei+0x7aa sys/kern/vfs_lookup.c:250 unp_connect(ffff800010fde808,fffffd806e907e00,ffff8000ffff0cd0) at unp_connect+0x27d sys/kern/uipc_usrreq.c:868 uipc_dgram_send(ffff800010fde808,fffffd807adaad00,fffffd806e907e00,0) at uipc_dgram_send+0x131 sys/kern/uipc_usrreq.c:607 sosend(ffff800010fde808,fffffd806e907e00,ffff800037206888,0,0,0) at sosend+0xa40 sendit(ffff8000ffff0cd0,6,ffff800037206a00,0,ffff800037206ac0) at sendit+0x721 sys/kern/uipc_syscalls.c:786 sys_sendmsg(ffff8000ffff0cd0,ffff800037206b70,ffff800037206ac0) at sys_sendmsg+0x246 sys/kern/uipc_syscalls.c:604 syscall(ffff800037206b70) at syscall+0xbb6 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff800037206b70) at syscall+0xbb6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xfcd9b308ba0, count: -15 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x27: addq $0x8,%rsp ddb{1}> trace x86_ipi_db(ffff800029b7bff0) at x86_ipi_db+0x27 sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xd9 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x27 acpicpu_idle() at acpicpu_idle+0x41e sys/dev/acpi/acpicpu.c:1218 sched_idle(ffff800029b7bff0) at sched_idle+0x558 sys/kern/kern_sched.c:182 end trace frame: 0x0, count: -5