syzbot


assert "tname->un_flags &panic: kernel diagnostic assertion "!_kernel_lock_held()" failed in kern_fork.c

Status: closed as dup on 2019/03/26 06:42
Reported-by: syzbot+689c0393af5699fc7057@syzkaller.appspotmail.com
First crash: 1235d, last: 1235d
Duplicate of (1):
Title Repro Cause bisect Fix bisect Count Last Reported
assert "tname->un_flags & UNVEIL_USERSET" failed in kern_unveil.c C 1447 1234d 1237d

Sample crash report:
panic: kernel diagnostic assertion "tname->un_flags &panic: kernel diagnostic assertion "!_kernel_lock_held()" failed: file "/syzkaller/managers/multicore/kernel/sys/kern/kern_fork.c", line 689
Stopped at      db_enter+0x18:  addq    $0x8,%rsp
    TID    PID    UID     PRFLAGS     PFLAGS  CPU  COMMAND
* 27584  31622      0           0  0x4000000    1  syz-executor.1
 280142  78788      0           0  0x4000000    0  syz-executor.0
db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398
panic() at panic+0x174 sys/kern/subr_prf.c:208
__assert(ffffffff81f7e6d6,ffffffff81f69c32,2b1,ffffffff81f4f134) at __assert+0x2e sys/kern/subr_prf.c:155
proc_trampoline_mp() at proc_trampoline_mp+0x13b
end trace frame: 0x0, count: 11
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}> 
ddb{1}> set $lines = 0
ddb{1}> set $maxwidth = 0
ddb{1}> show panic
kernel diagnostic assertion "tname->un_flags & UNVEIL_USERSET" failed: file "/syzkaller/managers/multicore/kernel/sys/kern/kern_unveil.c", line 879
ddb{1}> trace
db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398
panic() at panic+0x174 sys/kern/subr_prf.c:208
__assert(ffffffff81f7e6d6,ffffffff81f69c32,2b1,ffffffff81f4f134) at __assert+0x2e sys/kern/subr_prf.c:155
proc_trampoline_mp() at proc_trampoline_mp+0x13b
end trace frame: 0x0, count: -4
ddb{1}> show registers
rdi                                0
rsi                              0x1
rbp               0xffff800020c64fb0
rbx               0xffff800020c65060
rdx               0xffffffff81f8c339    apollo_pio_rec+0x95b5
rcx                                0
rax                                0
r8                0xffffffff818d1a13    kprintf+0x183
r9                               0x1
r10                             0x25
r11               0x73db6a0304fdca40
r12                     0x3000000008
r13               0xffff800020c64fc0
r14                            0x104
r15                              0x1
rip               0xffffffff814367b8    db_enter+0x18
cs                               0x8
rflags                         0x246
rsp               0xffff800020c64fa0
ss                              0x10
db_enter+0x18:  addq    $0x8,%rsp
ddb{1}> show proc
PROC (syz-executor.1) pid=27584 stat=onproc
    flags process=0 proc=4000000<THREAD>
    pri=86, usrpri=86, nice=20
    forw=0xffffffffffffffff, list=0xffff800020b9b788,0xffff800020b9a4d8
    process=0xffff800020b8c018 user=0xffff800020c60000, vmspace=0xfffffd807effdca8
    estcpu=36, cpticks=1, pctcpu=0.0
    user=0, sys=1, intr=0
ddb{1}> ps
   PID     TID   PPID    UID  S       FLAGS  WAIT          COMMAND
 31622   26882  81094      0  2           0                syz-executor.1
 31622  363967  81094      0  2   0x4000000                syz-executor.1
*31622   27584  81094      0  7   0x4000000                syz-executor.1
 31622   10951  81094      0  2   0x4000000                syz-executor.1
 78788  420230  13738      0  2           0                syz-executor.0
 78788  280142  13738      0  7   0x4000000                syz-executor.0
 13738  453111   1058      0  3        0x82  nanosleep     syz-executor.0
 81094  279506   1058      0  3        0x82  nanosleep     syz-executor.1
  2224  346547      0      0  3     0x14200  bored         sosplice
  1058  421743  39619      0  3        0x82  thrsleep      syz-fuzzer
  1058  363767  39619      0  3   0x4000082  thrsleep      syz-fuzzer
  1058  280788  39619      0  3   0x4000082  thrsleep      syz-fuzzer
  1058   70505  39619      0  3   0x4000082  thrsleep      syz-fuzzer
  1058  145557  39619      0  3   0x4000082  thrsleep      syz-fuzzer
  1058  340504  39619      0  3   0x4000082  thrsleep      syz-fuzzer
  1058  441445  39619      0  3   0x4000082  thrsleep      syz-fuzzer
  1058  314181  39619      0  3   0x4000082  kqread        syz-fuzzer
  1058  203439  39619      0  3   0x4000082  thrsleep      syz-fuzzer
  1058  466307  39619      0  3   0x4000082  thrsleep      syz-fuzzer
 39619  164755  40717      0  3    0x10008a  pause         ksh
 40717  169918  92673      0  3        0x92  select        sshd
  4238  105302      1      0  3    0x100083  ttyin         getty
 92673  357275      1      0  3        0x80  select        sshd
 20925  460789  78193     74  3    0x100092  bpf           pflogd
 78193  402296      1      0  3        0x80  netio         pflogd
 72492  364186  46684     73  3    0x100090  kqread        syslogd
 46684  495529      1      0  3    0x100082  netio         syslogd
 47081    6184      1     77  3    0x100090  poll          dhclient
 74690   40161      1      0  3        0x80  poll          dhclient
 43708  376583      0      0  2     0x14200                zerothread
  6025  167506      0      0  3     0x14200  aiodoned      aiodoned
 73124  477963      0      0  3     0x14200  syncer        update
 96705  306501      0      0  3     0x14200  cleaner       cleaner
 39781  228467      0      0  3     0x14200  reaper        reaper
 85250  150027      0      0  3     0x14200  pgdaemon      pagedaemon
 44930   48025      0      0  3     0x14200  bored         crynlk
 91768  415187      0      0  3     0x14200  bored         crypto
 14042  159102      0      0  3  0x40014200  acpi0         acpi0
 83981  180660      0      0  3  0x40014200                idle1
 19109  334109      0      0  3     0x14200  bored         softnet
 70622  127628      0      0  3     0x14200  bored         systqmp
 48237  494671      0      0  3     0x14200  bored         systq
  4650  515955      0      0  3  0x40014200  bored         softclock
 80648  403872      0      0  3  0x40014200                idle0
  5200  155208      0      0  3     0x14200  bored         smr
     1   53828      0      0  3        0x82  wait          init
     0       0     -1      0  3     0x10200  scheduler     swapper
ddb{1}> show all locks
Process 31622 (syz-executor.1) thread 0xffff800020b9b788 (363967)
exclusive rrwlock inode r = 0 (0xfffffd807daeca28) locked @ /syzkaller/managers/multicore/kernel/sys/ufs/ufs/ufs_vnops.c:1547
#0  witness_lock+0x594 sys/kern/subr_witness.c:1201
#1  _rw_enter+0x45d sys/kern/kern_rwlock.c:280
#2  _rrw_enter+0x60 sys/kern/kern_rwlock.c:410
#3  VOP_LOCK+0x57 sys/kern/vfs_vops.c:602
#4  vn_write+0x169 vn_lock sys/kern/vfs_vnops.c:549 [inline]
#4  vn_write+0x169 sys/kern/vfs_vnops.c:393
#5  dofilewritev+0x1b0 sys/kern/sys_generic.c:364
#6  sys_pwritev+0xd9 sys/kern/vfs_syscalls.c:3161
#7  syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline]
#7  syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574
#8  Xsyscall+0x128
Process 78788 (syz-executor.0) thread 0xffff800020b9a720 (280142)
exclusive rrwlock inode r = 0 (0xfffffd806e227f78) locked @ /syzkaller/managers/multicore/kernel/sys/ufs/ufs/ufs_vnops.c:1547
#0  witness_lock+0x594 sys/kern/subr_witness.c:1201
#1  _rw_enter+0x45d sys/kern/kern_rwlock.c:280
#2  _rrw_enter+0x60 sys/kern/kern_rwlock.c:410
#3  VOP_LOCK+0x57 sys/kern/vfs_vops.c:602
#4  vn_lock+0x6e sys/kern/vfs_vnops.c:549
#5  vget+0x1c3 sys/kern/vfs_subr.c:672
#6  cache_lookup+0x300 sys/kern/vfs_cache.c:224
#7  ufs_lookup+0x1d7 sys/ufs/ufs/ufs_lookup.c:162
#8  VOP_LOOKUP+0x67 sys/kern/vfs_vops.c:90
#9  vfs_lookup+0x556 sys/kern/vfs_lookup.c:523
#10 namei+0x4b2 sys/kern/vfs_lookup.c:224
#11 sys_chdir+0x82 change_dir sys/kern/vfs_syscalls.c:856 [inline]
#11 sys_chdir+0x82 sys/kern/vfs_syscalls.c:802
#12 syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline]
#12 syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574
#13 Xsyscall+0x128
exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82349ce8) locked @ /syzkaller/managers/multicore/kernel/sys/sys/syscall_mi.h:90
#0  witness_lock+0x594 sys/kern/subr_witness.c:1201
#1  syscall+0x48b mi_syscall sys/sys/syscall_mi.h:91 [inline]
#1  syscall+0x48b sys/arch/amd64/amd64/trap.c:574
#2  Xsyscall+0x128
ddb{1}> show malloc
           Type InUse  MemUse  HighUse   Limit  Requests Type Lim Kern Lim
         devbuf  9519   6413K    6439K  78643K     10830        0        0
            pcb    25      9K      11K  78643K       350        0        0
         rtable   100      3K       4K  78643K       508        0        0
         ifaddr    58     13K      14K  78643K       157        0        0
       counters    39     33K      33K  78643K        39        0        0
       ioctlops     0      0K       4K  78643K      1482        0        0
            iov     1     12K      24K  78643K        88        0        0
          mount     1      1K       1K  78643K         1        0        0
         vnodes  1188     74K      75K  78643K      1576        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        20        0        0
         VM map     2      1K       1K  78643K         2        0        0
            sem    12      1K       1K  78643K       857        0        0
        dirhash    12      2K       2K  78643K        12        0        0
           ACPI  1808    196K     290K  78643K     12628        0        0
      file desc     6     17K      21K  78643K      1652        0        0
          sigio     0      0K       0K  78643K         6        0        0
           proc    57     63K      71K  78643K       529        0        0
        subproc    64  65538K   67586K  78643K       308        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        58        0        0
       in_multi    33      2K       2K  78643K       125        0        0
    ether_multi     1      0K       0K  78643K         4        0        0
            mrt     0      0K       0K  78643K         1        0        0
    ISOFS mount     1     32K      32K  78643K         1        0        0
  MSDOSFS mount     1     16K      16K  78643K         1        0        0
           ttys    72    318K     318K  78643K        72        0        0
           exec     0      0K       1K  78643K       274        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    83     20K      29K  78643K      5436        0        0
       UVM aobj    48      2K       2K  78643K        50        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        28        0        0
            NDP    12      0K       0K  78643K        51        0        0
           temp   171   2375K    2441K  78643K      8255        0        0
         kqueue     0      0K       0K  78643K         9        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       11    0        7     1     0     1     1     0     8    0
inpcbpl    280      284    0      276     1     0     1     1     0     8    0
plimitpl   152       44    0       36     1     0     1     1     0     8    0
plcache    128       20    0        0     1     0     1     1     0     8    0
rtentry    112      104    0       64     2     0     2     2     0     8    0
syncache   264        4    0        4     1     1     0     1     0     8    0
tcpcb      544      115    0      110     1     0     1     1     0     8    0
nd6         48       18    0       14     1     0     1     1     0     8    0
ppxss      1128      12    0       12     4     3     1     1     0     8    1
pfosfp      40      846    0      423     5     0     5     5     0     8    0
pfosfpen   112     1428    0      714    21     0    21    21     0     8    0
pfstitem    24       32    0       19     1     0     1     1     0     8    0
pfstkey    112       32    0       19     1     0     1     1     0     8    0
pfstate    328       32    0       19     2     0     2     2     0     8    0
pfrule     1360      21    0       16     2     1     1     2     0     8    0
art_heap8  4096       1    0        0     1     0     1     1     0     8    0
art_heap4  256      478    0      290    12     0    12    12     0     8    0
art_table   32      479    0      290     2     0     2     2     0     8    0
art_node    16      103    0       69     1     0     1     1     0     8    0
sysvmsgpl   40       34    0        3     1     0     1     1     0     8    0
semapl     112      855    0      845     1     0     1     1     0     8    0
shmpl      112       48    0        2     2     0     2     2     0     8    0
dirhash    1024      17    0        0     3     0     3     3     0     8    0
dino1pl    128     3976    0     2537    47     0    47    47     0     8    0
ffsino     272     3976    0     2537    97     0    97    97     0     8    0
nchpl      144     6663    0     5002    62     0    62    62     0     8    0
uvmvnodes   72     4169    0        0    76     0    76    76     0     8    0
vnodes     200     4169    0        0   220     0   220   220     0     8    0
namei      1024   17588    0    17587     2     1     1     1     0     8    0
percpumem   16       30    0        0     1     0     1     1     0     8    0
scxspl     192    19107    0    19107    12    11     1     6     0     8    1
sigapl     432     1830    0     1814     2     0     2     2     0     8    0
futexpl     56    18311    0    18311     2     1     1     1     0     8    1
knotepl    112      298    0      279     1     0     1     1     0     8    0
kqueuepl   104      171    0      169     1     0     1     1     0     8    0
pipepl     112     2202    0     2183     2     1     1     2     0     8    0
fdescpl    488     1831    0     1814     3     0     3     3     0     8    0
filepl     152     8083    0     7981     8     3     5     6     0     8    1
lockfpl    104      237    0      236     4     3     1     1     0     8    0
lockfspl    32      257    0      256     4     3     1     1     0     8    0
sessionpl  112       25    0       14     1     0     1     1     0     8    0
pgrppl      48       34    0       23     1     0     1     1     0     8    0
ucredpl     96     2377    0     2368     1     0     1     1     0     8    0
zombiepl   144     1814    0     1814     2     1     1     1     0     8    1
processpl  840     1847    0     1814     4     0     4     4     0     8    0
procpl     600     4635    0     4589     4     0     4     4     0     8    0
srpgc       64       42    0       42     3     3     0     1     0     8    0
sosppl     128        2    0        2     1     1     0     1     0     8    0
sockpl     384      593    0      573     8     4     4     4     0     8    2
mcl64k     65536    258    0        0    33     0    33    33     0     8    0
mcl16k     16384      1    0        0     1     0     1     1     0     8    0
mcl12k     12288     16    0        0     2     0     2     2     0     8    0
mcl9k      9216       5    0        0     1     0     1     1     0     8    0
mcl8k      8192       4    0        0     1     0     1     1     0     8    0
mcl4k      4096      12    0        0     2     0     2     2     0     8    0
mcl2k2     2112       2    0        0     1     0     1     1     0     8    0
mcl2k      2048     116    0        0    14     0    14    14     0     8    0
mtagpl      80        1    0        0     1     0     1     1     0     8    0
mbufpl     256      409    0        0    23     0    23    23     0     8    0
bufpl      256     8615    0     1591   440     0   440   440     0     8    0
anonpl      16   156886    0   147928    73    23    50    50     0   125   13
amapchunkpl 152    8662    0     8565    13     8     5     9     0   158    0
amappl16   192     8006    0     7547    52    21    31    35     0     8    8
amappl15   184      682    0      677     1     0     1     1     0     8    0
amappl14   176       60    0       57     1     0     1     1     0     8    0
amappl13   168     1220    0     1215     1     0     1     1     0     8    0
amappl12   160       17    0       16     1     0     1     1     0     8    0
amappl11   152      573    0      558     1     0     1     1     0     8    0
amappl10   144      151    0      148     1     0     1     1     0     8    0
amappl9    136      723    0      719     1     0     1     1     0     8    0
amappl8    128      360    0      344     1     0     1     1     0     8    0
amappl7    120      125    0      119     1     0     1     1     0     8    0
amappl6    112       66    0       57     1     0     1     1     0     8    0
amappl5    104      284    0      270     1     0     1     1     0     8    0
amappl4     96     2210    0     2178     2     1     1     2     0     8    0
amappl3     88      179    0      173     1     0     1     1     0     8    0
amappl2     80    16081    0    16017     2     0     2     2     0     8    0
amappl1     72    45337    0    44858    25    15    10    20     0     8    0
amappl      72     4923    0     4885     1     0     1     1     0    75    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       49    0        2     1     0     1     1     0     8    0
uaddrrnd    24     1831    0     1814     1     0     1     1     0     8    0
uaddrbest   32        2    0        0     1     0     1     1     0     8    0
uaddr       24     1831    0     1814     1     0     1     1     0     8    0
vmmpekpl   168    20354    0    20328     2     0     2     2     0     8    0
vmmpepl    168   193642    0   192067   109    31    78    79     0   357    9
vmsppl     360     1830    0     1814     2     0     2     2     0     8    0
pdppl      4096    3670    0     3628     6     0     6     6     0     8    0
pvpl        32   465782    0   453457   175    44   131   131     0   265   31
pmappl     224     1830    0     1814     3     2     1     2     0     8    0
extentpl    40       39    0       25     1     0     1     1     0     8    0
phpool     112      640    0        4    19     0    19    19     0     8    0

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-openbsd-multicore 2019/03/26 05:19 openbsd 6a51f920f2c9 55684ce1 .config log report