syzbot


assert "tname->un_flags & UNVEIL_USERSET" failedp:an ifci:l eke rnel diagnostic assertion "!_kernel_lock_held()" failed

Status: closed as dup on 2019/03/25 07:09
Reported-by: syzbot+25ca85dce1b0c8abfdfe@syzkaller.appspotmail.com
First crash: 2069d, last: 2069d
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
assert "tname->un_flags & UNVEIL_USERSET" failed in kern_unveil.c C 1447 2066d 2069d

Sample crash report:
panic: kernel diagnostic assertion "tname->un_flags & UNVEIL_USERSET" failedp:an ifci:l eke rnel diagnostic assertion "!_kernel_lock_held()" failed: file "/syzkaller/managers/setuid/kernel/sys/kern/kern_fork.c", line 689
Stopped at      db_enter+0x18:  addq    $0x8,%rsp
    TID    PID    UID     PRFLAGS     PFLAGS  CPU  COMMAND
 252267   2352  32767        0x10  0x4000000    0  syz-executor.1
* 35881  99934  32767        0x10  0x4000000    1  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(ffffffff81f7dcd5,ffffffff81f56a8f,2b1,ffffffff81f50a83) 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/setuid/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(ffffffff81f7dcd5,ffffffff81f56a8f,2b1,ffffffff81f50a83) 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               0xffff800020c47a60
rbx               0xffff800020c47b10
rdx               0xffffffff81f1fdc9    cmd0646_9_tim_udma+0x134a6
rcx                                0
rax                                0
r8                0xffffffff814ea2c3    kprintf+0x183
r9                               0x1
r10                             0x25
r11               0x3fba948e73652995
r12                     0x3000000008
r13               0xffff800020c47a70
r14                            0x104
r15                              0x1
rip               0xffffffff81c97598    db_enter+0x18
cs                               0x8
rflags                         0x246
rsp               0xffff800020c47a50
ss                              0x10
db_enter+0x18:  addq    $0x8,%rsp
ddb{1}> show proc
PROC (syz-executor.0) pid=35881 stat=onproc
    flags process=10<SUGID> proc=4000000<THREAD>
    pri=80, usrpri=80, nice=20
    forw=0xffffffffffffffff, list=0xffff800020b64018,0xffff800020b65540
    process=0xffff800020b2b078 user=0xffff800020c42000, vmspace=0xfffffd807effe870
    estcpu=36, cpticks=1, pctcpu=0.0
    user=0, sys=1, intr=0
ddb{1}> ps
   PID     TID   PPID    UID  S       FLAGS  WAIT          COMMAND
  2352  240636  15988  32767  2        0x10                syz-executor.1
  2352  252267  15988  32767  7   0x4000010                syz-executor.1
 99934  185974  77852  32767  2        0x10                syz-executor.0
*99934   35881  77852  32767  7   0x4000010                syz-executor.0
 77852  181570  61703  32767  3        0x90  nanosleep     syz-executor.0
 61703  270870  52744      0  3        0x82  wait          syz-executor.0
 15988  426334  16599  32767  3        0x90  nanosleep     syz-executor.1
 16599  469950  52744      0  3        0x82  wait          syz-executor.1
 55881  316155      0      0  3     0x14200  bored         sosplice
 52744   90547  57763      0  3        0x82  thrsleep      syz-fuzzer
 52744   72827  57763      0  3   0x4000082  thrsleep      syz-fuzzer
 52744  466069  57763      0  3   0x4000082  thrsleep      syz-fuzzer
 52744  377574  57763      0  3   0x4000082  thrsleep      syz-fuzzer
 52744  461695  57763      0  3   0x4000082  thrsleep      syz-fuzzer
 52744  465929  57763      0  3   0x4000082  kqread        syz-fuzzer
 52744   64986  57763      0  3   0x4000082  thrsleep      syz-fuzzer
 52744   61870  57763      0  3   0x4000082  thrsleep      syz-fuzzer
 52744  302734  57763      0  3   0x4000082  thrsleep      syz-fuzzer
 52744  168437  57763      0  3   0x4000082  thrsleep      syz-fuzzer
 57763  321399  68831      0  3    0x10008a  pause         ksh
 68831  347223  47174      0  3        0x92  select        sshd
  5727  498637      1      0  3    0x100083  ttyin         getty
 47174  248485      1      0  3        0x80  select        sshd
   305   11325  62838     73  3    0x100090  kqread        syslogd
 62838  354142      1      0  3    0x100082  netio         syslogd
 80942   34965      1     77  3    0x100090  poll          dhclient
 28611  501981      1      0  3        0x80  poll          dhclient
 83597  190632      0      0  2     0x14200                zerothread
 17643  518470      0      0  3     0x14200  aiodoned      aiodoned
 26800   95074      0      0  3     0x14200  syncer        update
 50877  480267      0      0  3     0x14200  cleaner       cleaner
 19086  243851      0      0  3     0x14200  reaper        reaper
 33149   91654      0      0  3     0x14200  pgdaemon      pagedaemon
 51412   32633      0      0  3     0x14200  bored         crynlk
 73040  388540      0      0  3     0x14200  bored         crypto
 13187  465167      0      0  3  0x40014200  acpi0         acpi0
 64725  375076      0      0  3  0x40014200                idle1
 29173  348027      0      0  3     0x14200  bored         softnet
 23813  298259      0      0  3     0x14200  bored         systqmp
 48851  154470      0      0  3     0x14200  bored         systq
  2582  187690      0      0  3  0x40014200  bored         softclock
 79781  338625      0      0  3  0x40014200                idle0
 90794  399379      0      0  3     0x14200  bored         smr
     1   40007      0      0  3        0x82  wait          init
     0       0     -1      0  3     0x10200  scheduler     swapper
ddb{1}> show all locks
Process 2352 (syz-executor.1) thread 0xffff800020b65530 (252267)
exclusive rrwlock inode r = 0 (0xfffffd806911ac58) locked @ /syzkaller/managers/setuid/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  vfs_lookup+0xf5 sys/kern/vfs_lookup.c:387
#6  namei+0x4b2 sys/kern/vfs_lookup.c:224
#7  domknodat+0xa1 sys/kern/vfs_syscalls.c:1405
#8  syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline]
#8  syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574
#9  Xsyscall+0x128
exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82350b68) locked @ /syzkaller/managers/setuid/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  9459   6321K    6321K  78643K     10661        0        0
            pcb    23      9K      11K  78643K       548        0        0
         rtable    97      3K       3K  78643K       912        0        0
         ifaddr    35     10K      10K  78643K       179        0        0
       counters    39     33K      33K  78643K        39        0        0
       ioctlops     0      0K       2K  78643K        46        0        0
            iov     0      0K      24K  78643K        75        0        0
          mount     1      1K       1K  78643K         1        0        0
         vnodes  1201     75K      75K  78643K      1821        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        21        0        0
         VM map     2      1K       1K  78643K         2        0        0
            sem    12      0K       1K  78643K       155        0        0
        dirhash    12      2K       2K  78643K        12        0        0
           ACPI  1808    196K     290K  78643K     12628        0        0
      file desc     8     25K      33K  78643K       934        0        0
          sigio     0      0K       0K  78643K        18        0        0
           proc    48     50K      78K  78643K       814        0        0
        subproc    68  69634K   69634K  78643K       850        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       143        0        0
       in_multi    33      2K       2K  78643K       311        0        0
    ether_multi     1      0K       0K  78643K         7        0        0
    ISOFS mount     1     32K      32K  78643K         1        0        0
  MSDOSFS mount     1     16K      16K  78643K         1        0        0
           ttys    54    238K     238K  78643K        54        0        0
           exec     0      0K       1K  78643K       315        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    88     21K      30K  78643K      3649        0        0
       UVM aobj    90      3K       3K  78643K       100        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        32        0        0
            NDP     5      0K       0K  78643K        78        0        0
           temp   121   2378K    2450K  78643K      6458        0        0
         kqueue     0      0K       0K  78643K        12        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       27    0       23     1     0     1     1     0     8    0
inpcbpl    280      479    0      472     1     0     1     1     0     8    0
plimitpl   152      111    0      102     1     0     1     1     0     8    0
plcache    128       20    0        0     1     0     1     1     0     8    0
rtentry    112      248    0      208     2     0     2     2     0     8    0
syncache   264        4    0        4     1     1     0     1     0     8    0
tcpcb      544      210    0      206     1     0     1     1     0     8    0
nd6         48       50    0       46     1     0     1     1     0     8    0
art_heap8  4096       1    0        0     1     0     1     1     0     8    0
art_heap4  256     1167    0      978    12     0    12    12     0     8    0
art_table   32     1168    0      978     2     0     2     2     0     8    0
art_node    16      247    0      213     1     0     1     1     0     8    0
sysvmsgpl   40        4    0        2     1     0     1     1     0     8    0
semupl     112        3    0        3     1     1     0     1     0     8    0
semapl     112      150    0      140     1     0     1     1     0     8    0
shmpl      112       98    0       10     3     0     3     3     0     8    0
dirhash    1024      17    0        0     3     0     3     3     0     8    0
dino1pl    128     2571    0     1125    47     0    47    47     0     8    0
ffsino     272     2571    0     1125    97     0    97    97     0     8    0
nchpl      144     4040    0     2407    61     0    61    61     0     8    0
uvmvnodes   72     3005    0        0    55     0    55    55     0     8    0
vnodes     200     3005    0        0   159     0   159   159     0     8    0
namei      1024   13043    0    13042     1     0     1     1     0     8    0
percpumem   16       30    0        0     1     0     1     1     0     8    0
scxspl     192    10763    0    10763    11    10     1     6     0     8    1
sigapl     432     1035    0     1019     3     1     2     3     0     8    0
futexpl     56     9218    0     9218     1     0     1     1     0     8    1
knotepl    112      762    0      743     1     0     1     1     0     8    0
kqueuepl   104      279    0      277     1     0     1     1     0     8    0
pipepl     112      734    0      715     3     2     1     2     0     8    0
fdescpl    488     1036    0     1019     3     0     3     3     0     8    0
filepl     152     6855    0     6759     6     1     5     6     0     8    1
lockfpl    104      248    0      248     3     2     1     1     0     8    1
lockfspl    32      476    0      476     3     2     1     1     0     8    1
sessionpl  112       40    0       30     1     0     1     1     0     8    0
pgrppl      48       42    0       32     1     0     1     1     0     8    0
ucredpl     96     2011    0     2002     1     0     1     1     0     8    0
zombiepl   144     1019    0     1019     2     1     1     1     0     8    1
processpl  840     1052    0     1019     4     0     4     4     0     8    0
procpl     600     2641    0     2597     5     1     4     5     0     8    0
srpgc       64      130    0      130     5     5     0     1     0     8    0
sosppl     128       11    0       11     4     4     0     1     0     8    0
sockpl     384     1028    0     1011     4     1     3     4     0     8    1
mcl64k     65536      2    0        0     1     0     1     1     0     8    0
mcl16k     16384      2    0        0     1     0     1     1     0     8    0
mcl12k     12288      3    0        0     1     0     1     1     0     8    0
mcl9k      9216       2    0        0     1     0     1     1     0     8    0
mcl8k      8192       9    0        0     2     0     2     2     0     8    0
mcl4k      4096       7    0        0     1     0     1     1     0     8    0
mcl2k2     2112       7    0        0     1     0     1     1     0     8    0
mcl2k      2048     110    0        0    13     0    13    13     0     8    0
mtagpl      80        1    0        0     1     0     1     1     0     8    0
mbufpl     256      163    0        0     9     0     9     9     0     8    0
bufpl      256     7160    0     1122   378     0   378   378     0     8    0
anonpl      16   126950    0   120841    76    36    40    44     0   125   10
amapchunkpl 152    6754    0     6671    19    14     5     9     0   158    0
amappl16   192     4649    0     4305    66    40    26    30     0     8    8
amappl15   184      266    0      261     1     0     1     1     0     8    0
amappl14   176      259    0      254     2     1     1     1     0     8    0
amappl13   168      212    0      208     1     0     1     1     0     8    0
amappl12   160      283    0      279     1     0     1     1     0     8    0
amappl11   152      273    0      262     1     0     1     1     0     8    0
amappl10   144      181    0      176     4     3     1     1     0     8    0
amappl9    136      700    0      697     1     0     1     1     0     8    0
amappl8    128      337    0      311     3     1     2     2     0     8    0
amappl7    120       84    0       77     1     0     1     1     0     8    0
amappl6    112       90    0       84     1     0     1     1     0     8    0
amappl5    104      234    0      221     1     0     1     1     0     8    0
amappl4     96     1021    0      991     2     1     1     2     0     8    0
amappl3     88      510    0      505     1     0     1     1     0     8    0
amappl2     80     7525    0     7462     2     0     2     2     0     8    0
amappl1     72    33352    0    32899    23    13    10    19     0     8    0
amappl      72     3021    0     2986     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       99    0       10     2     0     2     2     0     8    0
uaddrrnd    24     1036    0     1019     1     0     1     1     0     8    0
uaddrbest   32        2    0        0     1     0     1     1     0     8    0
uaddr       24     1036    0     1019     1     0     1     1     0     8    0
vmmpekpl   168    11966    0    11944     2     0     2     2     0     8    0
vmmpepl    168   123811    0   122339   108    32    76    76     0   357   12
vmsppl     360     1035    0     1019     2     0     2     2     0     8    0
pdppl      4096    2080    0     2038     6     0     6     6     0     8    0
pvpl        32   365175    0   355734   156    47   109   116     0   265   24
pmappl     224     1035    0     1019     3     2     1     2     0     8    0
extentpl    40       39    0       25     1     0     1     1     0     8    0
phpool     112      528    0        2    16     0    16    16     0     8    0

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/03/24 23:17 openbsd b3dbd5f2ca08 2c86e0a5 .config console log report ci-openbsd-setuid
* Struck through repros no longer work on HEAD.