diff options
| author | Andrey Konovalov <andreyknvl@google.com> | 2019-03-05 15:17:22 +0100 |
|---|---|---|
| committer | Andrey Konovalov <andreyknvl@gmail.com> | 2019-03-05 16:05:02 +0100 |
| commit | eb9e33b10f006149447e555a6afe12e2d6afc4f9 (patch) | |
| tree | 0341e754ae74047741b42310f276133a11e4ba7f | |
| parent | 5677e61bfab4a14da27c2d216f4b5f1edd27f48f (diff) | |
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.
| -rw-r--r-- | tools/syz-execprog/execprog.go | 6 |
1 files changed, 6 insertions, 0 deletions
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 { |
