aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/host/syscalls_linux.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2021-05-26 09:51:04 +0200
committerDmitry Vyukov <dvyukov@google.com>2021-05-26 11:54:32 +0200
commita353ff5493dc9df2c887df91d7cfe985fa52299e (patch)
treeb42d03144d5457b73ef3e0e0360a57cf9570baae /pkg/host/syscalls_linux.go
parent54f0bcf1949532fe400c3e7d0941909fce7a6d7c (diff)
pkg/host: better error message for missing syscalls
Diffstat (limited to 'pkg/host/syscalls_linux.go')
-rw-r--r--pkg/host/syscalls_linux.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/host/syscalls_linux.go b/pkg/host/syscalls_linux.go
index a13af0caa..90b57a94e 100644
--- a/pkg/host/syscalls_linux.go
+++ b/pkg/host/syscalls_linux.go
@@ -104,7 +104,7 @@ func isSupportedKallsyms(c *prog.Syscall) (bool, string) {
name = newname
}
if !kallsymsSyscallSet[name] {
- return false, fmt.Sprintf("sys_%v is not present in /proc/kallsyms", name)
+ return false, fmt.Sprintf("sys_%v is not enabled in the kernel (not present in /proc/kallsyms)", name)
}
return true, ""
}
@@ -115,17 +115,18 @@ func isSupportedTrial(c *prog.Syscall) (bool, string) {
case "exit", "pause":
return true, ""
}
+ reason := fmt.Sprintf("sys_%v is not enabled in the kernel (returns ENOSYS)", c.CallName)
trialMu.Lock()
defer trialMu.Unlock()
if res, ok := trialSupported[c.NR]; ok {
- return res, "ENOSYS"
+ return res, reason
}
cmd := osutil.Command(os.Args[0])
cmd.Env = []string{fmt.Sprintf("SYZ_TRIAL_TEST=%v", c.NR)}
_, err := osutil.Run(10*time.Second, cmd)
res := err != nil
trialSupported[c.NR] = res
- return res, "ENOSYS"
+ return res, reason
}
func init() {