Skip to content

Commit

Permalink
execprog: fix executing with fault injection
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
xairy committed Mar 5, 2019
1 parent 5677e61 commit eb9e33b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/syz-execprog/execprog.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit eb9e33b

Please sign in to comment.