Skip to content

Commit

Permalink
syz-manager: check for binary files in queue.Request
Browse files Browse the repository at this point in the history
We don't support them in syz-manager.
  • Loading branch information
a-nogikh committed May 16, 2024
1 parent 9a220d4 commit b4a10c5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion syz-manager/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ func (serv *RPCServer) ExchangeInfo(a *rpctype.ExchangeInfoRequest, r *rpctype.E
// It's unlikely that subsequent Next() calls will yield something.
break
}
if err := inp.Validate(); err != nil {
if err := validateRequest(inp); err != nil {
panic(fmt.Sprintf("invalid request: %v, req: %#v", err, inp))
}
if req, ok := serv.newRequest(runner, inp); ok {
Expand Down Expand Up @@ -400,6 +400,18 @@ func (serv *RPCServer) ExchangeInfo(a *rpctype.ExchangeInfoRequest, r *rpctype.E
return nil
}

func validateRequest(req *queue.Request) error {
err := req.Validate()
if err != nil {
return err
}
if req.BinaryFile != "" {
// Currnetly it should only be done in tools/syz-runtest.
return fmt.Errorf("binary file execution is not supported")
}
return nil
}

func (serv *RPCServer) findRunner(name string) *Runner {
if val, _ := serv.runners.Load(name); val != nil {
runner := val.(*Runner)
Expand Down

0 comments on commit b4a10c5

Please sign in to comment.