fuzz.yaml: add pkg/compiler and trace2syz fuzzers

This commit is contained in:
Dmitry Vyukov 2019-03-05 14:32:33 +01:00
parent 5fae638ea6
commit 5677e61bfa
2 changed files with 19 additions and 7 deletions

View File

@ -1,10 +1,20 @@
language: go
version: "1.11"
base: ubuntu:16.04 base: ubuntu:16.04
checkout: github.com/google/syzkaller
targets: targets:
- name: report - name: report
language: go
version: "1.11"
harness: harness:
function: Fuzz function: Fuzz
package: github.com/google/syzkaller/pkg/report package: github.com/google/syzkaller/pkg/report
checkout: github.com/google/syzkaller
build_tags: syz_target build_tags: syz_target
- name: compiler
harness:
function: Fuzz
package: github.com/google/syzkaller/pkg/compiler
build_tags: syz_target
- name: trace2syz
harness:
function: Fuzz
package: github.com/google/syzkaller/tools/syz-trace2syz/proggen
build_tags: syz_target syz_os_linux syz_arch_amd64

View File

@ -1,12 +1,11 @@
// Copyright 2017 syzkaller project authors. All rights reserved. // Copyright 2017 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// +build gofuzz
package compiler package compiler
import ( import (
"github.com/google/syzkaller/pkg/ast" "github.com/google/syzkaller/pkg/ast"
"github.com/google/syzkaller/sys/targets"
) )
func Fuzz(data []byte) int { func Fuzz(data []byte) int {
@ -15,11 +14,14 @@ func Fuzz(data []byte) int {
if desc == nil { if desc == nil {
return 0 return 0
} }
prog := Compile(desc, fuzzConsts, eh) prog := Compile(desc, fuzzConsts, fuzzTarget, eh)
if prog == nil { if prog == nil {
return 0 return 0
} }
return 1 return 1
} }
var fuzzConsts = map[string]uint64{"A": 1, "B": 2, "C": 3, "SYS_C": 4} var (
fuzzTarget = targets.Get("test", "64")
fuzzConsts = map[string]uint64{"A": 1, "B": 2, "C": 3, "SYS_A": 4, "SYS_B": 5, "SYS_C": 6}
)