From eb9e33b10f006149447e555a6afe12e2d6afc4f9 Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Tue, 5 Mar 2019 15:17:22 +0100 Subject: execprog: fix executing with fault injection If the fault injection flags are not provided, but the log contains a fault injection like this: 2017/08/12 17:16:04 executing program 5 (fault-call:4 fault-nth:5): we fail to enable fault injection in ipc.Config. Fix it. --- tools/syz-execprog/execprog.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/syz-execprog/execprog.go b/tools/syz-execprog/execprog.go index bfc50beaf..5c26bd95a 100644 --- a/tools/syz-execprog/execprog.go +++ b/tools/syz-execprog/execprog.go @@ -303,6 +303,12 @@ func createConfig(target *prog.Target, entries []*prog.LogEntry, execOpts.FaultCall = *flagFaultCall execOpts.FaultNth = *flagFaultNth } + for _, entry := range entries { + if entry.Fault { + config.Flags |= ipc.FlagEnableFault + break + } + } handled := make(map[string]bool) for _, entry := range entries { for _, call := range entry.P.Calls { -- cgit mrf-deployment