aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-04-15 14:54:59 +0200
committerDmitry Vyukov <dvyukov@google.com>2024-04-16 14:20:36 +0000
commit4cd91fc0b5007710bf0f38de6319ce24c31a52e5 (patch)
tree025210f316d065a63e680a054ab04c017ebc7315 /tools
parent7e9780e93983e03547322aab489429ae4a7d2fa3 (diff)
pkg/ipc: pass only exec encoding to Exec
Does not require passing text program to ipc.Env.Exec. Make it possible to provide just the exec encoding. This requires moving fallback coverage to the host since it need the program.
Diffstat (limited to 'tools')
-rw-r--r--tools/syz-execprog/execprog.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/syz-execprog/execprog.go b/tools/syz-execprog/execprog.go
index d2d194da2..6bcc92a07 100644
--- a/tools/syz-execprog/execprog.go
+++ b/tools/syz-execprog/execprog.go
@@ -176,10 +176,18 @@ func (ctx *Context) execute(pid int, env *ipc.Env, p *prog.Prog, progIndex int)
if *flagOutput {
ctx.logProgram(pid, p, callOpts)
}
+ progData, err := p.SerializeForExec()
+ if err != nil {
+ log.Logf(1, "RESULT: failed to serialize: %v", err)
+ return
+ }
// This mimics the syz-fuzzer logic. This is important for reproduction.
for try := 0; ; try++ {
- output, info, hanged, err := env.Exec(callOpts, p)
- if err != nil && err != prog.ErrExecBufferTooSmall {
+ output, info, hanged, err := env.ExecProg(callOpts, progData)
+ if err != nil {
+ if ctx.config.Flags&ipc.FlagDebug != 0 {
+ log.Logf(0, "result: hanged=%v err=%v\n\n%s", hanged, err, output)
+ }
if try > 10 {
log.SyzFatalf("executor %d failed %d times: %v\n%s", pid, try, err, output)
}
@@ -190,9 +198,6 @@ func (ctx *Context) execute(pid int, env *ipc.Env, p *prog.Prog, progIndex int)
}
continue
}
- if ctx.config.Flags&ipc.FlagDebug != 0 || err != nil {
- log.Logf(0, "result: hanged=%v err=%v\n\n%s", hanged, err, output)
- }
if info != nil {
ctx.printCallResults(info)
if *flagHints {