aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/host/features.go10
-rw-r--r--pkg/host/syscalls.go3
2 files changed, 9 insertions, 4 deletions
diff --git a/pkg/host/features.go b/pkg/host/features.go
index 10137f2d9..800e3ea19 100644
--- a/pkg/host/features.go
+++ b/pkg/host/features.go
@@ -66,7 +66,7 @@ func Check(target *prog.Target) (*Features, error) {
FeatureDevlinkPCI: {Name: "devlink PCI setup", Reason: unsupported},
FeatureUSBEmulation: {Name: "USB emulation", Reason: unsupported},
}
- if targets.Get(target.OS, target.Arch).HostFuzzer {
+ if noHostChecks(target) {
return res, nil
}
for n, check := range checkFeature {
@@ -86,7 +86,7 @@ func Check(target *prog.Target) (*Features, error) {
// Setup enables and does any one-time setup for the requested features on the host.
// Note: this can be called multiple times and must be idempotent.
func Setup(target *prog.Target, features *Features, featureFlags csource.Features, executor string) error {
- if targets.Get(target.OS, target.Arch).HostFuzzer {
+ if noHostChecks(target) {
return nil
}
args := strings.Split(executor, " ")
@@ -110,3 +110,9 @@ func Setup(target *prog.Target, features *Features, featureFlags csource.Feature
_, err := osutil.RunCmd(5*time.Minute, "", executor, args...)
return err
}
+
+func noHostChecks(target *prog.Target) bool {
+ // HostFuzzer targets can't run Go binaries on the targets,
+ // so we actually run on the host on another OS. The same for "test" OS.
+ return targets.Get(target.OS, target.Arch).HostFuzzer || target.OS == "test"
+}
diff --git a/pkg/host/syscalls.go b/pkg/host/syscalls.go
index e322fc3b1..2abd3f16b 100644
--- a/pkg/host/syscalls.go
+++ b/pkg/host/syscalls.go
@@ -6,7 +6,6 @@ package host
import (
"github.com/google/syzkaller/pkg/log"
"github.com/google/syzkaller/prog"
- "github.com/google/syzkaller/sys/targets"
)
// DetectSupportedSyscalls returns list on supported and unsupported syscalls on the host.
@@ -18,7 +17,7 @@ func DetectSupportedSyscalls(target *prog.Target, sandbox string) (
unsupported := make(map[*prog.Syscall]string)
const disabledAttribute = "has disabled attribute in descriptions"
// These do not have own host and parasitize on some other OS.
- if targets.Get(target.OS, target.Arch).HostFuzzer {
+ if noHostChecks(target) {
for _, c := range target.Syscalls {
if c.Attrs.Disabled {
unsupported[c] = disabledAttribute