diff options
| author | Gabe Kirkpatrick <gkirkpatrick@google.com> | 2023-07-17 21:32:48 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2023-07-19 16:50:05 +0000 |
| commit | f593101047f94f3858fb2368ddcddadff2f33148 (patch) | |
| tree | 06cd05f44b0424f974e5746ac5fd6cae69cd8380 | |
| parent | 022df2bb9a105c303cf24c910b8e787cf642a3f3 (diff) | |
tools/syz-mutate: added strict flag to syz-mutate
Added a "strict" flag to syz-mutate to allow parsing programs in either
strict or non-strict mode.
| -rw-r--r-- | tools/syz-mutate/mutate.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/syz-mutate/mutate.go b/tools/syz-mutate/mutate.go index 5c97f92e9..86b574f23 100644 --- a/tools/syz-mutate/mutate.go +++ b/tools/syz-mutate/mutate.go @@ -29,6 +29,7 @@ var ( flagHintCall = flag.Int("hint-call", -1, "mutate the specified call with hints in hint-src/cmp flags") flagHintSrc = flag.Uint64("hint-src", 0, "compared value in the program") flagHintCmp = flag.Uint64("hint-cmp", 0, "compare operand in the kernel") + flagStrict = flag.Bool("strict", true, "parse input program in strict mode") ) func main() { @@ -76,7 +77,11 @@ func main() { fmt.Fprintf(os.Stderr, "failed to read prog file: %v\n", err) os.Exit(1) } - p, err = target.Deserialize(data, prog.Strict) + mode := prog.Strict + if !*flagStrict { + mode = prog.NonStrict + } + p, err = target.Deserialize(data, mode) if err != nil { fmt.Fprintf(os.Stderr, "failed to deserialize the program: %v\n", err) os.Exit(1) |
