aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AUTHORS1
-rw-r--r--CONTRIBUTORS1
-rw-r--r--docs/configuration.md2
-rw-r--r--syz-manager/manager.go21
-rw-r--r--syz-manager/mgrconfig/mgrconfig.go2
5 files changed, 24 insertions, 3 deletions
diff --git a/AUTHORS b/AUTHORS
index 1add43407..658ba380d 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -15,3 +15,4 @@ Jean-Baptiste Cayrou
Yuzhe Han
Utkarsh Anand
Tobias Klauser
+Tim Tianyang Chen
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index c0656a5c3..c2680fffc 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -25,3 +25,4 @@ Yuzhe Han
Thomas Garnier
Utkarsh Anand
Tobias Klauser
+Tim Tianyang Chen
diff --git a/docs/configuration.md b/docs/configuration.md
index ed301267b..04c9ca1bf 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -6,6 +6,8 @@ invocation time with the `-config` option. This configuration can be based on t
following keys in its top-level object:
- `http`: URL that will display information about the running `syz-manager` process.
+ - `email_addr`: Optional email address to receive notifications when bugs are encountered for the first time.
+ Mailx is the only supported mailer. Please set it up prior to using this function.
- `workdir`: Location of a working directory for the `syz-manager` process. Outputs here include:
- `<workdir>/crashes/*`: crash output files (see [Crash Reports](#crash-reports))
- `<workdir>/corpus.db`: corpus with interesting programs
diff --git a/syz-manager/manager.go b/syz-manager/manager.go
index f5d403419..ea127e865 100644
--- a/syz-manager/manager.go
+++ b/syz-manager/manager.go
@@ -11,6 +11,7 @@ import (
"math/rand"
"net"
"os"
+ "os/exec"
"os/signal"
"path/filepath"
"sync"
@@ -576,19 +577,33 @@ func (mgr *Manager) isSuppressed(crash *Crash) bool {
return false
}
+func (mgr *Manager) emailCrash(crash *Crash) {
+ if mgr.cfg.Email_Addr == "" {
+ return
+ }
+ Logf(0, "sending email to %v", mgr.cfg.Email_Addr)
+ cmd := exec.Command("mailx", "-s", "syzkaller: "+crash.Title, mgr.cfg.Email_Addr)
+ cmd.Stdin = bytes.NewReader(crash.Report.Report)
+ if _, err := osutil.Run(10*time.Minute, cmd); err != nil {
+ Logf(0, "failed to send email: %v", err)
+ }
+}
+
func (mgr *Manager) saveCrash(crash *Crash) bool {
Logf(0, "vm-%v: crash: %v", crash.vmIndex, crash.Title)
+ if err := mgr.getReporter().Symbolize(crash.Report); err != nil {
+ Logf(0, "failed to symbolize report: %v", err)
+ }
+
mgr.mu.Lock()
mgr.stats["crashes"]++
if !mgr.crashTypes[crash.Title] {
mgr.crashTypes[crash.Title] = true
mgr.stats["crash types"]++
+ go mgr.emailCrash(crash)
}
mgr.mu.Unlock()
- if err := mgr.getReporter().Symbolize(crash.Report); err != nil {
- Logf(0, "failed to symbolize report: %v", err)
- }
if mgr.dash != nil {
dc := &dashapi.Crash{
BuildID: mgr.cfg.Tag,
diff --git a/syz-manager/mgrconfig/mgrconfig.go b/syz-manager/mgrconfig/mgrconfig.go
index a4afb9247..cc3abf59b 100644
--- a/syz-manager/mgrconfig/mgrconfig.go
+++ b/syz-manager/mgrconfig/mgrconfig.go
@@ -34,6 +34,8 @@ type Config struct {
Hub_Addr string
Hub_Key string
+ Email_Addr string // syz-manager will send crash emails to this address using mailx (optional)
+
Dashboard_Client string
Dashboard_Addr string
Dashboard_Key string