aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-01-09 12:13:32 +0100
committerAleksandr Nogikh <nogikh@google.com>2024-01-09 11:47:13 +0000
commit4807fb37655c65620525dcf72cf9f59a27a7c58c (patch)
tree28940ff34258c9b38f8b0f3aec1ea4cff24b771f
parent668b1c2966ea9e411e3c21a47e07eecfcc05b989 (diff)
dashboard: prevent infinite reporting of revoked repros
Fix a bug in the reporting of bugs with revoked reproducers. Add a test that reproduces the problematic situation. Also, ensure that we don't include the revoked reproducer into the report we send to the next reporting stage. Cc #4412.
-rw-r--r--dashboard/app/app_test.go1
-rw-r--r--dashboard/app/reporting.go26
-rw-r--r--dashboard/app/reporting_test.go44
3 files changed, 58 insertions, 13 deletions
diff --git a/dashboard/app/app_test.go b/dashboard/app/app_test.go
index 3fdefe76b..81b836ed6 100644
--- a/dashboard/app/app_test.go
+++ b/dashboard/app/app_test.go
@@ -276,6 +276,7 @@ var testConfig = &GlobalConfig{
},
FindBugOriginTrees: true,
CacheUIPages: true,
+ RetestRepros: true,
},
"access-public-email": {
AccessLevel: AccessPublic,
diff --git a/dashboard/app/reporting.go b/dashboard/app/reporting.go
index 8cd058787..8b85702ca 100644
--- a/dashboard/app/reporting.go
+++ b/dashboard/app/reporting.go
@@ -106,7 +106,7 @@ func needReport(c context.Context, typ string, state *ReportingState, bug *Bug)
return
}
link = bugReporting.Link
- if !bugReporting.Reported.IsZero() && bugReporting.ReproLevel >= bug.ReproLevel {
+ if !bugReporting.Reported.IsZero() && bugReporting.ReproLevel >= bug.HeadReproLevel {
status = fmt.Sprintf("%v: reported%v on %v",
reporting.DisplayTitle, reproStr(bugReporting.ReproLevel),
html.FormatTime(bugReporting.Reported))
@@ -538,14 +538,6 @@ func crashBugReport(c context.Context, bug *Bug, crash *Crash, crashKey *db.Key,
if len(report) > maxMailReportLen {
report = report[:maxMailReportLen]
}
- reproC, _, err := getText(c, textReproC, crash.ReproC)
- if err != nil {
- return nil, err
- }
- reproSyz, err := loadReproSyz(c, crash)
- if err != nil {
- return nil, err
- }
machineInfo, _, err := getText(c, textMachineInfo, crash.MachineInfo)
if err != nil {
return nil, err
@@ -573,10 +565,6 @@ func crashBugReport(c context.Context, bug *Bug, crash *Crash, crashKey *db.Key,
ReportLink: externalLink(c, textCrashReport, crash.Report),
CC: kernelRepo.CC.Always,
Maintainers: append(crash.Maintainers, kernelRepo.CC.Maintainers...),
- ReproC: reproC,
- ReproCLink: externalLink(c, textReproC, crash.ReproC),
- ReproSyz: reproSyz,
- ReproSyzLink: externalLink(c, textReproSyz, crash.ReproSyz),
ReproOpts: crash.ReproOpts,
MachineInfo: machineInfo,
MachineInfoLink: externalLink(c, textMachineInfo, crash.MachineInfo),
@@ -588,6 +576,18 @@ func crashBugReport(c context.Context, bug *Bug, crash *Crash, crashKey *db.Key,
Assets: assetList,
ReportElements: &dashapi.ReportElements{GuiltyFiles: crash.ReportElements.GuiltyFiles},
}
+ if !crash.ReproIsRevoked {
+ rep.ReproCLink = externalLink(c, textReproC, crash.ReproC)
+ rep.ReproC, _, err = getText(c, textReproC, crash.ReproC)
+ if err != nil {
+ return nil, err
+ }
+ rep.ReproSyzLink = externalLink(c, textReproSyz, crash.ReproSyz)
+ rep.ReproSyz, err = loadReproSyz(c, crash)
+ if err != nil {
+ return nil, err
+ }
+ }
if bugReporting.CC != "" {
rep.CC = append(rep.CC, strings.Split(bugReporting.CC, "|")...)
}
diff --git a/dashboard/app/reporting_test.go b/dashboard/app/reporting_test.go
index 0cb198d15..841a63285 100644
--- a/dashboard/app/reporting_test.go
+++ b/dashboard/app/reporting_test.go
@@ -1174,3 +1174,47 @@ func TestObsoletePeriod(t *testing.T) {
})
}
}
+
+func TestReportRevokedRepro(t *testing.T) {
+ // There was a bug (#4412) where syzbot infinitely re-reported reproducers
+ // for a bug that was upstreamed after its repro was revoked.
+ // Recreate this situation.
+ c := NewCtx(t)
+ defer c.Close()
+
+ client := c.makeClient(clientPublic, keyPublic, true)
+ build := testBuild(1)
+ build.KernelRepo = "git://mygit.com/git.git"
+ build.KernelBranch = "main"
+ client.UploadBuild(build)
+
+ crash := testCrash(build, 1)
+ crash.ReproOpts = []byte("repro opts")
+ crash.ReproSyz = []byte("repro syz")
+ client.ReportCrash(crash)
+ rep1 := client.pollBug()
+ client.expectNE(rep1.ReproSyz, nil)
+
+ // Revoke the reproducer.
+ c.advanceTime(c.config().Obsoleting.ReproRetestStart + time.Hour)
+ jobResp := client.pollSpecificJobs(build.Manager, dashapi.ManagerJobs{TestPatches: true})
+ c.expectEQ(jobResp.Type, dashapi.JobTestPatch)
+ client.expectOK(client.JobDone(&dashapi.JobDoneReq{
+ ID: jobResp.ID,
+ }))
+
+ c.advanceTime(time.Hour)
+ client.ReportCrash(testCrash(build, 1))
+
+ // Upstream the bug.
+ c.advanceTime(time.Hour)
+ client.updateBug(rep1.ID, dashapi.BugStatusUpstream, "")
+ rep2 := client.pollBug()
+
+ // Also ensure that we do not report the revoked reproducer.
+ client.expectEQ(rep2.Type, dashapi.ReportNew)
+ client.expectEQ(rep2.ReproSyz, []byte(nil))
+
+ // Expect no further reports.
+ client.pollBugs(0)
+}