From 1517bd95488be386712ddab269ffd1dc1cf37f86 Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Mon, 31 Jul 2017 19:48:42 +0200 Subject: prog: generate missing syscall args when decoding After a change in syscall description the number of syscall arguments might change and some of the programs in corpus get invalidated. This change makes syzkaller to generate missing arguments when decoding a program as an attempt to fix and keep more programs from corpus. --- prog/encoding.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'prog/encoding.go') diff --git a/prog/encoding.go b/prog/encoding.go index c9d5d40c5..69fcdc6cb 100644 --- a/prog/encoding.go +++ b/prog/encoding.go @@ -171,6 +171,11 @@ func Deserialize(data []byte) (prog *Prog, err error) { if !p.EOF() { return nil, fmt.Errorf("tailing data (line #%v)", p.l) } + if len(c.Args) < len(meta.Args) { + for i := len(c.Args); i < len(meta.Args); i++ { + c.Args = append(c.Args, defaultArg(meta.Args[i])) + } + } if len(c.Args) != len(meta.Args) { return nil, fmt.Errorf("wrong call arg count: %v, want %v", len(c.Args), len(meta.Args)) } -- cgit mrf-deployment