From f593101047f94f3858fb2368ddcddadff2f33148 Mon Sep 17 00:00:00 2001 From: Gabe Kirkpatrick Date: Mon, 17 Jul 2023 21:32:48 +0000 Subject: 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. --- tools/syz-mutate/mutate.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tools') 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) -- cgit mrf-deployment