syzbot


witness: userret: returningwitness: thread ADDR exiting with the following locks held:

Status: closed as dup on 2019/06/22 20:47
Reported-by: syzbot+6309ebc80865f4095152@syzkaller.appspotmail.com
First crash: 1318d, last: 1318d
Duplicate of (1):
Title Repro Cause bisect Fix bisect Count Last Reported
witness: userret: returning with the following locks held: C 315 1253d 1463d

Sample crash report:
witness: userret: returningwitness: thread 0xffff800020b39650 exiting with the following locks held:
 with the following locks held:
exclusive rrwlock inodeexclusive rrwlock inode r = 0 (0xfffffd807e0a0b48)
 r = 0 (0xfffffd807e0a0b48)
#0  #0  witness_lockwitness_lock+0x52e+0x52e

#1  #1  rw_enterrw_enter+0x46d+0x46d

#2  #2  rrw_enterrrw_enter+0x4f+0x4f

#3  #3  VOP_LOCKVOP_LOCK+0x4b+0x4b

#4  #4  vn_writevn_lock+0x169+0x6e

#5  #5  dofilewritevdovchflags+0x1ac+0x3f

#6  #6  sys_writesyscall+0x83+0x552

#7  #7  syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline]Xsyscall
#7  #7  syscall+0x552 sys/arch/amd64/amd64/trap.c:554Xsyscall
+0x128#8  
panic: witness_warXnsy
s
caStopped at      db_enter+0x18:  addq    $0x8,%rsp
    TID    PID    UID     PRFLAGS     PFLAGS  CPU  COMMAND
*248882  88081  32767      0x1010  0x4080000    1  syz-executor.1
 180675  84227      0     0x14000      0x200    0  reaper
db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398
panic() at panic+0x15c sys/kern/subr_prf.c:212
witness_warn(2,0,ffffffff81fac6a5) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline]
witness_warn(2,0,ffffffff81fac6a5) at witness_warn+0x69e sys/kern/subr_witness.c:1454
userret(ffff800020b39160) at userret+0x36a sys/kern/kern_sig.c:1911
syscall(ffff800025065ef0) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline]
syscall(ffff800025065ef0) at syscall+0x44a sys/arch/amd64/amd64/trap.c:576
Xsyscall(6,9,fffffffffffffedf,0,2,ab8cbb41280) at Xsyscall+0x128
end of kernel
end trace frame: 0xabb57ad88a0, count: 9
https://www.openbsd.org/ddb.html describes the minimum info required in bug
reports.  Insufficient info makes it difficult to find and fix bugs.
ddb{1}> set $lines = 0
ddb{1}> set $maxwidth = 0
ddb{1}> show panic
witness_warn
ddb{1}> trace
db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398
panic() at panic+0x15c sys/kern/subr_prf.c:212
witness_warn(2,0,ffffffff81fac6a5) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline]
witness_warn(2,0,ffffffff81fac6a5) at witness_warn+0x69e sys/kern/subr_witness.c:1454
userret(ffff800020b39160) at userret+0x36a sys/kern/kern_sig.c:1911
syscall(ffff800025065ef0) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline]
syscall(ffff800025065ef0) at syscall+0x44a sys/arch/amd64/amd64/trap.c:576
Xsyscall(6,9,fffffffffffffedf,0,2,ab8cbb41280) at Xsyscall+0x128
end of kernel
end trace frame: 0xabb57ad88a0, count: -6
ddb{1}> show registers
rdi                                0
rsi                          0x3ffff    acpi_pdirpa+0x2be67
rbp               0xffff800025065c30
rbx               0xffff800025065ce0
rdx                          0x40000    acpi_pdirpa+0x2be68
rcx               0xffff800023406000
rax               0xffff8000009eeb00
r8                0xffffffff81957ee3    kprintf+0x173
r9                               0x1
r10                             0x25
r11               0xd4ef582b52890f08
r12                     0x3000000008
r13               0xffff800025065c40
r14                            0x100
r15                              0x1
rip               0xffffffff8129bf48    db_enter+0x18
cs                               0x8
rflags                         0x246
rsp               0xffff800025065c20
ss                              0x10
db_enter+0x18:  addq    $0x8,%rsp
ddb{1}> show proc
PROC (syz-executor.1) pid=248882 stat=onproc
    flags process=1010<SUGID,SINGLEEXIT> proc=4080000<SUSPSINGLE,THREAD>
    pri=32, usrpri=82, nice=20
    forw=0xffffffffffffffff, list=0xffff800020b38780,0xffffffff82368ea8
    process=0xffff800020b8ca80 user=0xffff800025060000, vmspace=0xfffffd807effe450
    estcpu=32, cpticks=7, pctcpu=0.0
    user=0, sys=6, intr=0
ddb{1}> ps
   PID     TID   PPID    UID  S       FLAGS  WAIT          COMMAND
 88081   38780  38984  32767  3      0x3010  suspend       syz-executor.1
 88081  196109  38984  32767  2   0x4081010                syz-executor.1
*88081  248882  38984  32767  7   0x4081010                syz-executor.1
 38984  419751  83502  32767  2       0x490                syz-executor.1
 83502   25399  64252      0  3        0x82  wait          syz-executor.1
 78615  481447  36787  32767  2       0x490                syz-executor.0
 36787    4804  64252      0  3        0x82  wait          syz-executor.0
  1252  476307      0      0  3     0x14200  bored         sosplice
 64252  433639  16243      0  3        0x82  thrsleep      syz-fuzzer
 64252  512120  16243      0  3   0x4000082  thrsleep      syz-fuzzer
 64252  247532  16243      0  3   0x4000082  thrsleep      syz-fuzzer
 64252     889  16243      0  3   0x4000082  thrsleep      syz-fuzzer
 64252  413278  16243      0  3   0x4000082  thrsleep      syz-fuzzer
 64252   29699  16243      0  3   0x4000082  thrsleep      syz-fuzzer
 64252  429670  16243      0  3   0x4000082  kqread        syz-fuzzer
 64252  428774  16243      0  3   0x4000082  thrsleep      syz-fuzzer
 64252   85347  16243      0  3   0x4000082  thrsleep      syz-fuzzer
 64252  340536  16243      0  3   0x4000082  thrsleep      syz-fuzzer
 16243   72815  90790      0  3    0x10008a  pause         ksh
 90790  117775  51599      0  3        0x92  select        sshd
 54940  306473      1      0  2    0x100083                getty
 51599  436585      1      0  3        0x80  select        sshd
 77303  447632  69678     73  2    0x100090                syslogd
 69678  437648      1      0  3    0x100082  netio         syslogd
 49955  502171      1     77  3    0x100090  poll          dhclient
 88383  238836      1      0  3        0x80  poll          dhclient
 79485  202603      0      0  2     0x14200                zerothread
 80841  207609      0      0  3     0x14200  aiodoned      aiodoned
 39085  140051      0      0  3     0x14200  syncer        update
 28869  370423      0      0  3     0x14200  cleaner       cleaner
 84227  180675      0      0  7     0x14200                reaper
 20743  159803      0      0  3     0x14200  pgdaemon      pagedaemon
 78427   69144      0      0  3     0x14200  bored         crynlk
  6106  289227      0      0  3     0x14200  bored         crypto
 51303  264739      0      0  3  0x40014200  acpi0         acpi0
 17721  419174      0      0  3  0x40014200                idle1
 73072   29247      0      0  3     0x14200  bored         softnet
 49177  135103      0      0  3     0x14200  bored         systqmp
 58302   57405      0      0  3     0x14200  bored         systq
 51203  406447      0      0  2  0x40014200                softclock
 85692  132612      0      0  3  0x40014200                idle0
 89529   60044      0      0  3     0x14200  bored         smr
     1  464908      0      0  3        0x82  wait          init
     0       0     -1      0  3     0x10200  scheduler     swapper
ddb{1}> show all locks
Process 88081 (syz-executor.1) thread 0xffff800020b39160 (248882)
exclusive rrwlock inode r = 0 (0xfffffd807e0a0b48)
#0  witness_lock+0x52e sys/kern/subr_witness.c:1163
#1  rw_enter+0x46d sys/kern/kern_rwlock.c:306
#2  rrw_enter+0x4f sys/kern/kern_rwlock.c:435
#3  VOP_LOCK+0x4b sys/kern/vfs_vops.c:602
#4  vn_lock+0x6e sys/kern/vfs_vnops.c:549
#5  dovchflags+0x3f sys/kern/vfs_syscalls.c:2185
#6  syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline]
#6  syscall+0x552 sys/arch/amd64/amd64/trap.c:554
#7  Xsyscall+0x128
ddb{1}> show malloc
           Type InUse  MemUse  HighUse   Limit  Requests Type Lim Kern Lim
         devbuf  9460   6321K    6321K  78643K     12187        0        0
            pcb    23      9K      11K  78643K      7880        0        0
         rtable   105      3K       3K  78643K     14841        0        0
         ifaddr    37     18K      21K  78643K      2016        0        0
       counters    39     33K      33K  78643K        39        0        0
       ioctlops     0      0K       2K  78643K       745        0        0
            iov     0      0K      32K  78643K      1262        0        0
          mount     1      1K       1K  78643K         1        0        0
         vnodes  1215     76K      76K  78643K      9785        0        0
      UFS quota     1     32K      32K  78643K         1        0        0
      UFS mount     5     36K      36K  78643K         5        0        0
            shm     2      1K       5K  78643K       197        0        0
         VM map     2      1K       1K  78643K         2        0        0
            sem    12      0K       0K  78643K      1361        0        0
        dirhash    12      2K       2K  78643K        12        0        0
           ACPI  1808    196K     290K  78643K     12765        0        0
      file desc     7     21K      33K  78643K     32557        0        0
          sigio     0      0K       0K  78643K       219        0        0
           proc    41     38K      70K  78643K     15195        0        0
        subproc    34      2K       2K  78643K      5610        0        0
    NFS srvsock     1      0K       0K  78643K         1        0        0
     NFS daemon     1     16K      16K  78643K         1        0        0
    ip_moptions     0      0K       0K  78643K      2029        0        0
       in_multi    33      2K       2K  78643K      4147        0        0
    ether_multi     1      0K       0K  78643K       102        0        0
    ISOFS mount     1     32K      32K  78643K         1        0        0
  MSDOSFS mount     1     16K      16K  78643K         1        0        0
           ttys    60    265K     265K  78643K        60        0        0
           exec     0      0K       1K  78643K     35448        0        0
        pagedep     1      8K       8K  78643K         1        0        0
       inodedep     1     32K      32K  78643K         1        0        0
         newblk     1      0K       0K  78643K         1        0        0
        VM swap     7     26K      26K  78643K         7        0        0
       UVM amap   134     23K      33K  78643K    120450        0        0
       UVM aobj   130      4K       4K  78643K       162        0        0
        memdesc     1      4K       4K  78643K         1        0        0
    crypto data     1      1K       1K  78643K         1        0        0
    ip6_options     0      0K       0K  78643K       953        0        0
            NDP     5      0K       0K  78643K       993        0        0
           temp   121   2738K    2834K  78643K    107561        0        0
         kqueue     0      0K       0K  78643K       163        0        0
      SYN cache     2     16K      16K  78643K         2        0        0
ddb{1}> show all pools
Name      Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle
arp         64      662    0      656     1     0     1     1     0     8    0
inpcbpl    280     8282    0     8275     1     0     1     1     0     8    0
plcache    128       20    0        0     1     0     1     1     0     8    0
rtentry    112     3653    0     3609     2     0     2     2     0     8    0
syncache   264        4    0        4     1     1     0     1     0     8    0
tcpqe       32       13    0       13     2     2     0     1     0     8    0
tcpcb      544     3155    0     3151     1     0     1     1     0     8    0
ipq         40        2    0        2     1     1     0     1     0     8    0
ipqe        40        4    0        4     1     1     0     1     0     8    0
nd6         48      990    0      984     1     0     1     1     0     8    0
art_heap8  4096       1    0        0     1     0     1     1     0     8    0
art_heap4  256    15688    0    15493    15     2    13    13     0     8    0
art_table   32    15689    0    15493     2     0     2     2     0     8    0
art_node    16     3652    0     3612     1     0     1     1     0     8    0
sysvmsgpl   40       40    0       24     1     0     1     1     0     8    0
semapl     112     1355    0     1345     1     0     1     1     0     8    0
shmpl      112      160    0       32     4     0     4     4     0     8    0
dirhash    1024      17    0        0     3     0     3     3     0     8    0
dino1pl    128    34466    0    32761    59     3    56    56     0     8    0
ffsino     272    34466    0    32761   123     9   114   114     0     8    0
nchpl      144    99828    0    98198    61     0    61    61     0     8    0
uvmvnodes   72     5926    0        0   108     0   108   108     0     8    0
vnodes     200     5926    0        0   312     0   312   312     0     8    0
namei      1024  254181    0   254181     3     2     1     1     0     8    1
percpumem   16       30    0        0     1     0     1     1     0     8    0
scxspl     192   203842    0   203842    79    76     3     6     0     8    3
plimitpl   152     2413    0     2404     1     0     1     1     0     8    0
sigapl     432    31744    0    31729     5     3     2     3     0     8    0
futexpl     56   632570    0   632570     3     2     1     1     0     8    1
knotepl    112    10349    0    10330     1     0     1     1     0     8    0
kqueuepl   104    33873    0    33871     1     0     1     1     0     8    0
pipepl     112    11102    0    11083    35    34     1     2     0     8    0
fdescpl    488    31745    0    31729     3     0     3     3     0     8    0
filepl     152   145185    0   145084    49    44     5     7     0     8    1
lockfpl    104     3087    0     3087    54    53     1     1     0     8    1
lockfspl    48     1007    0     1007    54    53     1     1     0     8    1
sessionpl  112      345    0      335     1     0     1     1     0     8    0
pgrppl      48      503    0      493     1     0     1     1     0     8    0
ucredpl     96    29794    0    29785     1     0     1     1     0     8    0
zombiepl   144    31730    0    31728     4     3     1     1     0     8    0
processpl  896    31761    0    31728     4     0     4     4     0     8    0
procpl     632   106017    0   105972    23    18     5     5     0     8    1
srpgc       64     1968    0     1968    88    87     1     1     0     8    1
sosppl     128      252    0      252    70    69     1     1     0     8    1
sockpl     384    16497    0    16480    37    34     3     4     0     8    1
mcl64k     65536     14    0        0     2     0     2     2     0     8    0
mcl16k     16384     17    0        0     3     1     2     3     0     8    0
mcl12k     12288     57    0        0     2     0     2     2     0     8    0
mcl9k      9216      57    0        0     3     1     2     2     0     8    0
mcl8k      8192      18    0        0     3     1     2     3     0     8    0
mcl4k      4096      82    0        0     4     1     3     3     0     8    0
mcl2k2     2112      19    0        0     2     0     2     2     0     8    0
mcl2k      2048     167    0        0    17     4    13    17     0     8    0
mtagpl      80        1    0        0     1     0     1     1     0     8    0
mbufpl     256     1154    0        0    11     0    11    11     0     8    0
bufpl      256    48530    0    41505   440     0   440   440     0     8    0
anonpl      16  2767336    0  2760695   421   384    37    45     0   125    0
amapchunkpl 152  241518    0   241419   205   200     5    18     0   158    0
amappl16   192   121718    0   121377   623   604    19    30     0     8    1
amappl15   184     3238    0     3234     5     4     1     1     0     8    0
amappl14   176     5164    0     5157     1     0     1     1     0     8    0
amappl13   168     1891    0     1891    54    54     0     1     0     8    0
amappl12   160     1947    0     1941     1     0     1     1     0     8    0
amappl11   152     2753    0     2741     1     0     1     1     0     8    0
amappl10   144    17659    0    17656     3     2     1     1     0     8    0
amappl9    136     6624    0     6621     1     0     1     1     0     8    0
amappl8    128     5549    0     5486     4     1     3     3     0     8    0
amappl7    120    18122    0    18109     1     0     1     1     0     8    0
amappl6    112     1783    0     1769     1     0     1     1     0     8    0
amappl5    104     3870    0     3859     1     0     1     1     0     8    0
amappl4     96    30458    0    30431     1     0     1     1     0     8    0
amappl3     88     5097    0     5087     1     0     1     1     0     8    0
amappl2     80   229191    0   229115     4     1     3     3     0     8    0
amappl1     72   892343    0   891905    23    13    10    19     0     8    0
amappl      80   111380    0   111340     1     0     1     1     0    84    0
dma4096    4096       1    0        1     1     1     0     1     0     8    0
dma256     256        6    0        6     1     1     0     1     0     8    0
dma64       64      259    0      259     1     1     0     1     0     8    0
dma32       32        7    0        7     1     1     0     1     0     8    0
dma16       16       17    0       17     1     1     0     1     0     8    0
aobjpl      64      161    0       32     3     0     3     3     0     8    0
uaddrrnd    24    31745    0    31729     1     0     1     1     0     8    0
uaddrbest   32        2    0        0     1     0     1     1     0     8    0
uaddr       24    31745    0    31729     1     0     1     1     0     8    0
vmmpekpl   168   248166    0   248138     2     0     2     2     0     8    0
vmmpepl    168  4101981    0  4100385   499   421    78    94     0   357    0
vmsppl     368    31744    0    31729     2     0     2     2     0     8    0
pdppl      4096   63498    0    63458     7     1     6     6     0     8    1
pvpl        32  7617292    0  7607387  1103  1000   103   121     0   265   11
pmappl     232    31744    0    31729     7     6     1     2     0     8    0
extentpl    40       41    0       26     1     0     1     1     0     8    0
phpool     112      637    0       23    18     0    18    18     0     8    0

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci-openbsd-setuid 2019/06/22 14:11 openbsd dcaa94fa8333 34bf9440 .config console log report
* Struck through repros no longer work on HEAD.