aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorAnton Lindqvist <anton@basename.se>2019-05-02 04:30:36 +0200
committerGreg Steuck <gnezdo@google.com>2019-05-01 19:30:36 -0700
commit1852eb1814586da4d527df5b75a2850eff3f7144 (patch)
tree85f58f3e7b58858332594a8e838dcdca27423407 /pkg
parentc7c3f772cad4718f4c777362d5183ad20bce85db (diff)
sys/openbsd: add vmm descriptions (#1152)
Most probably limited to input validation for now. In the future, it could be extended to provide a bootable kernel during vm create (/bsd) and turn vmid into a proper resource. The OpenBSD VMs on GCE does support vmm(4).
Diffstat (limited to 'pkg')
-rw-r--r--pkg/host/host_openbsd.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/pkg/host/host_openbsd.go b/pkg/host/host_openbsd.go
index 4e4a509c7..bbf373de9 100644
--- a/pkg/host/host_openbsd.go
+++ b/pkg/host/host_openbsd.go
@@ -4,10 +4,27 @@
package host
import (
+ "fmt"
+ "strings"
+ "syscall"
+
"github.com/google/syzkaller/prog"
)
func isSupported(c *prog.Syscall, target *prog.Target, sandbox string) (bool, string) {
+ if strings.HasPrefix(c.CallName, "ioctl$VMM_") {
+ return isSupportedVMM()
+ }
+ return true, ""
+}
+
+func isSupportedVMM() (bool, string) {
+ device := "/dev/vmm"
+ fd, err := syscall.Open(device, syscall.O_RDONLY, 0)
+ if fd == -1 {
+ return false, fmt.Sprintf("open(%v) failed: %v", device, err)
+ }
+ syscall.Close(fd)
return true, ""
}