syzbot


uvm_fault: strlcpy (2)

Status: fixed on 2020/03/30 02:16
Reported-by: syzbot+48e38ebd31c030b5841c@syzkaller.appspotmail.com
Fix commit: 9fcf6ed4d02d Prevent out of bounds read in strlcpy due to vcp_name not being NUL-terminated.
First crash: 1494d, last: 1494d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
openbsd uvm_fault: strlcpy 18 1677d 1798d 3/3 fixed on 2019/09/24 02:15

Sample crash report:
uvm_fault(0xffffffff8251da00, 0xffff800000a2d000, 0, 1) -> e
kernel: page fault trap, code=0
Stopped at      strlcpy+0xcf:   movzbl  0xffffffffffffffff(%rbx),%r15d
ddb> 
ddb> set $lines = 0
ddb> set $maxwidth = 0
ddb> show panic
kernel page fault
uvm_fault(0xffffffff8251da00, 0xffff800000a2d000, 0, 1) -> e
strlcpy(ffff80001d374448,ffff800000a2cc20,40) at strlcpy+0xcf sys/lib/libkern/strlcpy.c:44
end trace frame: 0xffff80001f60dd20, count: 0
ddb> trace
strlcpy(ffff80001d374448,ffff800000a2cc20,40) at strlcpy+0xcf sys/lib/libkern/strlcpy.c:44
vm_create(ffff800000a2c800,ffff80001d339758) at vm_create+0x112 sys/arch/amd64/amd64/vmm.c:1172
VOP_IOCTL(fffffd805d843820,c5005601,ffff800000a2c800,1,fffffd806c3bfc00,ffff80001d339758) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290
vn_ioctl(fffffd805d877800,c5005601,ffff800000a2c800,ffff80001d339758) at vn_ioctl+0xb5 sys/kern/vfs_vnops.c:531
sys_ioctl(ffff80001d339758,ffff80001f60e008,ffff80001f60e050) at sys_ioctl+0x4a1
syscall(ffff80001f60e0d0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0xba84e2e51b0, count: -7
ddb> show registers
rdi               0xffffffff82148555    strlcpy+0xc5
rsi                            0x47d
rbp               0xffff80001f60dcc0
rbx               0xffff800000a2d001
rdx                            0x47e
rcx               0xffff80001e409000
rax               0xffff80001e409000
r8                             0x210
r9                               0x7
r10               0xf1b0f53801094e1f
r11               0xdc0360bfe1a6fef5
r12                                0
r13                             0x45
r14               0xffff800000a2cc20
r15                             0xdb
rip               0xffffffff8214855f    strlcpy+0xcf
cs                               0x8
rflags                       0x10282    __ALIGN_SIZE+0xf282
rsp               0xffff80001f60dc70
ss                              0x10
strlcpy+0xcf:   movzbl  0xffffffffffffffff(%rbx),%r15d
ddb> show proc
PROC (syz-executor.0) pid=384538 stat=onproc
    flags process=0 proc=4000000<THREAD>
    pri=32, usrpri=71, nice=20
    forw=0xffffffffffffffff, list=0xffff80001d33a5f8,0xffffffff825b3eb0
    process=0xffff8000ffffb5a0 user=0xffff80001f609000, vmspace=0xfffffd8069043228
    estcpu=36, cpticks=1, pctcpu=0.0
    user=0, sys=1, intr=0
ddb> ps
   PID     TID   PPID    UID  S       FLAGS  WAIT          COMMAND
  6297  484655  12032      0  2           0                syz-executor.0
* 6297  384538  12032      0  7   0x4000000                syz-executor.0
 67467  256999  17747      0  2         0x2                syz-executor.1
 66193  195374      0      0  3     0x14200  bored         sosplice
 12032  300516  17747      0  3        0x82  nanosleep     syz-executor.0
 17747   52728  78910      0  3        0x82  thrsleep      syz-fuzzer
 17747   46103  78910      0  3   0x4000082  nanosleep     syz-fuzzer
 17747  460500  78910      0  3   0x4000082  kqread        syz-fuzzer
 17747  243998  78910      0  3   0x4000082  thrsleep      syz-fuzzer
 17747  404507  78910      0  3   0x4000082  thrsleep      syz-fuzzer
 17747  389600  78910      0  3   0x4000082  thrsleep      syz-fuzzer
 17747  189887  78910      0  3   0x4000082  thrsleep      syz-fuzzer
 17747  334501  78910      0  3   0x4000082  thrsleep      syz-fuzzer
 78910  314871  41432      0  3    0x10008a  pause         ksh
 41432   41079  97492      0  3        0x92  select        sshd
 50748  471616      1      0  3    0x100083  ttyin         getty
 97492  275559      1      0  3        0x80  select        sshd
 96097  184743  81358     73  3    0x100090  kqread        syslogd
 81358  273356      1      0  3    0x100082  netio         syslogd
 72319  302374      1     77  3    0x100090  poll          dhclient
 54759  249498      1      0  3        0x80  poll          dhclient
 66950  327281      0      0  3     0x14200  bored         smr
 15069   60651      0      0  2     0x14200                zerothread
  8072  207707      0      0  3     0x14200  aiodoned      aiodoned
 34455  133140      0      0  3     0x14200  syncer        update
 57852  508352      0      0  3     0x14200  cleaner       cleaner
 57476   67658      0      0  3     0x14200  reaper        reaper
 55273  404078      0      0  3     0x14200  pgdaemon      pagedaemon
  1847  461009      0      0  3     0x14200  bored         crynlk
 16431   70676      0      0  3     0x14200  bored         crypto
 10992   59653      0      0  3  0x40014200  acpi0         acpi0
 62287  346325      0      0  3     0x14200  bored         softnet
 26568   91076      0      0  3     0x14200  bored         systqmp
 27106   97924      0      0  3     0x14200  bored         systq
 66953  452336      0      0  2  0x40014200                softclock
 43337  390303      0      0  3  0x40014200                idle0
     1  255150      0      0  3        0x82  wait          init
     0       0     -1      0  3     0x10200  scheduler     swapper
ddb> show all locks
No such command
ddb> show malloc
           Type InUse  MemUse  HighUse   Limit  Requests Type Lim
         devbuf  9502   6344K    6656K  78643K     10933        0
            pcb    13      8K       8K  78643K        71        0
         rtable   105      3K       3K  78643K       257        0
         ifaddr    68     13K      13K  78643K        93        0
       counters    21     16K      16K  78643K        23        0
       ioctlops     1      2K       2K  78643K        23        0
            iov     0      0K      12K  78643K        44        0
          mount     1      1K       1K  78643K         1        0
         vnodes  1217     77K      77K  78643K      1363        0
      UFS quota     1     32K      32K  78643K         1        0
      UFS mount     5     36K      36K  78643K         5        0
            shm     2      1K       5K  78643K         8        0
         VM map     2      0K       0K  78643K         2        0
            sem     8      0K       0K  78643K        10        0
        dirhash    12      2K       2K  78643K        12        0
           ACPI  1794    195K     288K  78643K     12646        0
      file desc     5     13K      25K  78643K       229        0
          sigio     0      0K       0K  78643K         8        0
           proc    49     38K      55K  78643K       414        0
        subproc    32      2K       2K  78643K        51        0
    NFS srvsock     1      0K       0K  78643K         1        0
     NFS daemon     1     16K      16K  78643K         1        0
    ip_moptions     0      0K       0K  78643K        29        0
       in_multi    33      2K       2K  78643K        90        0
    ether_multi     1      0K       0K  78643K        15        0
    ISOFS mount     1     32K      32K  78643K         1        0
  MSDOSFS mount     1     16K      16K  78643K         1        0
           ttys    43    201K     201K  78643K        43        0
           exec     0      0K       1K  78643K       210        0
        pagedep     1      8K       8K  78643K         1        0
       inodedep     1     32K      32K  78643K         1        0
         newblk     1      0K       0K  78643K         1        0
        VM swap     7     26K      26K  78643K         7        0
       UVM amap   108     70K      70K  78643K      1372        0
       UVM aobj    12      2K       2K  78643K        14        0
        memdesc     1      4K       4K  78643K         1        0
    crypto data     1      1K       1K  78643K         1        0
    ip6_options     0      0K       0K  78643K        65        0
            NDP    14      0K       0K  78643K        21        0
           temp   103   3031K    3095K  78643K     14717        0
         kqueue     3      4K      14K  78643K        17        0
      SYN cache     2     16K      16K  78643K         2        0
ddb> show all pools
Name      Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle
arp         64        8    0        2     1     0     1     1     0     8    0
rtpcb       80       29    0       27     1     0     1     1     0     8    0
rtentry    112       60    0       16     2     0     2     2     0     8    0
unpcb      120      167    0      159     1     0     1     1     0     8    0
syncache   264        4    0        4     1     1     0     1     0     8    0
tcpqe       32       66    0       66     1     1     0     1     0     8    0
tcpcb      544       86    0       82     1     0     1     1     0     8    0
inpcb      280      449    0      441     2     0     2     2     0     8    1
nd6         48       10    0        4     1     0     1     1     0     8    0
art_heap8  4096       1    0        0     1     0     1     1     0     8    0
art_heap4  256      257    0       68    13     0    13    13     0     8    1
art_table   32      258    0       68     2     0     2     2     0     8    0
art_node    16       59    0       19     1     0     1     1     0     8    0
sysvmsgpl   40       14    0        6     1     0     1     1     0     8    0
semupl     112        2    0        2     1     0     1     1     0     8    1
semapl     112        6    0        0     1     0     1     1     0     8    0
shmpl      112       12    0        2     1     0     1     1     0     8    0
dirhash    1024      17    0        0     3     0     3     3     0     8    0
dino1pl    128     1718    0      322    46     0    46    46     0     8    0
ffsino     240     1718    0      322    83     0    83    83     0     8    0
nchpl      144     2285    0      690    60     0    60    60     0     8    0
uvmvnodes   72     1859    0        0    34     0    34    34     0     8    0
vnodes     208     1859    0        0    98     0    98    98     0     8    0
namei      1024    5992    0     5991     1     0     1     1     0     8    0
vcpupl     1984       6    0        0     1     0     1     1     0     8    0
vmpool     528        7    0        0     1     0     1     1     0     8    0
scsiplug    64        1    0        1     1     1     0     1     0     8    0
scxspl     192     6684    0     6684     1     0     1     1     0     8    1
plimitpl   152       27    0       20     1     0     1     1     0     8    0
sigapl     424      413    0      384     4     0     4     4     0     8    0
futexpl     56     4217    0     4217     1     0     1     1     0     8    1
knotepl    112       84    0       65     1     0     1     1     0     8    0
kqueuepl   144       49    0       46     1     0     1     1     0     8    0
pipelkpl    16      107    0       97     1     0     1     1     0     8    0
pipepl     120      214    0      195     1     0     1     1     0     8    0
fdescpl    432      398    0      384     2     0     2     2     0     8    0
filepl     120     2558    0     2459     4     0     4     4     0     8    1
lockfpl    104       81    0       80     1     0     1     1     0     8    0
lockfspl    48       28    0       27     1     0     1     1     0     8    0
sessionpl  112       18    0        8     1     0     1     1     0     8    0
pgrppl      48       22    0       12     1     0     1     1     0     8    0
ucredpl     96      164    0      156     1     0     1     1     0     8    0
zombiepl   144      384    0      384     1     0     1     1     0     8    1
processpl  920      413    0      384     4     0     4     4     0     8    0
procpl     624      647    0      610     4     0     4     4     0     8    1
sosppl     128        6    0        6     2     1     1     1     0     8    1
sockpl     400      645    0      627     4     1     3     4     0     8    1
mcl64k     65536     40    0       40     1     0     1     1     0     8    1
mcl16k     16384      1    0        1     1     1     0     1     0     8    0
mcl12k     12288     15    0       15     1     0     1     1     0     8    1
mcl9k      9216       4    0        4     1     0     1     1     0     8    1
mcl8k      8192       4    0        4     2     1     1     1     0     8    1
mcl4k      4096      19    0       19     2     1     1     1     0     8    1
mcl2k      2048   61255    0    61212    15     9     6    13     0     8    0
mtagpl      80       26    0       10     2     1     1     1     0     8    0
mbufpl     256    98503    0    98362    13     2    11    11     0     8    1
bufpl      280     4548    0      161   314     0   314   314     0     8    0
anonpl      16    47397    0    35730    58     2    56    56     0   107    0
amapchunkpl 152    1669    0     1512     7     0     7     7     0   158    0
amappl16   192     1630    0      876    39     0    39    39     0     8    1
amappl15   184        2    0        0     1     0     1     1     0     8    0
amappl14   176      179    0      176     2     1     1     1     0     8    0
amappl13   168       37    0       35     1     0     1     1     0     8    0
amappl12   160        3    0        2     2     1     1     1     0     8    0
amappl11   152       68    0       56     1     0     1     1     0     8    0
amappl10   144       22    0       17     1     0     1     1     0     8    0
amappl9    136      397    0      393     1     0     1     1     0     8    0
amappl8    128      285    0      268     1     0     1     1     0     8    0
amappl7    120      115    0      103     1     0     1     1     0     8    0
amappl6    112       20    0       18     1     0     1     1     0     8    0
amappl5    104      321    0      310     1     0     1     1     0     8    0
amappl4     96      451    0      422     1     0     1     1     0     8    0
amappl3     88      292    0      286     1     0     1     1     0     8    0
amappl2     80     2314    0     2247     3     1     2     3     0     8    0
amappl1     72    16659    0    16243    26    17     9    20     0     8    0
amappl      80      885    0      838     2     0     2     2     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
dma128     128      253    0      253     1     1     0     1     0     8    0
dma64       64        6    0        6     1     1     0     1     0     8    0
dma32       32        7    0        7     1     1     0     1     0     8    0
dma16       16       18    0       17     1     0     1     1     0     8    0
aobjpl      64       13    0        2     1     0     1     1     0     8    0
uaddrrnd    24      404    0      384     1     0     1     1     0     8    0
uaddrbest   32        2    0        0     1     0     1     1     0     8    0
uaddr       24      404    0      384     1     0     1     1     0     8    0
vmmpekpl   168     6736    0     6701     2     0     2     2     0     8    0
vmmpepl    168    53837    0    52013   119    12   107   107     0   357   27
vmsppl     272      403    0      384     2     0     2     2     0     8    0
pdppl      4096     814    0      774     6     0     6     6     0     8    0
pvpl        32   161639    0   147014   140     0   140   140     0   265    4
pmappl     200      403    0      384     2     0     2     2     0     8    1
extentpl    40       46    0       29     1     0     1     1     0     8    0
phpool     112      154    0       17     5     0     5     5     0     8    0

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/03/23 02:48 openbsd 969a87935549 78267cec .config console log report ci-openbsd-main
* Struck through repros no longer work on HEAD.