From 8f58a0efbf867526a0adee8d9a5cb38e2ebf1ee4 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Thu, 26 Aug 2021 15:42:22 +0000 Subject: syz-manager: handle extra coverage in /syscalls page Extra coverage is attributed to a fake ".extra" syscall, which is not present in SyscallMap. As syz-manager is not aware of this, it fails to render the /syscalls page, when remote coverage is present. Handle fake syscalls gracefully during /syscalls page rendering. Closes #2725. --- syz-manager/html.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/syz-manager/html.go b/syz-manager/html.go index e7d58304e..dc3e54519 100644 --- a/syz-manager/html.go +++ b/syz-manager/html.go @@ -96,9 +96,13 @@ func (mgr *Manager) httpSyscalls(w http.ResponseWriter, r *http.Request) { Name: mgr.cfg.Name, } for c, cc := range mgr.collectSyscallInfo() { + var syscallID *int + if syscall, ok := mgr.target.SyscallMap[c]; ok { + syscallID = &syscall.ID + } data.Calls = append(data.Calls, UICallType{ Name: c, - ID: mgr.target.SyscallMap[c].ID, + ID: syscallID, Inputs: cc.count, Cover: len(cc.cov), }) @@ -673,7 +677,7 @@ type UIStat struct { type UICallType struct { Name string - ID int + ID *int Inputs int Cover int } @@ -769,7 +773,7 @@ var syscallsTemplate = html.CreatePage(` {{range $c := $.Calls}} - {{$c.Name}} [{{$c.ID}}] + {{$c.Name}}{{if $c.ID }} [{{$c.ID}}]{{end}} {{$c.Inputs}} {{$c.Cover}} prio -- cgit mrf-deployment