uvm_fault: memset

0 views
Skip to first unread message

syzbot

unread,
Aug 8, 2021, 12:46:22 AMAug 8
to syzkaller-o...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3395d9ad18ab Nuke a few Capt. Obvious comments.
git tree: openbsd
console output: https://syzkaller.appspot.com/x/log.txt?x=1176b681300000
kernel config: https://syzkaller.appspot.com/x/.config?x=bf87b6915a88cd0d
dashboard link: https://syzkaller.appspot.com/bug?extid=aed2c23886430a6eaedb
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1526f0f6300000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1608f59e300000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+aed2c2...@syzkaller.appspotmail.com

uvm_fault(0xffffffff8287ed30, 0xffff800020cef119, 0, 2) -> d
kernel: page fault trap, code=0
Stopped at memset+0x45: repe stosb %es:(%rdi)
TID PID UID PRFLAGS PFLAGS CPU COMMAND
264753 44369 0 0x2 0 0 syz-executor0355
*168314 6028 73 0x100010 0 1K syslogd
memset() at memset+0x45
ffs_write(ffff800021223800) at ffs_write+0x932 sys/ufs/ffs/ffs_vnops.c:403
VOP_WRITE(fffffd806e786050,ffff800021223a20,3,fffffd807f7d7900) at VOP_WRITE+0xc6 sys/kern/vfs_vops.c:272
vn_write(fffffd806fc7c5f0,ffff800021223a20,0) at vn_write+0x151 sys/kern/vfs_vnops.c:414
dofilewritev(ffff800021193a48,e,ffff800021223a20,0,ffff800021223b10) at dofilewritev+0x1a3 sys/kern/sys_generic.c:365
sys_writev(ffff800021193a48,ffff800021223ac0,ffff800021223b10) at sys_writev+0xa7 sys/kern/sys_generic.c:312
syscall(ffff800021223b90) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline]
syscall(ffff800021223b90) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7f7ffffd2510, count: 7
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
*cpu1: uvm_fault(0xffffffff8287ed30, 0xffff800020cef119, 0, 2) -> d
ddb{1}> trace
memset() at memset+0x45
ffs_write(ffff800021223800) at ffs_write+0x932 sys/ufs/ffs/ffs_vnops.c:403
VOP_WRITE(fffffd806e786050,ffff800021223a20,3,fffffd807f7d7900) at VOP_WRITE+0xc6 sys/kern/vfs_vops.c:272
vn_write(fffffd806fc7c5f0,ffff800021223a20,0) at vn_write+0x151 sys/kern/vfs_vnops.c:414
dofilewritev(ffff800021193a48,e,ffff800021223a20,0,ffff800021223b10) at dofilewritev+0x1a3 sys/kern/sys_generic.c:365
sys_writev(ffff800021193a48,ffff800021223ac0,ffff800021223b10) at sys_writev+0xa7 sys/kern/sys_generic.c:312
syscall(ffff800021223b90) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline]
syscall(ffff800021223b90) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7f7ffffd2510, count: -8
ddb{1}> show registers
rdi 0xffff800020cef119
rsi 0
rbp 0xffff800021223720
rbx 0x1
rdx 0x7
rcx 0x7
rax 0
r8 0x3ee0 __ALIGN_SIZE+0x2ee0
r9 0xffff800021223678
r10 0x5f51cde1143be2cf
r11 0xffff800020cef119
r12 0x38119 acpi_pdirpa+0x23f81
r13 0xfffffd806e61e878
r14 0x4000 __ALIGN_SIZE+0x3000
r15 0xfffffd806e61e878
rip 0xffffffff822dc6f5 memset+0x45
cs 0x8
rflags 0x10202 __ALIGN_SIZE+0xf202
rsp 0xffff800021223528
ss 0x10
memset+0x45: repe stosb %es:(%rdi)
ddb{1}> show proc
PROC (syslogd) pid=168314 stat=onproc
flags process=100010<SUGID,PLEDGE> proc=0
pri=24, usrpri=50, nice=20
forw=0xffffffffffffffff, list=0xffff8000211937a8,0xffff8000ffff7d00
process=0xffff800021209500 user=0xffff80002121e000, vmspace=0xfffffd806eed2cf8
estcpu=0, cpticks=1, pctcpu=0.0
user=0, sys=1, intr=0
ddb{1}> ps
PID TID PPID UID S FLAGS WAIT COMMAND
6633 473037 44369 0 2 0 syz-executor0355
44369 264753 20919 0 7 0x2 syz-executor0355
20919 117355 29257 0 3 0x10008a sigsusp ksh
29257 441204 56099 0 3 0x9a select sshd
41462 227377 1 0 3 0x100083 ttyin getty
56099 252903 1 0 3 0x88 select sshd
59934 130005 21887 74 3 0x100092 bpf pflogd
21887 489575 1 0 3 0x80 netio pflogd
* 6028 168314 12843 73 7 0x100010 syslogd
12843 222404 1 0 3 0x100082 netio syslogd
69765 197690 1 0 3 0x100080 kqread resolvd
47388 274250 73551 77 3 0x100092 kqread dhcpleased
74444 415724 73551 77 3 0x100092 kqread dhcpleased
73551 467172 1 0 3 0x80 kqread dhcpleased
4134 31330 0 0 3 0x14200 bored smr
8473 418198 0 0 3 0x14200 pgzero zerothread
12308 133722 0 0 3 0x14200 aiodoned aiodoned
87258 17750 0 0 3 0x14200 syncer update
26921 168823 0 0 3 0x14200 cleaner cleaner
19657 271753 0 0 3 0x14200 reaper reaper
71895 13281 0 0 3 0x14200 pgdaemon pagedaemon
22195 518732 0 0 3 0x14200 bored crynlk
9480 445725 0 0 3 0x14200 bored crypto
41086 97685 0 0 3 0x14200 bored viomb
58508 352324 0 0 3 0x40014200 acpi0 acpi0
49076 129259 0 0 3 0x40014200 idle1
98265 480171 0 0 3 0x14200 bored softnet
63528 498017 0 0 3 0x14200 bored systqmp
52164 147632 0 0 3 0x14200 bored systq
70067 194483 0 0 3 0x40014200 bored softclock
50001 379280 0 0 3 0x40014200 idle0
1 77179 0 0 3 0x82 wait init
0 0 -1 0 3 0x10200 scheduler swapper
ddb{1}> show all locks
Process 44369 (syz-executor0355) thread 0xffff8000ffff7270 (264753)
exclusive rwlock amaplk r = 0 (0xfffffd806d1b6e18)
#0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline]
#0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182
#1 uvm_fault_check+0x3d2 sys/uvm/uvm_fault.c:774
#2 uvm_fault+0x102 sys/uvm/uvm_fault.c:601
#3 upageflttrap+0x82 sys/arch/amd64/amd64/trap.c:181
#4 usertrap+0x214 sys/arch/amd64/amd64/trap.c:403
#5 recall_trap+0x8
shared rwlock vmmaplk r = 0 (0xfffffd806eed2020)
#0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline]
#0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182
#1 uvmfault_lookup+0xd9 sys/uvm/uvm_fault.c:1701
#2 uvm_fault_check+0x3a sys/uvm/uvm_fault.c:674
#3 uvm_fault+0x102 sys/uvm/uvm_fault.c:601
#4 upageflttrap+0x82 sys/arch/amd64/amd64/trap.c:181
#5 usertrap+0x214 sys/arch/amd64/amd64/trap.c:403
#6 recall_trap+0x8
Process 6028 (syslogd) thread 0xffff800021193a48 (168314)
exclusive rrwlock inode r = 0 (0xfffffd806e61e810)
#0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline]
#0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182
#1 rw_enter+0x3e2 sys/kern/kern_rwlock.c:310
#2 rrw_enter+0x8b sys/kern/kern_rwlock.c:461
#3 VOP_LOCK+0x87 sys/kern/vfs_vops.c:614
#4 vn_lock+0x84 sys/kern/vfs_vnops.c:579
#5 vn_write+0x11d sys/kern/vfs_vnops.c:411
#6 dofilewritev+0x1a3 sys/kern/sys_generic.c:365
#7 sys_writev+0xa7 sys/kern/sys_generic.c:312
#8 syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline]
#8 syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587
#9 Xsyscall+0x128
exclusive kernel_lock &kernel_lock r = 1 (0xffffffff828cdd58)
#0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline]
#0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182
#1 vn_write+0x42 sys/kern/vfs_vnops.c:399
#2 dofilewritev+0x1a3 sys/kern/sys_generic.c:365
#3 sys_writev+0xa7 sys/kern/sys_generic.c:312
#4 syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline]
#4 syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587
#5 Xsyscall+0x128
ddb{1}> show malloc
Type InUse MemUse HighUse Limit Requests Type Lim
devbuf 10113 6416K 6417K 78643K 11203 0
pcb 13 8K 8K 78643K 13 0
rtable 62 2K 2K 78643K 112 0
ifaddr 29 8K 8K 78643K 30 0
counters 40 33K 33K 78643K 40 0
ioctlops 0 0K 4K 78643K 1479 0
mount 1 1K 1K 78643K 1 0
log 0 0K 0K 78643K 6 0
vnodes 1183 74K 75K 78643K 1189 0
UFS quota 1 32K 32K 78643K 1 0
UFS mount 5 36K 36K 78643K 5 0
shm 2 1K 1K 78643K 2 0
VM map 2 1K 1K 78643K 2 0
sem 2 0K 0K 78643K 2 0
dirhash 12 2K 2K 78643K 12 0
ACPI 1697 195K 286K 78643K 12598 0
file desc 1 0K 0K 78643K 1 0
proc 67 87K 87K 78643K 278 0
NFS srvsock 1 0K 0K 78643K 1 0
NFS daemon 1 16K 16K 78643K 1 0
in_multi 11 0K 0K 78643K 11 0
ether_multi 1 0K 0K 78643K 1 0
ISOFS mount 1 32K 32K 78643K 1 0
MSDOSFS mount 1 16K 16K 78643K 1 0
ttys 19 95K 95K 78643K 19 0
exec 0 0K 2K 78643K 348 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 81 3K 6K 78643K 27216 0
UVM aobj 3 2K 2K 78643K 3 0
memdesc 1 4K 4K 78643K 1 0
crypto data 1 1K 1K 78643K 1 0
NDP 4 0K 0K 78643K 4 0
temp 23 4193K 4257K 78643K 3944 0
kqueue 9 12K 12K 78643K 9 0
SYN cache 2 16K 16K 78643K 2 0
ddb{1}> show all pools
Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle
plcache 128 22 0 0 1 0 1 1 0 8 0
rtpcb 120 17 0 14 1 0 1 1 0 8 0
rtentry 112 23 0 1 1 0 1 1 0 8 0
unpcb 120 35 0 20 1 0 1 1 0 8 0
syncache 296 5 0 5 2 2 0 1 0 8 0
tcpcb 736 8 0 5 1 0 1 1 0 8 0
arp 120 2 0 0 1 0 1 1 0 8 0
inpcb 304 32 0 26 1 0 1 1 0 8 0
pfosfp 40 1428 0 1005 5 0 5 5 0 8 0
pfosfpen 112 1428 0 714 21 0 21 21 0 8 0
pfstitem 24 9 0 7 2 1 1 1 0 8 0
pfstkey 112 9 0 7 2 1 1 1 0 8 0
pfstate 320 9 0 7 2 1 1 1 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 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
dino2pl 256 1414 0 23 87 0 87 87 0 8 0
ffsino 272 1414 0 23 93 0 93 93 0 8 0
nchpl 144 1589 0 40 58 0 58 58 0 8 0
uvmvnodes 72 1425 0 0 26 0 26 26 0 8 0
vnodes 224 1425 0 0 84 0 84 84 0 8 0
namei 1024 10087 0 10087 2 1 1 1 0 8 1
percpumem 16 32 0 0 1 0 1 1 0 8 0
scxspl 216 7745 0 7745 14 13 1 8 0 8 1
plimitpl 152 16 0 9 1 0 1 1 0 8 0
sigapl 424 2236 0 2204 4 0 4 4 0 8 0
futexpl 56 3519 0 3519 1 0 1 1 0 8 1
knotepl 112 24 0 0 1 0 1 1 0 8 0
kqueuepl 216 5 0 0 1 0 1 1 0 8 0
pipepl 336 69 0 66 2 1 1 1 0 8 0
fdescpl 496 2220 0 2204 3 0 3 3 0 8 0
filepl 152 7024 0 6966 3 0 3 3 0 8 0
lockfpl 104 6 0 4 1 0 1 1 0 8 0
lockfspl 48 4 0 2 1 0 1 1 0 8 0
sessionpl 144 18 0 9 1 0 1 1 0 8 0
pgrppl 48 18 0 9 1 0 1 1 0 8 0
ucredpl 96 70 0 57 1 0 1 1 0 8 0
zombiepl 144 2204 0 2204 2 1 1 1 0 8 1
processpl 1072 2236 0 2204 3 0 3 3 0 8 0
procpl 672 4216 0 4184 3 0 3 3 0 8 0
sockpl 480 84 0 60 5 1 4 4 0 8 0
mcl8k 8192 3 0 0 1 0 1 1 0 8 0
mcl4k 4096 5 0 0 1 0 1 1 0 8 0
mcl2k 2048 57 0 0 8 0 8 8 0 8 0
mtagpl 96 2 0 0 1 0 1 1 0 8 0
mbufpl 256 111 0 0 7 0 7 7 0 8 0
bufpl 280 7978 0 1750 445 0 445 445 0 8 0
anonpl 24 580776 0 578471 19 3 16 17 0 186 2
amapchunkpl 152 55486 0 55342 9 2 7 8 0 158 1
amappl16 200 2074 0 2071 1 0 1 1 0 8 0
amappl15 192 1 0 1 1 1 0 1 0 8 0
amappl13 176 18 0 17 2 1 1 1 0 8 0
amappl12 168 14 0 14 1 1 0 1 0 8 0
amappl11 160 47 0 33 1 0 1 1 0 8 0
amappl10 152 29 0 25 1 0 1 1 0 8 0
amappl9 144 217 0 215 1 0 1 1 0 8 0
amappl8 136 2256 0 2255 2 1 1 1 0 8 0
amappl7 128 52 0 44 1 0 1 1 0 8 0
amappl6 120 86 0 81 1 0 1 1 0 8 0
amappl5 112 197 0 181 1 0 1 1 0 8 0
amappl4 104 528 0 507 1 0 1 1 0 8 0
amappl3 96 48 0 45 1 0 1 1 0 8 0
amappl2 88 2380 0 2334 3 1 2 2 0 8 0
amappl1 80 29140 0 28765 11 2 9 9 0 8 0
amappl 88 24992 0 24927 2 0 2 2 0 92 0
dma4096 4096 1 0 1 1 1 0 1 0 8 0
dma1024 1024 1 0 0 1 0 1 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 2 0 0 1 0 1 1 0 8 0
uaddrrnd 24 2220 0 2204 1 0 1 1 0 8 0
uaddrbest 32 2 0 0 1 0 1 1 0 8 0
uaddr 24 2220 0 2204 1 0 1 1 0 8 0
vmmpekpl 168 13928 0 13912 1 0 1 1 0 8 0
vmmpepl 168 143174 0 142316 44 4 40 41 0 357 0
vmsppl 368 2219 0 2204 2 0 2 2 0 8 0
rwobjpl 56 44183 0 43634 11 2 9 9 0 8 1
pdppl 4096 4448 0 4408 58 18 40 44 0 8 0
pvpl 32 754970 0 750757 45 8 37 38 0 265 2
pmappl 224 2219 0 2204 2 0 2 2 0 8 0
extentpl 40 58 0 40 1 0 1 1 0 8 0
phpool 112 277 0 23 8 0 8 8 0 8 0
ddb{1}> machine ddbcpu 0
Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp
x86_ipi_db(ffffffff827d7ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:353
x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106
Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23
__mp_lock(ffffffff828cdb50) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline]
__mp_lock(ffffffff828cdb50) at __mp_lock+0x122 sys/kern/kern_lock.c:147
syscall(ffff800021228f90) at syscall+0x42d mi_syscall sys/sys/syscall_mi.h:93 [inline]
syscall(ffff800021228f90) at syscall+0x42d sys/arch/amd64/amd64/trap.c:587
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7f7ffffbd700, count: 9
ddb{0}> trace
x86_ipi_db(ffffffff827d7ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:353
x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106
Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23
__mp_lock(ffffffff828cdb50) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline]
__mp_lock(ffffffff828cdb50) at __mp_lock+0x122 sys/kern/kern_lock.c:147
syscall(ffff800021228f90) at syscall+0x42d mi_syscall sys/sys/syscall_mi.h:93 [inline]
syscall(ffff800021228f90) at syscall+0x42d sys/arch/amd64/amd64/trap.c:587
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7f7ffffbd700, count: -6
ddb{0}> machine ddbcpu 1
Stopped at memset+0x45: repe stosb %es:(%rdi)
memset() at memset+0x45
ffs_write(ffff800021223800) at ffs_write+0x932 sys/ufs/ffs/ffs_vnops.c:403
VOP_WRITE(fffffd806e786050,ffff800021223a20,3,fffffd807f7d7900) at VOP_WRITE+0xc6 sys/kern/vfs_vops.c:272
vn_write(fffffd806fc7c5f0,ffff800021223a20,0) at vn_write+0x151 sys/kern/vfs_vnops.c:414
dofilewritev(ffff800021193a48,e,ffff800021223a20,0,ffff800021223b10) at dofilewritev+0x1a3 sys/kern/sys_generic.c:365
sys_writev(ffff800021193a48,ffff800021223ac0,ffff800021223b10) at sys_writev+0xa7 sys/kern/sys_generic.c:312
syscall(ffff800021223b90) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline]
syscall(ffff800021223b90) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7f7ffffd2510, count: 7
ddb{1}> trace
memset() at memset+0x45
ffs_write(ffff800021223800) at ffs_write+0x932 sys/ufs/ffs/ffs_vnops.c:403
VOP_WRITE(fffffd806e786050,ffff800021223a20,3,fffffd807f7d7900) at VOP_WRITE+0xc6 sys/kern/vfs_vops.c:272
vn_write(fffffd806fc7c5f0,ffff800021223a20,0) at vn_write+0x151 sys/kern/vfs_vnops.c:414
dofilewritev(ffff800021193a48,e,ffff800021223a20,0,ffff800021223b10) at dofilewritev+0x1a3 sys/kern/sys_generic.c:365
sys_writev(ffff800021193a48,ffff800021223ac0,ffff800021223b10) at sys_writev+0xa7 sys/kern/sys_generic.c:312
syscall(ffff800021223b90) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline]
syscall(ffff800021223b90) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7f7ffffd2510, count: -8


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches
Reply all
Reply to author
Forward
0 new messages