aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/host
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/host')
-rw-r--r--pkg/host/syscalls.go20
1 files changed, 11 insertions, 9 deletions
diff --git a/pkg/host/syscalls.go b/pkg/host/syscalls.go
index d63c7ceef..e322fc3b1 100644
--- a/pkg/host/syscalls.go
+++ b/pkg/host/syscalls.go
@@ -16,16 +16,24 @@ func DetectSupportedSyscalls(target *prog.Target, sandbox string) (
log.Logf(1, "detecting supported syscalls")
supported := make(map[*prog.Syscall]bool)
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 {
for _, c := range target.Syscalls {
- supported[c] = true
+ if c.Attrs.Disabled {
+ unsupported[c] = disabledAttribute
+ } else {
+ supported[c] = true
+ }
}
} else {
for _, c := range target.Syscalls {
ok, reason := false, ""
- switch c.CallName {
- case "syz_execute_func":
+ switch {
+ case c.Attrs.Disabled:
+ ok = false
+ reason = disabledAttribute
+ case c.CallName == "syz_execute_func":
// syz_execute_func caused multiple problems:
// 1. First it lead to corpus exploision. The program used existing values in registers
// to pollute output area. We tried to zero registers (though, not reliably).
@@ -55,12 +63,6 @@ func DetectSupportedSyscalls(target *prog.Target, sandbox string) (
}
}
}
- for c := range supported {
- if c.Attrs.Disabled {
- delete(supported, c)
- unsupported[c] = "has disabled attribute in descriptions"
- }
- }
return supported, unsupported, nil
}