syzbot


uvm_fault: pckbc_start

Status: fixed on 2019/02/19 14:52
Reported-by: syzbot+c9cea3810ba7c60bad69@syzkaller.appspotmail.com
Fix commit: 0c0bf6318018 Serialize access to the list of attached child devices belonging to a wsmux. When invoking wsevsrc_* functions on a attached child device, underlying driver can sleep; this introduces a race where another thread is able to modify the list leading to all kinds of corruptions.
First crash: 1383d, last: 1383d
similar bugs (1):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
openbsd uvm_fault: pckbc_start (2) syz 2 1290d 1290d 3/3 fixed on 2019/06/03 23:49

Sample crash report:
uvm_fault(0xfffffd807f00d870, 0x1c, 0, 1) -> e
kernel: page fault trap, code=0
Stopped at      pckbc_start+0x16e:      movsxdq 0x1c(%r14),%rax
ddb{1}> 
ddb{1}> set $lines = 0
ddb{1}> set $maxwidth = 0
ddb{1}> show panic
kernel page fault
uvm_fault(0xfffffd807f00d870, 0x1c, 0, 1) -> e
pckbc_start(ffff800000026e00,0) at pckbc_start+0x16e sys/dev/ic/pckbc.c:809
end trace frame: 0xffff800020c24930, count: 0
ddb{1}> trace
pckbc_start(ffff800000026e00,0) at pckbc_start+0x16e sys/dev/ic/pckbc.c:809
pckbc_enqueue_cmd(ffff800000026e00,0,ffff800020c24957,1,0,1) at pckbc_enqueue_cmd+0x24a sys/dev/ic/pckbc.c:918
pckbd_enable(ffff80000066a380,0) at pckbd_enable+0x125 sys/dev/pckbc/pckbd.c:481
wskbd_mux_close(ffff80000001ce00) at wskbd_mux_close+0x98 sys/dev/wscons/wskbd.c:891
wsmuxclose(4501,1,2000,ffff800020b42270) at wsmuxclose+0xb5 wsmux_do_close sys/dev/wscons/wsmux.c:313 [inline]
wsmuxclose(4501,1,2000,ffff800020b42270) at wsmuxclose+0xb5 sys/dev/wscons/wsmux.c:277
spec_close(ffff800020c24aa0) at spec_close+0x3a0 sys/kern/spec_vnops.c:553
VOP_CLOSE(fffffd807e192498,1,fffffd807f7c7a80,ffff800020b42270) at VOP_CLOSE+0x70 sys/kern/vfs_vops.c:174
vn_closefile(fffffd806ea6ed18,ffff800020b42270) at vn_closefile+0x160 vn_close sys/kern/vfs_vnops.c:289 [inline]
vn_closefile(fffffd806ea6ed18,ffff800020b42270) at vn_closefile+0x160 sys/kern/vfs_vnops.c:575
fdrop(fffffd806ea6ed18,ffff800020b42270) at fdrop+0xe1 sys/kern/kern_descrip.c:1260
closef(fffffd806ea6ed18,ffff800020b42270) at closef+0x129 sys/kern/kern_descrip.c:1244
doopenat(ffff800020b42270,ffffff9c,20000000,510,0,ffff800020c24ed0) at doopenat+0x846 sys/kern/vfs_syscalls.c:1117
syscall(ffff800020c24f80) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline]
syscall(ffff800020c24f80) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574
Xsyscall(6,0,ffffffffffffffb0,0,4,243c0da8010) at Xsyscall+0x128
end of kernel
end trace frame: 0x245f8303f80, count: -13
ddb{1}> show registers
rdi                                0
rsi                                0
rbp               0xffff800020c24890
rbx                                0
rdx                          0x40000    acpi_pdirpa+0x2be68
rcx               0xffff800000941e00
rax               0xffffffff81269c64    pckbc_start+0x44
r8                                 0
r9                               0x1
r10               0x5fac2c5d77192d70
r11               0xefc0d4650d66ce75
r12               0xffff800000026e00
r13               0xffff80000066c000
r14                                0
r15                                0
rip               0xffffffff81269d8e    pckbc_start+0x16e
cs                               0x8
rflags                       0x10246    __ALIGN_SIZE+0xf246
rsp               0xffff800020c24830
ss                              0x10
pckbc_start+0x16e:      movsxdq 0x1c(%r14),%rax
ddb{1}> show proc
PROC (syz-executor.0) pid=269490 stat=onproc
    flags process=0 proc=4000000<THREAD>
    pri=86, usrpri=86, nice=20
    forw=0xffffffffffffffff, list=0xffff800020b424c8,0xffff800020b42988
    process=0xffff800020b449e8 user=0xffff800020c20000, vmspace=0xfffffd807f00d870
    estcpu=36, cpticks=102, pctcpu=1.1
    user=0, sys=102, intr=0
ddb{1}> ps
   PID     TID   PPID    UID  S       FLAGS  WAIT          COMMAND
 40911  288281  77938      0  7           0                syz-executor.0
*40911  269490  77938      0  7   0x4000000                syz-executor.0
 40911  340378  77938      0  3   0x4000080  fsleep        syz-executor.0
 19185  472661      1      0  3    0x100083  ttyin         getty
 13682  164219      0      0  3     0x14200  bored         sosplice
 13039  281533  83428      0  3        0x82  nanosleep     syz-executor.1
 77938  247960  83428      0  3        0x82  nanosleep     syz-executor.0
 83428  282306  88246      0  3        0x82  thrsleep      syz-fuzzer
 83428  185125  88246      0  3   0x4000082  nanosleep     syz-fuzzer
 83428  407333  88246      0  3   0x4000082  thrsleep      syz-fuzzer
 83428  309333  88246      0  3   0x4000082  kqread        syz-fuzzer
 83428  146002  88246      0  3   0x4000082  thrsleep      syz-fuzzer
 83428  118453  88246      0  3   0x4000082  thrsleep      syz-fuzzer
 83428  287648  88246      0  3   0x4000082  thrsleep      syz-fuzzer
 83428   12729  88246      0  3   0x4000082  thrsleep      syz-fuzzer
 83428  387863  88246      0  3   0x4000082  thrsleep      syz-fuzzer
 83428  264612  88246      0  3   0x4000082  thrsleep      syz-fuzzer
 88246  328502  65948      0  3    0x10008a  pause         ksh
 65948   75498  74932      0  3        0x92  select        sshd
 74932  336194      1      0  3        0x80  select        sshd
 34838  363075  42920     73  3    0x100010  biowait       syslogd
 42920  448090      1      0  3    0x100082  netio         syslogd
 20918  346299      1     77  3    0x100090  poll          dhclient
 27906   24302      1      0  3        0x80  poll          dhclient
  9544   28589      0      0  3     0x14200  pgzero        zerothread
 27897  386120      0      0  3     0x14200  aiodoned      aiodoned
 31545  144853      0      0  3     0x14200  syncer        update
 80774   17299      0      0  3     0x14200  cleaner       cleaner
 84065  104207      0      0  3     0x14200  reaper        reaper
 28410  407096      0      0  3     0x14200  pgdaemon      pagedaemon
 87114  304357      0      0  3     0x14200  bored         crynlk
 58391   72757      0      0  3     0x14200  bored         crypto
 20987  291356      0      0  3  0x40014200  acpi0         acpi0
 95438  492443      0      0  3  0x40014200                idle1
 98954   61411      0      0  3     0x14200  bored         softnet
 38922  285156      0      0  3     0x14200  bored         systqmp
   480  149569      0      0  3     0x14200  bored         systq
 45041  523491      0      0  3  0x40014200  bored         softclock
 94693  484999      0      0  3  0x40014200                idle0
     1  375398      0      0  3        0x82  wait          init
     0       0     -1      0  3     0x10200  scheduler     swapper
ddb{1}> show all locks
Process 40911 (syz-executor.0) thread 0xffff800020b42270 (269490)
exclusive rwlock fdlock r = 0 (0xfffffd806f1c0bd0) locked @ /syzkaller/managers/multicore/kernel/sys/kern/vfs_syscalls.c:1104
#0  witness_lock+0x58a sys/kern/subr_witness.c:1205
#1  doopenat+0x828
#2  syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline]
#2  syscall+0x5ac sys/arch/amd64/amd64/trap.c:574
#3  Xsyscall+0x128
exclusive kernel_lock &kernel_lock r = 2 (0xffffffff82335598) locked @ /syzkaller/managers/multicore/kernel/sys/arch/amd64/amd64/trap.c:161
#0  witness_lock+0x58a sys/kern/subr_witness.c:1205
#1  syscall+0x47f mi_syscall sys/sys/syscall_mi.h:91 [inline]
#1  syscall+0x47f sys/arch/amd64/amd64/trap.c:574
#2  Xsyscall+0x128
Process 34838 (syslogd) thread 0xffff800020b95c30 (363075)
exclusive rrwlock inode r = 0 (0xfffffd806ebc34d8) locked @ /syzkaller/managers/multicore/kernel/sys/ufs/ufs/ufs_vnops.c:1547
#0  witness_lock+0x58a sys/kern/subr_witness.c:1205
#1  _rw_enter+0x44d 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  sys_fsync+0x114 sys/kern/vfs_syscalls.c:2704
#6  syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline]
#6  syscall+0x5ac sys/arch/amd64/amd64/trap.c:574
#7  Xsyscall+0x128
ddb{1}> show malloc
           Type InUse  MemUse  HighUse   Limit  Requests Type Lim Kern Lim
         devbuf  9498   6349K    6357K  78643K     10781        0        0
            pcb    23      9K      11K  78643K       358        0        0
         rtable   100      3K       4K  78643K       250        0        0
         ifaddr    48     11K      12K  78643K        91        0        0
       counters    39     33K      33K  78643K        39        0        0
       ioctlops     0      0K       2K  78643K        17        0        0
            iov     0      0K      28K  78643K        65        0        0
          mount     1      1K       1K  78643K         1        0        0
         vnodes  1205     75K      76K  78643K      1540        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        13        0        0
         VM map     2      1K       1K  78643K         2        0        0
            sem    12      0K       0K  78643K        83        0        0
        dirhash    12      2K       2K  78643K        12        0        0
           ACPI  1792    194K     288K  78643K     12592        0        0
      file desc     5     13K      21K  78643K       526        0        0
          sigio     0      0K       0K  78643K         4        0        0
           proc    41     38K      58K  78643K       322        0        0
        subproc    64  65538K   67586K  78643K        70        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        69        0        0
       in_multi    33      2K       2K  78643K        53        0        0
    ether_multi     1      0K       0K  78643K         6        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       225        0        0
     pfkey data     0      0K       4K  78643K         2        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    84     20K      29K  78643K      2463        0        0
       UVM aobj    37      2K       2K  78643K        40        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        14        0        0
            NDP     9      0K       0K  78643K        25        0        0
           temp   134   2363K    2427K  78643K      4223        0        0
         kqueue     0      0K       0K  78643K         7        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        4    0        0     1     0     1     1     0     8    0
inpcbpl    280      255    0      247     1     0     1     1     0     8    0
plimitpl   152       17    0       10     1     0     1     1     0     8    0
plcache    128       20    0        0     1     0     1     1     0     8    0
rtentry    112       41    0        1     2     0     2     2     0     8    0
syncache   264        4    0        4     1     1     0     1     0     8    0
tcpqe       32        1    0        1     1     1     0     1     0     8    0
tcpcb      544       92    0       87     1     0     1     1     0     8    0
nd6         48        4    0        0     1     0     1     1     0     8    0
ppxss      1128       7    0        7     4     3     1     1     0     8    1
art_heap8  4096       1    0        0     1     0     1     1     0     8    0
art_heap4  256      186    0        0    12     0    12    12     0     8    0
art_table   32      187    0        0     2     0     2     2     0     8    0
art_node    16       40    0        6     1     0     1     1     0     8    0
sysvmsgpl   40       10    0        4     1     0     1     1     0     8    0
semupl     112        1    0        1     1     1     0     1     0     8    0
semapl     112       79    0       69     1     0     1     1     0     8    0
shmpl      112       38    0        3     2     0     2     2     0     8    1
dirhash    1024      17    0        0     3     0     3     3     0     8    0
dino1pl    128     2428    0     1016    46     0    46    46     0     8    0
ffsino     272     2428    0     1016    95     0    95    95     0     8    0
nchpl      144     3376    0     1753    61     0    61    61     0     8    0
uvmvnodes   72     2533    0        0    47     0    47    47     0     8    0
vnodes     200     2533    0        0   134     0   134   134     0     8    0
namei      1024    9339    0     9339     2     1     1     1     0     8    1
percpumem   16       30    0        0     1     0     1     1     0     8    0
scsiplug    64        3    0        3     2     2     0     1     0     8    0
scxspl     192     9744    0     9743    11    10     1     6     0     8    0
sigapl     432      695    0      682     2     0     2     2     0     8    0
futexpl     56     6221    0     6220     1     0     1     1     0     8    0
knotepl    112      204    0      177     3     2     1     2     0     8    0
kqueuepl   104      179    0      177     1     0     1     1     0     8    0
pipepl     112      492    0      473     4     3     1     2     0     8    0
fdescpl    488      696    0      682     3     1     2     3     0     8    0
filepl     152     4270    0     4174     8     3     5     7     0     8    1
lockfpl    104      175    0      175     2     1     1     1     0     8    1
lockfspl    32      203    0      203     2     1     1     1     0     8    1
sessionpl  112       18    0        8     1     0     1     1     0     8    0
pgrppl      48       29    0       19     1     0     1     1     0     8    0
ucredpl     96      935    0      928     1     0     1     1     0     8    0
zombiepl   144      682    0      681     2     1     1     1     0     8    0
processpl  840      711    0      681     4     0     4     4     0     8    0
procpl     600     1871    0     1830     4     0     4     4     0     8    0
sosppl     128       14    0       14     3     2     1     1     0     8    1
sockpl     384      566    0      548     4     1     3     4     0     8    1
mcl64k     65536    229    0        0    29     6    23    29     0     8    1
mcl16k     16384      4    0        0     1     0     1     1     0     8    0
mcl12k     12288      4    0        0     1     0     1     1     0     8    0
mcl9k      9216       4    0        0     1     0     1     1     0     8    0
mcl8k      8192       3    0        0     1     0     1     1     0     8    0
mcl4k      4096       6    0        0     1     0     1     1     0     8    0
mcl2k2     2112       3    0        0     1     0     1     1     0     8    0
mcl2k      2048     106    0        0    13     0    13    13     0     8    0
mtagpl      80        1    0        0     1     0     1     1     0     8    0
mbufpl     256      311    0        0    19     0    19    19     0     8    0
bufpl      256     6174    0     1021   323     0   323   323     0     8    0
anonpl      16    77689    0    69629    61    21    40    48     0   125    5
amapchunkpl 152    3828    0     3737    10     1     9     9     0   158    4
amappl16   192     3408    0     2983    45    22    23    33     0     8    0
amappl15   184        5    0        4     2     1     1     1     0     8    0
amappl14   176        7    0        6     2     1     1     1     0     8    0
amappl13   168       27    0       23     1     0     1     1     0     8    0
amappl12   160      278    0      275     2     1     1     1     0     8    0
amappl11   152      424    0      414     1     0     1     1     0     8    0
amappl10   144       59    0       57     2     1     1     1     0     8    0
amappl9    136      592    0      589     1     0     1     1     0     8    0
amappl8    128      411    0      386     1     0     1     1     0     8    0
amappl7    120       36    0       31     1     0     1     1     0     8    0
amappl6    112       56    0       47     1     0     1     1     0     8    0
amappl5    104      131    0      119     1     0     1     1     0     8    0
amappl4     96      279    0      258     2     1     1     2     0     8    0
amappl3     88      148    0      142     1     0     1     1     0     8    0
amappl2     80     5705    0     5654     2     0     2     2     0     8    0
amappl1     72    22959    0    22539    24    14    10    19     0     8    0
amappl      72     2080    0     2045     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       39    0        3     1     0     1     1     0     8    0
uaddrrnd    24      696    0      682     1     0     1     1     0     8    0
uaddrbest   32        2    0        0     1     0     1     1     0     8    0
uaddr       24      696    0      682     1     0     1     1     0     8    0
vmmpekpl   168     9887    0     9863     2     0     2     2     0     8    0
vmmpepl    168    81115    0    79746    96    30    66    72     0   357    0
vmsppl     360      695    0      682     2     0     2     2     0     8    0
pdppl      4096    1399    0     1364     5     0     5     5     0     8    0
pvpl        32   251363    0   239817   139    30   109   128     0   265   14
pmappl     224      695    0      682     1     0     1     1     0     8    0
extentpl    40       39    0       25     1     0     1     1     0     8    0
phpool     112      508    0        9    15     0    15    15     0     8    0

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-openbsd-multicore 2019/02/18 19:32 openbsd 9c4fc15973cf 59f36113 .config log report
* Struck through repros no longer work on HEAD.