syzbot


uvm_fault: wsmux_do_ioctl (2)

Status: fixed on 2019/02/01 17:26
Reported-by: syzbot+ed88256423ae8d882b8b@syzkaller.appspotmail.com
Fix commit: In wskbdclose(), use the same logic as in wskbdopen() to determine if
First crash: 1886d, last: 1882d
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
openbsd uvm_fault: wsmux_do_ioctl (4) C 3 1774d 1798d 3/3 fixed on 2019/05/22 04:45
openbsd uvm_fault: wsmux_do_ioctl 2 1956d 1995d 3/3 fixed on 2018/12/18 19:33
openbsd uvm_fault: wsmux_do_ioctl (3) C 2 1865d 1873d 0/3 closed as dup on 2019/02/10 09:16

Sample crash report:
uvm_fault(0xfffffd806e90e2d8, 0x28, 0, 2) -> e
kernel: page fault trap, code=0
Stopped at      wsmux_do_ioctl+0x6ba:   movq    %rax,0x10(%rdx,%r15,8)
ddb{0}> 
ddb{0}> set $lines = 0
ddb{0}> show panic
kernel page fault
uvm_fault(0xfffffd806e90e2d8, 0x28, 0, 2) -> e
wsmux_do_ioctl(ee79b6071e14d62b,80185760,fffffd806dc2f580,f,fffffd807f7c7ba0) at wsmux_do_ioctl+0x6ba sys/dev/wscons/wsmux.c:404
end trace frame: 0xffff800020c22f10, count: 0
ddb{0}> trace
wsmux_do_ioctl(ee79b6071e14d62b,80185760,fffffd806dc2f580,f,fffffd807f7c7ba0) at wsmux_do_ioctl+0x6ba sys/dev/wscons/wsmux.c:404
VOP_IOCTL(5636c2c0f7c1dde2,80185760,fffffd80741ef260,ffff800020b74e18,fffffd806dc2f580,ffff800020b74e18) at VOP_IOCTL+0x80 sys/kern/vfs_vops.c:290
vn_ioctl(22cc9d2c988fcff,fffffd80741ef260,ffff800020b74e18,18) at vn_ioctl+0xc5 sys/kern/vfs_vnops.c:512sys_ioctl(b503842e34188979,0,ffff800020b74e18) at sys_ioctl+0x652
syscall(68b32b9fc24c344b) at syscall+0x5a0 mi_syscall sys/sys/syscall_mi.h:99 [inline]
syscall(68b32b9fc24c344b) at syscall+0x5a0 sys/arch/amd64/amd64/trap.c:583
Xsyscall(6,0,e4763a350c8,0,e4763a350a8,e4763a350a0) at Xsyscall+0x128
end of kernel
end trace frame: 0xe499ac51a50, count: -6
ddb{0}> show registers
rdi                             0xff
rsi                              0x2
rbp               0xffff800020c22e90
rbx                              0x2
rdx                                0
rcx                              0x1
rax                              0x3
r8                0xffffffff815384e0    wsmux_do_ioctl+0x1e0
r9                               0x7
r10               0xc4eb83199e035252
r11               0x114bc7164b73d443
r12               0xffff800000026f50
r13                                0
r14               0xffff800020c23040
r15                              0x3
rip               0xffffffff815389ba    wsmux_do_ioctl+0x6ba
cs                               0x8
rflags                       0x10297    __ALIGN_SIZE+0xf297
rsp               0xffff800020c22e40
ss                              0x10
wsmux_do_ioctl+0x6ba:   movq    %rax,0x10(%rdx,%r15,8)
ddb{0}> show proc
PROC (syz-executor9909) pid=420318 stat=onproc
    flags process=0 proc=4000000<THREAD>
    pri=51, usrpri=51, nice=20
    forw=0xffffffffffffffff, list=0xffff800020b74260,0xffff800020b75080
    process=0xffff800020bcad38 user=0xffff800020c1e000, vmspace=0xfffffd806e90e2d8
    estcpu=1, cpticks=4, pctcpu=0.98
    user=0, sys=0, intr=0
ddb{0}> ps
   PID     TID   PPID    UID  S       FLAGS  WAIT          COMMAND
 69030  348331  55491      0  2           0                syz-executor9909
*69030  420318  55491      0  7   0x4000000                syz-executor9909
 69030  436165  55491      0  3   0x4000080  fsleep        syz-executor9909
 32630  358330  49290      0  2           0                syz-executor9909
 32630  367158  49290      0  3   0x4000080  fsleep        syz-executor9909
 32630  468459  49290      0  3   0x4000080  fsleep        syz-executor9909
 49290  305927   8066      0  3        0x80  nanosleep     syz-executor9909
 55491  442504   8066      0  3        0x80  nanosleep     syz-executor9909
  8066  287238  48578      0  3        0x82  nanosleep     syz-executor9909
 48578  233777  68021      0  3    0x10008a  pause         ksh
 68021   18953  58919      0  3        0x92  select        sshd
 13705  478653      1      0  3    0x100083  ttyin         getty
 58919  470461      1      0  3        0x80  select        sshd
 65885  189643  48888     73  7    0x100090                syslogd
 48888   13318      1      0  3    0x100082  netio         syslogd
 66029  326756      1     77  3    0x100090  poll          dhclient
 34691  113779      1      0  3        0x80  poll          dhclient
 81913   99959      0      0  2     0x14200                zerothread
 61080  136206      0      0  3     0x14200  aiodoned      aiodoned
 63388   41938      0      0  3     0x14200  syncer        update
 71473  105061      0      0  3     0x14200  cleaner       cleaner
 29525   10284      0      0  3     0x14200  reaper        reaper
 79326  417329      0      0  3     0x14200  pgdaemon      pagedaemon
  8239  317961      0      0  3     0x14200  bored         crynlk
 97430  111889      0      0  3     0x14200  bored         crypto
  4087  510994      0      0  3  0x40014200  acpi0         acpi0
 11957  156260      0      0  3  0x40014200                idle1
 79115  437826      0      0  3     0x14200  bored         softnet
  5909  422232      0      0  3     0x14200  bored         systqmp
  5492  205634      0      0  3     0x14200  bored         systq
 91342  417038      0      0  3  0x40014200  bored         softclock
 85271  421340      0      0  3  0x40014200                idle0
     1  105146      0      0  3        0x82  wait          init
     0       0     -1      0  3     0x10200  scheduler     swapper
ddb{0}> show all locks
Process 69030 (syz-executor9909) thread 0xffff800020b74e18 (420318)
exclusive kernel_lock &kernel_lock r = 1 (0xffffffff8230c478) locked @ /syzkaller/managers/multicore/kernel/sys/arch/amd64/amd64/trap.c:161
ddb{0}> show malloc
           Type InUse  MemUse  HighUse   Limit  Requests Type Lim Kern Lim
         devbuf  9442   6315K    6323K  78643K     10531        0        0
            pcb    23      9K       9K  78643K        55        0        0
         rtable    61      2K       2K  78643K       115        0        0
         ifaddr    21      7K       7K  78643K        21        0        0
       counters    39     33K      33K  78643K        39        0        0
       ioctlops     0      0K       2K  78643K        13        0        0
          mount     1      1K       1K  78643K         1        0        0
         vnodes  1166     73K      73K  78643K      1173        0        0
      UFS quota     1     32K      32K  78643K         1        0        0
      UFS mount     5     36K      36K  78643K         5        0        0
            shm     2      1K       1K  78643K         2        0        0
         VM map     2      1K       1K  78643K         2        0        0
            sem     2      0K       0K  78643K         2        0        0
        dirhash    12      2K       2K  78643K        12        0        0
           ACPI  1792    194K     288K  78643K     12592        0        0
      file desc     1      0K       0K  78643K         1        0        0
           proc    40     38K      46K  78643K       201        0        0
    NFS srvsock     1      0K       0K  78643K         1        0        0
     NFS daemon     1     16K      16K  78643K         1        0        0
       in_multi    11      0K       0K  78643K        11        0        0
    ether_multi     1      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    18     79K      79K  78643K        18        0        0
           exec     0      0K       1K  78643K       149        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    58      3K       3K  78643K       666        0        0
       UVM aobj     2      2K       2K  78643K         2        0        0
        memdesc     1      4K       4K  78643K         1        0        0
    crypto data     1      1K       1K  78643K         1        0        0
            NDP     3      0K       0K  78643K         3        0        0
           temp    30   2347K    2411K  78643K      1690        0        0
      SYN cache     2     16K      16K  78643K         2        0        0
ddb{0}> show all pools
Name      Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle
arp         64        2    0        0     1     0     1     1     0     8    0
inpcbpl    280       22    0       16     1     0     1     1     0     8    0
plimitpl   152       13    0        8     1     0     1     1     0     8    0
plcache    128       20    0        0     1     0     1     1     0     8    0
rtentry    112       23    0        1     1     0     1     1     0     8    0
syncache   264        5    0        5     1     0     1     1     0     8    1
tcpcb      544        8    0        5     1     0     1     1     0     8    0
art_heap8  4096       1    0        0     1     0     1     1     0     8    0
art_heap4  256       96    0        0     6     0     6     6     0     8    0
art_table   32       97    0        0     1     0     1     1     0     8    0
art_node    16       22    0        2     1     0     1     1     0     8    0
dirhash    1024      17    0        0     3     0     3     3     0     8    0
dino1pl    128     1385    0       20    45     0    45    45     0     8    0
ffsino     272     1385    0       20    92     0    92    92     0     8    0
nchpl      144     1555    0       30    57     0    57    57     0     8    0
uvmvnodes   72     1394    0        0    26     0    26    26     0     8    0
vnodes     200     1394    0        0    74     0    74    74     0     8    0
namei      1024    3270    0     3270     2     1     1     1     0     8    1
percpumem   16       30    0        0     1     0     1     1     0     8    0
scxspl     192     2367    0     2367     8     2     6     6     0     8    6
sigapl     432      179    0      165     2     0     2     2     0     8    0
futexpl     56       14    0       11     1     0     1     1     0     8    0
knotepl    112        5    0        0     1     0     1     1     0     8    0
kqueuepl   104        1    0        0     1     0     1     1     0     8    0
pipepl     112      114    0      107     2     1     1     1     0     8    0
fdescpl    488      180    0      165     2     0     2     2     0     8    0
filepl     152      814    0      771     2     0     2     2     0     8    0
lockfpl     96        9    0        8     2     1     1     1     0     8    0
lockfspl    24        5    0        4     2     1     1     1     0     8    0
sessionpl  112       17    0        9     1     0     1     1     0     8    0
pgrppl      48       17    0        9     1     0     1     1     0     8    0
ucredpl     96       47    0       40     1     0     1     1     0     8    0
zombiepl   144      165    0      165     2     1     1     1     0     8    1
processpl  840      194    0      165     4     0     4     4     0     8    0
procpl     600      202    0      169     3     0     3     3     0     8    0
sockpl     384       64    0       48     2     0     2     2     0     8    0
mcl4k      4096       3    0        0     1     0     1     1     0     8    0
mcl2k      2048      67    0        0     9     0     9     9     0     8    0
mtagpl      80        1    0        0     1     0     1     1     0     8    0
mbufpl     256       84    0        0     6     0     6     6     0     8    0
bufpl      256     2013    0      261   110     0   110   110     0     8    0
anonpl      16    16993    0    15784     6     1     5     6     0   125    0
amapchunkpl 152     507    0      460     2     0     2     2     0   158    0
amappl16   192       88    0       82     1     0     1     1     0     8    0
amappl15   184        1    0        0     1     0     1     1     0     8    0
amappl14   176        1    0        1     1     1     0     1     0     8    0
amappl13   168       16    0       13     1     0     1     1     0     8    0
amappl12   160       11    0       11     1     1     0     1     0     8    0
amappl11   152      171    0      162     1     0     1     1     0     8    0
amappl10   144       45    0       45     2     1     1     1     0     8    1
amappl9    136      209    0      208     1     0     1     1     0     8    0
amappl8    128      110    0       98     1     0     1     1     0     8    0
amappl7    120       30    0       25     1     0     1     1     0     8    0
amappl6    112       43    0       39     1     0     1     1     0     8    0
amappl5    104      133    0      123     1     0     1     1     0     8    0
amappl4     96      258    0      238     1     0     1     1     0     8    0
amappl3     88      112    0      106     1     0     1     1     0     8    0
amappl2     80      566    0      511     2     0     2     2     0     8    0
amappl1     72    11674    0    11238    15     5    10    15     0     8    0
amappl      72      377    0      350     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        1    0        0     1     0     1     1     0     8    0
uaddrrnd    24      180    0      165     1     0     1     1     0     8    0
uaddrbest   32        2    0        0     1     0     1     1     0     8    0
uaddr       24      180    0      165     1     0     1     1     0     8    0
vmmpekpl   168     5131    0     5111     1     0     1     1     0     8    0
vmmpepl    168    23623    0    22758    53    15    38    43     0   357    0
vmsppl     360      179    0      165     2     0     2     2     0     8    0
pdppl      4096     367    0      330     5     0     5     5     0     8    0
pvpl        32    70358    0    67411    30     4    26    26     0   265    2
pmappl     224      179    0      165     1     0     1     1     0     8    0
extentpl    40       39    0       25     1     0     1     1     0     8    0
phpool     112      238    0        3     7     0     7     7     0     8    0
ddb{0}> 

Crashes (17):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/01/28 10:57 openbsd c41c16f02568 1602ad52 .config console log report syz C ci-openbsd-multicore
2019/01/31 14:13 openbsd 5916986c9982 aa432daf .config console log report ci-openbsd-main
2019/01/31 11:58 openbsd 5916986c9982 aa432daf .config console log report ci-openbsd-main
2019/01/31 11:39 openbsd 5916986c9982 aa432daf .config console log report ci-openbsd-multicore
2019/01/31 08:22 openbsd 5916986c9982 aa432daf .config console log report ci-openbsd-main
2019/01/31 08:09 openbsd 5916986c9982 aa432daf .config console log report ci-openbsd-main
2019/01/31 03:34 openbsd 5916986c9982 aa432daf .config console log report ci-openbsd-main
2019/01/29 22:44 openbsd 810597764d1f aa432daf .config console log report ci-openbsd-multicore
2019/01/29 19:40 openbsd 810597764d1f aa432daf .config console log report ci-openbsd-main
2019/01/29 06:09 openbsd fabafa7b0c06 aa432daf .config console log report ci-openbsd-main
2019/01/29 01:11 openbsd fabafa7b0c06 aa432daf .config console log report ci-openbsd-main
2019/01/28 12:27 openbsd c41c16f02568 1602ad52 .config console log report ci-openbsd-main
2019/01/28 10:34 openbsd c41c16f02568 1602ad52 .config console log report ci-openbsd-multicore
2019/01/28 03:00 openbsd 6bb631ead20c c73f090a .config console log report ci-openbsd-main
2019/01/28 00:23 openbsd 6bb631ead20c c73f090a .config console log report ci-openbsd-main
2019/01/27 17:46 openbsd 269c2856b78e c73f090a .config console log report ci-openbsd-main
2019/01/27 14:13 openbsd 269c2856b78e c73f090a .config console log report ci-openbsd-main
* Struck through repros no longer work on HEAD.