From b042176ac78c191253124063054b63153abcbe96 Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Fri, 17 Feb 2017 16:07:48 +0100 Subject: host: open /dev/net/tun to check if syz_emit_ethernet is enabled --- host/host.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/host/host.go b/host/host.go index 74696e46d..1cea844ff 100644 --- a/host/host.go +++ b/host/host.go @@ -99,7 +99,10 @@ func isSupportedSyzkall(c *sys.Call) bool { _, err := os.Stat("/dev/fuse") return err == nil && syscall.Getuid() == 0 case "syz_emit_ethernet": - _, err := os.Stat("/dev/net/tun") + fd, err := syscall.Open("/dev/net/tun", syscall.O_RDWR, 0) + if err == nil { + syscall.Close(fd) + } return err == nil && syscall.Getuid() == 0 case "syz_kvm_setup_cpu": switch c.Name { -- cgit mrf-deployment