aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-09-23 10:02:53 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-09-23 10:02:53 +0200
commit8f8cf20bd23a37aaf4ac3a7ec3fab2370ef2a755 (patch)
tree4e2931acc236c1c5b83352dd579a62b2c4bf97c8
parent997ce2252ab1a4dc2d5d673b50b6c035e2dca17b (diff)
syz-manager: make vmlinux optional
It's currently both optional and non optional. We require it to be non-empty, but at the same time allow fake "-" which effectively means "no vmlinux". Make it optional.
-rw-r--r--docs/configuration.md3
-rw-r--r--docs/setup_linux-host_android-device_arm64-kernel.md1
-rw-r--r--syz-manager/cover.go9
-rw-r--r--syz-manager/html.go4
-rw-r--r--syz-manager/manager.go8
-rw-r--r--syz-manager/mgrconfig/mgrconfig.go3
6 files changed, 16 insertions, 12 deletions
diff --git a/docs/configuration.md b/docs/configuration.md
index 180affe19..c5f1134a8 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -11,7 +11,8 @@ following keys in its top-level object:
- `<workdir>/corpus.db`: corpus with interesting programs
- `<workdir>/instance-x`: per VM instance temporary files
- `syzkaller`: Location of the `syzkaller` checkout.
- - `vmlinux`: Location of the `vmlinux` file that corresponds to the kernel being tested.
+ - `vmlinux`: Location of the `vmlinux` file that corresponds to the kernel being tested
+ (used for report symbolization and coverage reports, optional).
- `procs`: Number of parallel test processes in each VM (4 or 8 would be a reasonable number).
- `leak`: Detect memory leaks with kmemleak.
- `image`: Location of the disk image file for the QEMU instance; a copy of this file is passed as the
diff --git a/docs/setup_linux-host_android-device_arm64-kernel.md b/docs/setup_linux-host_android-device_arm64-kernel.md
index e7d6fa744..51e1deb3d 100644
--- a/docs/setup_linux-host_android-device_arm64-kernel.md
+++ b/docs/setup_linux-host_android-device_arm64-kernel.md
@@ -19,7 +19,6 @@ $ NDK=/path/to/android/ndk make TARGETOS=android TARGETARCH=arm64
"http": "localhost:50000",
"workdir": "/gopath/src/github.com/google/syzkaller/workdir",
"syzkaller": "/gopath/src/github.com/google/syzkaller",
- "vmlinux": "-",
"sandbox": "none",
"procs": 8,
"type": "adb",
diff --git a/syz-manager/cover.go b/syz-manager/cover.go
index 502cc6097..d6d90dc67 100644
--- a/syz-manager/cover.go
+++ b/syz-manager/cover.go
@@ -66,6 +66,13 @@ func initAllCover(vmlinux string) {
// Running nm on vmlinux may takes 200 microsecond and being called during symbolization of every crash,
// so also do it asynchronously on start and reuse the value during each crash.
go func() {
+ defer func() {
+ close(allCoverReady)
+ close(allSymbolsReady)
+ }()
+ if vmlinux == "" {
+ return
+ }
pcs, err := coveredPCs(vmlinux)
if err == nil {
sort.Sort(uint64Array(pcs))
@@ -78,8 +85,6 @@ func initAllCover(vmlinux string) {
if err != nil {
Logf(0, "failed to run nm on %v: %v", vmlinux, err)
}
- close(allCoverReady)
- close(allSymbolsReady)
}()
}
diff --git a/syz-manager/html.go b/syz-manager/html.go
index 3f8e026ac..2ceb4fc48 100644
--- a/syz-manager/html.go
+++ b/syz-manager/html.go
@@ -168,6 +168,10 @@ func (mgr *Manager) httpCover(w http.ResponseWriter, r *http.Request) {
mgr.mu.Lock()
defer mgr.mu.Unlock()
+ if mgr.cfg.Vmlinux == "" {
+ http.Error(w, fmt.Sprintf("no vmlinux in config file"), http.StatusInternalServerError)
+ return
+ }
var cov cover.Cover
if sig := r.FormValue("input"); sig != "" {
cov = mgr.corpus[sig].Cover
diff --git a/syz-manager/manager.go b/syz-manager/manager.go
index 6b79022ff..35bab59f6 100644
--- a/syz-manager/manager.go
+++ b/syz-manager/manager.go
@@ -754,8 +754,8 @@ func (mgr *Manager) saveRepro(res *repro.Result, hub bool) {
}
func (mgr *Manager) symbolizeReport(text []byte) []byte {
- if len(text) == 0 {
- return nil
+ if len(text) == 0 || mgr.cfg.Vmlinux == "" {
+ return text
}
<-allSymbolsReady
symbolized, err := report.Symbolize(mgr.cfg.Vmlinux, text, allSymbols)
@@ -1149,12 +1149,10 @@ func (mgr *Manager) collectUsedFiles() {
addUsedFile(cfg.SyzExecprogBin)
addUsedFile(cfg.SyzExecutorBin)
addUsedFile(cfg.Sshkey)
+ addUsedFile(cfg.Vmlinux)
if cfg.Image != "9p" {
addUsedFile(cfg.Image)
}
- if cfg.Vmlinux != "-" {
- addUsedFile(cfg.Vmlinux)
- }
}
func (mgr *Manager) checkUsedFiles() {
diff --git a/syz-manager/mgrconfig/mgrconfig.go b/syz-manager/mgrconfig/mgrconfig.go
index d76282d50..b0e3935bb 100644
--- a/syz-manager/mgrconfig/mgrconfig.go
+++ b/syz-manager/mgrconfig/mgrconfig.go
@@ -125,9 +125,6 @@ func load(data []byte, filename string) (*Config, error) {
if cfg.Workdir == "" {
return nil, fmt.Errorf("config param workdir is empty")
}
- if cfg.Vmlinux == "" {
- return nil, fmt.Errorf("config param vmlinux is empty")
- }
if cfg.Type == "" {
return nil, fmt.Errorf("config param type is empty")
}