mirror of
https://github.com/reactos/syzkaller.git
synced 2024-10-07 09:03:28 +00:00
fuzz.yaml: add pkg/compiler and trace2syz fuzzers
This commit is contained in:
parent
5fae638ea6
commit
5677e61bfa
16
fuzz.yaml
16
fuzz.yaml
@ -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
|
||||||
|
@ -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}
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user