aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--syz-manager/html.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/syz-manager/html.go b/syz-manager/html.go
index 2ceb4fc48..4c7c6de51 100644
--- a/syz-manager/html.go
+++ b/syz-manager/html.go
@@ -4,6 +4,7 @@
package main
import (
+ "bufio"
"fmt"
"html/template"
"io"
@@ -35,6 +36,7 @@ func (mgr *Manager) initHttp() {
http.HandleFunc("/prio", mgr.httpPrio)
http.HandleFunc("/file", mgr.httpFile)
http.HandleFunc("/report", mgr.httpReport)
+ http.HandleFunc("/rawcover", mgr.httpRawCover)
ln, err := net.Listen("tcp4", mgr.cfg.Http)
if err != nil {
@@ -289,6 +291,30 @@ func (mgr *Manager) httpReport(w http.ResponseWriter, r *http.Request) {
}
}
+func (mgr *Manager) httpRawCover(w http.ResponseWriter, r *http.Request) {
+ mgr.mu.Lock()
+ defer mgr.mu.Unlock()
+
+ base, err := getVmOffset(mgr.cfg.Vmlinux)
+ if err != nil {
+ http.Error(w, fmt.Sprintf("failed to get vmlinux base: %v", err), http.StatusInternalServerError)
+ return
+ }
+
+ var cov cover.Cover
+ for _, inp := range mgr.corpus {
+ cov = cover.Union(cov, cover.Cover(inp.Cover))
+ }
+
+ w.Header().Set("Content-Type", "text/plain; charset=utf-8")
+ buf := bufio.NewWriter(w)
+ for _, pc := range cov {
+ restored := cover.RestorePC(pc, base) - callLen
+ fmt.Fprintf(buf, "0x%x\n", restored)
+ }
+ buf.Flush()
+}
+
func collectCrashes(workdir string) ([]*UICrashType, error) {
crashdir := filepath.Join(workdir, "crashes")
dirs, err := osutil.ListDir(crashdir)