From efe43dc07148eb245f13e9cd30b42de21d514966 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 25 Jan 2016 19:08:17 +0100 Subject: sys: open a bunch of new devices --- host/host.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'host') diff --git a/host/host.go b/host/host.go index 1225a876e..942632f4c 100644 --- a/host/host.go +++ b/host/host.go @@ -7,6 +7,7 @@ import ( "bytes" "io/ioutil" "os" + "strconv" "strings" "syscall" @@ -68,9 +69,20 @@ func isSupportedSyzkall(kallsyms []byte, c *sys.Call) bool { if syscall.Getuid() != 0 { return false } - dev := strings.Replace(fname.Val, "#", "0", 1) - _, err := os.Stat(dev) - return err == nil + var check func(dev string) bool + check = func(dev string) bool { + if !strings.Contains(dev, "#") { + _, err := os.Stat(dev) + return err == nil + } + for i := 0; i < 10; i++ { + if check(strings.Replace(dev, "#", strconv.Itoa(i), 1)) { + return true + } + } + return false + } + return check(fname.Val) case "syz_open_pts": return true case "syz_fuse_mount": -- cgit mrf-deployment