unveil_start_relative: page fault trap with WITNESS enabled

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

unveil_start_relative: page fault trap with WITNESS enabled

Klemens Nanni-2
Today's snapshot on both my X230 host and VMM guest.  With

OpenBSD 6.4-current (GENERIC) #545: Sat Jan  5 17:44:17 MST 2019
    [hidden email]:/usr/src/sys/arch/amd64/compile/GENERIC

the VM boots fine.

Booting a fresh and otherwise unmodified kernel with only WITNESS
enabled reproducibly leads to a page fault trap in
sys/kern/kern_pledge.c:unveil_start_relative() calling
unveil_flagmatch().

I tried a kernel with `option UNVEIL_DEBUG' only, but that's not enough.
The crash only occurs with `option WITNESS'.

$ cd /usr/src/sys ; cvs -q diff
Index: arch/amd64/conf/GENERIC.MP
===================================================================
RCS file: /cvs/src/sys/arch/amd64/conf/GENERIC.MP,v
retrieving revision 1.14
diff -u -p -r1.14 GENERIC.MP
--- arch/amd64/conf/GENERIC.MP 13 Jul 2018 05:25:24 -0000 1.14
+++ arch/amd64/conf/GENERIC.MP 6 Jan 2019 03:34:34 -0000
@@ -4,6 +4,6 @@ include "arch/amd64/conf/GENERIC"
 
 option MULTIPROCESSOR
 #option MP_LOCKDEBUG
-#option WITNESS
+option WITNESS
 
 cpu* at mainbus?


dmesg, page fault trap and back trace of the VM follows.

$ file ~/vm/test.qcow2
/home/kn/vm/test.qcow2: QEMU QCOW Image (v3), 10737418240 bytes
$ vmctl start test -d ~/vm/test.qcow2 -b obj/bsd
OpenBSD 6.4-current (GENERIC.MP) #17: Sun Jan  6 05:02:30 CET 2019
    [hidden email]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 117440512 (112MB)
avail mem = 96890880 (92MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0
acpi at bios0 not configured
cpu0 at mainbus0: (uniprocessor)
cpu0: Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz, 2595.01 MHz, 06-3a-09
cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SSE3,PCLMUL,SSSE3,CX16,SSE4.1,SSE4.2,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,HV,NXE,LONG,LAHF,ITSC,FSGSBASE,SMEP,ERMS,MELTDOWN
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
pvbus0 at mainbus0: OpenBSD
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "OpenBSD VMM Host" rev 0x00
virtio0 at pci0 dev 1 function 0 "Qumranet Virtio RNG" rev 0x00
viornd0 at virtio0
virtio0: irq 3
virtio1 at pci0 dev 2 function 0 "Qumranet Virtio Storage" rev 0x00
vioblk0 at virtio1
scsibus1 at vioblk0: 2 targets
sd0 at scsibus1 targ 0 lun 0: <VirtIO, Block Device, > SCSI3 0/direct fixed
sd0: 10240MB, 512 bytes/sector, 20971520 sectors
virtio1: irq 5
virtio2 at pci0 dev 3 function 0 "OpenBSD VMM Control" rev 0x00
vmmci0 at virtio2
virtio2: irq 6
isa0 at mainbus0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16450, no fifo
com0: console
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
root on sd0a (95dcfec90818276d.a) swap on sd0b dump on sd0b
Automatic boot in progress: startinguvm_fault(0xffffffff81dd26e0, 0xffff8000002ca138, 0, 1) -> e
 file system checks.
kernel: page fault trap, code=0
Stopped at      unveil_start_relative+0x21:     movzbl  0x48(%rax),%ecx

ddb{0}> bt
unveil_start_relative(2dd1c1d31ba83fd1,ffff8000036d1800) at unveil_start_relati
ve+0x21
namei(7bc8def6a8e54e2f) at namei+0x256
dofstatat(e343070400987677,260,ffff8000036cebc0,ffff8000036e76f0,d650d252c4f3e0
e3) at dofstatat+0x8b
syscall(85b4278dae9d11b) at syscall+0x32a
Xsyscall(6,26,2,26,7f7ffffe7f84,7f7ffffe7ea8) at Xsyscall+0x128
end of kernel
end trace frame: 0x7f7ffffe7e00, count: -5