diff options
| author | Ethan Graham <ethangraham@google.com> | 2025-09-16 09:15:21 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2025-09-22 09:11:54 +0000 |
| commit | 00c475bd12fe0219cd0564fc64272452b40d372c (patch) | |
| tree | a878c5171f769783b91b2dbd541559b2612b2892 /tools | |
| parent | a13ba2b663b7d2761d9ff6cf1165fa4f2f64aa2c (diff) | |
tools/syz-prog2c: add vmlinux parsing stage for KFuzzTest
If vmlinux is specified as a flag, we perform a setup stage where we
parse vmlinux for KFuzzTest targets.
Signed-off-by: Ethan Graham <ethangraham@google.com>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/syz-prog2c/prog2c.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/syz-prog2c/prog2c.go b/tools/syz-prog2c/prog2c.go index 27476ffbf..f5402041d 100644 --- a/tools/syz-prog2c/prog2c.go +++ b/tools/syz-prog2c/prog2c.go @@ -11,6 +11,7 @@ import ( "runtime" "github.com/google/syzkaller/pkg/csource" + "github.com/google/syzkaller/pkg/kfuzztest" "github.com/google/syzkaller/prog" _ "github.com/google/syzkaller/sys" ) @@ -33,6 +34,7 @@ var ( flagLeak = flag.Bool("leak", false, "do leak checking") flagEnable = flag.String("enable", "none", "enable only listed additional features") flagDisable = flag.String("disable", "none", "enable all additional features except listed") + flagVmlinux = flag.String("vmlinux", "", "path to vmlinux binary (required for dynamically discovered calls") ) func main() { @@ -54,6 +56,13 @@ func main() { fmt.Fprintf(os.Stderr, "%v\n", err) os.Exit(1) } + if *flagVmlinux != "" { + _, err = kfuzztest.ActivateKFuzzTargets(target, *flagVmlinux) + if err != nil { + fmt.Fprintf(os.Stderr, "%v\n", err) + os.Exit(1) + } + } data, err := os.ReadFile(*flagProg) if err != nil { fmt.Fprintf(os.Stderr, "failed to read prog file: %v\n", err) |
