From 7e9780e93983e03547322aab489429ae4a7d2fa3 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 15 Apr 2024 14:54:59 +0200 Subject: syz-manager, syz-fuzzer: send RPC notifications about executing programs Instead of printing full program from the fuzzer, send a short notification with program ID to the manager and let manager emit the program into the log. This significnatly reduces amount of communication and makes it possible to not send text programs to the fuzzer at all. --- pkg/rpctype/rpc.go | 4 ++++ pkg/rpctype/rpctype.go | 17 +++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'pkg') diff --git a/pkg/rpctype/rpc.go b/pkg/rpctype/rpc.go index 39a299653..73e4512c4 100644 --- a/pkg/rpctype/rpc.go +++ b/pkg/rpctype/rpc.go @@ -110,6 +110,10 @@ func (cli *RPCClient) Call(method string, args, reply interface{}) error { return cli.c.Call(method, args, reply) } +func (cli *RPCClient) AsyncCall(method string, args interface{}) { + cli.c.Go(method, args, nil, nil) +} + func (cli *RPCClient) Close() { cli.c.Close() } diff --git a/pkg/rpctype/rpctype.go b/pkg/rpctype/rpctype.go index 7e15ba69c..07a217e05 100644 --- a/pkg/rpctype/rpctype.go +++ b/pkg/rpctype/rpctype.go @@ -37,8 +37,10 @@ type ExecutionRequest struct { // ExecutionResult is sent after ExecutionRequest is completed. type ExecutionResult struct { - ID int64 - Info ipc.ProgInfo + ID int64 + ProcID int + Try int + Info ipc.ProgInfo } // ExchangeInfoRequest is periodically sent by syz-fuzzer to syz-manager. @@ -57,6 +59,17 @@ type ExchangeInfoReply struct { DropMaxSignal []uint32 } +// ExecutingRequest is notification from the fuzzer that it started executing +// the program ProgID. We want this request to be as small and as fast as possible +// b/c we want it to reach manager (or at least leave the VM) before it crashes +// executing this program. +type ExecutingRequest struct { + Name string + ID int64 + ProcID int + Try int +} + // TODO: merge ExecutionRequest and ExecTask. type ExecTask struct { Prog []byte -- cgit mrf-deployment