Skip to content
Permalink
Browse files

syz-fuzzer: fix "all system calls are disabled" handling

Currently we don't fill enabled/disabled calls when we return
"all system calls are disabled" error. As the result manager
does not print any explanation for the error.
Fill in enabled/disabled calls when all calls are disabled.
  • Loading branch information...
dvyukov committed Apr 29, 2019
1 parent 27544d0 commit 85e64702d65a4e91ee71e0c1de540bd2a58d0dbe
Showing with 9 additions and 8 deletions.
  1. +3 −2 syz-fuzzer/fuzzer.go
  2. +6 −6 syz-fuzzer/testing.go
@@ -163,9 +163,10 @@ func main() {
checkArgs.allSandboxes = r.AllSandboxes
r.CheckResult, err = checkMachine(checkArgs)
if err != nil {
r.CheckResult = &rpctype.CheckArgs{
Error: err.Error(),
if r.CheckResult == nil {
r.CheckResult = new(rpctype.CheckArgs)
}
r.CheckResult.Error = err.Error()
}
r.CheckResult.Name = *flagName
if err := manager.Call("Manager.Check", r.CheckResult, nil); err != nil {
@@ -160,11 +160,11 @@ func checkMachine(args *checkArgs) (*rpctype.CheckArgs, error) {
}
for _, sandbox := range sandboxes {
enabledCalls, disabledCalls, err := buildCallList(args.target, args.enabledCalls, sandbox)
if err != nil {
return nil, err
}
res.EnabledCalls[sandbox] = enabledCalls
res.DisabledCalls[sandbox] = disabledCalls
if err != nil {
return res, err
}
}
if args.allSandboxes {
var enabled []int
@@ -291,11 +291,11 @@ func buildCallList(target *prog.Target, enabledCalls []int, sandbox string) (
delete(calls, c)
}
}
if len(calls) == 0 {
return nil, nil, fmt.Errorf("all system calls are disabled")
}
for c := range calls {
enabled = append(enabled, c.ID)
}
if len(calls) == 0 {
return enabled, disabled, fmt.Errorf("all system calls are disabled")
}
return enabled, disabled, nil
}

0 comments on commit 85e6470

Please sign in to comment.
You can’t perform that action at this time.