aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-05-07 12:03:10 +0200
committerAleksandr Nogikh <nogikh@google.com>2024-05-07 10:41:44 +0000
commit81583f2a55d25fcba3454f60a979dfd3a8c67f5c (patch)
tree7d84d33c7182b83f2c88654f23180c714181a200
parent0955da9e52431ca2d6b2d55a41b72018726799d5 (diff)
pkg/subsystem: don't Cc some parent subsystems
Our fs is more generic than it was defined in MAINTAINERS. Let's not spam its mailing lists with bugs from individual filesystem implementations.
-rw-r--r--pkg/subsystem/entities.go8
-rw-r--r--pkg/subsystem/entities_test.go12
-rw-r--r--pkg/subsystem/linux/rules.go5
-rw-r--r--pkg/subsystem/linux/subsystems.go1
-rw-r--r--tools/syz-query-subsystems/generator.go31
5 files changed, 38 insertions, 19 deletions
diff --git a/pkg/subsystem/entities.go b/pkg/subsystem/entities.go
index 338447ad4..493f2fe67 100644
--- a/pkg/subsystem/entities.go
+++ b/pkg/subsystem/entities.go
@@ -10,8 +10,10 @@ type Subsystem struct {
Lists []string
Maintainers []string
Parents []*Subsystem
- // If NoReminders is set to true, there should be no monthly reports for the subsystem.
+ // If NoReminders is true, there should be no monthly reports for the subsystem.
NoReminders bool
+ // If NoIndirectCc is true, the subsystem lists are not tagged in sub-subsystem reports.
+ NoIndirectCc bool
}
// ReachableParents returns the set of subsystems reachable from the current one.
@@ -41,7 +43,9 @@ func (subsystem *Subsystem) Emails() []string {
ret = append(ret, subsystem.Maintainers...)
// For its parent subsystems, we only take lists.
for parent := range subsystem.ReachableParents() {
- ret = append(ret, parent.Lists...)
+ if !parent.NoIndirectCc {
+ ret = append(ret, parent.Lists...)
+ }
}
return ret
}
diff --git a/pkg/subsystem/entities_test.go b/pkg/subsystem/entities_test.go
index 81c970b65..a15b25ea7 100644
--- a/pkg/subsystem/entities_test.go
+++ b/pkg/subsystem/entities_test.go
@@ -30,13 +30,17 @@ func TestSubsystemEmails(t *testing.T) {
Maintainers: []string{"c@person.com"},
Parents: []*Subsystem{parentParent},
}
+ parent3 := &Subsystem{
+ Lists: []string{"d@list.com"},
+ NoIndirectCc: true,
+ }
subsystem := &Subsystem{
- Lists: []string{"d@list.com"},
- Maintainers: []string{"d@person.com"},
- Parents: []*Subsystem{parent1, parent2},
+ Lists: []string{"e@list.com"},
+ Maintainers: []string{"e@person.com"},
+ Parents: []*Subsystem{parent1, parent2, parent3},
}
assert.ElementsMatch(t, subsystem.Emails(), []string{
- "a@list.com", "b@list.com", "c@list.com", "d@list.com", "d@person.com",
+ "a@list.com", "b@list.com", "c@list.com", "e@list.com", "e@person.com",
})
}
diff --git a/pkg/subsystem/linux/rules.go b/pkg/subsystem/linux/rules.go
index dd46bc1d1..ecc05e5ec 100644
--- a/pkg/subsystem/linux/rules.go
+++ b/pkg/subsystem/linux/rules.go
@@ -14,6 +14,8 @@ type customRules struct {
extraSubsystems map[string][]string
// For these subsystems we do not generate monthly reminders.
noReminders map[string]struct{}
+ // We don't want to tag these subsystems in the reports of its sub-subsystem bugs.
+ noIndirectCc map[string]struct{}
// Extra child->[]parent links (on top of the inferred ones).
addParents map[string][]string
}
@@ -105,5 +107,8 @@ var (
// By MAINTAINERS, wireless is somewhat separate, but it's better to keep it as a net child.
"wireless": {"net"},
},
+ noIndirectCc: map[string]struct{}{
+ "fs": {},
+ },
}
)
diff --git a/pkg/subsystem/linux/subsystems.go b/pkg/subsystem/linux/subsystems.go
index e5b44a02e..9da38d321 100644
--- a/pkg/subsystem/linux/subsystems.go
+++ b/pkg/subsystem/linux/subsystems.go
@@ -145,6 +145,7 @@ func (ctx *linuxCtx) applyExtraRules(list []*subsystem.Subsystem) error {
for _, entry := range list {
entry.Syscalls = ctx.extraRules.subsystemCalls[entry.Name]
_, entry.NoReminders = ctx.extraRules.noReminders[entry.Name]
+ _, entry.NoIndirectCc = ctx.extraRules.noIndirectCc[entry.Name]
perName[entry.Name] = entry
}
for from, toNames := range ctx.extraRules.addParents {
diff --git a/tools/syz-query-subsystems/generator.go b/tools/syz-query-subsystems/generator.go
index d738be0f0..f2a38ff82 100644
--- a/tools/syz-query-subsystems/generator.go
+++ b/tools/syz-query-subsystems/generator.go
@@ -45,11 +45,12 @@ func generateSubsystemsFile(name string, list []*subsystem.Subsystem, commitInfo
}
sort.Strings(parents)
subsystem := &templateSubsystem{
- VarName: varName,
- Name: serializer.WriteString(entry.Name),
- PathRules: serializer.WriteString(entry.PathRules),
- Parents: parents,
- NoReminders: entry.NoReminders,
+ VarName: varName,
+ Name: serializer.WriteString(entry.Name),
+ PathRules: serializer.WriteString(entry.PathRules),
+ Parents: parents,
+ NoReminders: entry.NoReminders,
+ NoIndirectCc: entry.NoIndirectCc,
}
// Some of the records are mostly empty.
if len(entry.Maintainers) > 0 {
@@ -112,14 +113,15 @@ func hierarchyList(list []*subsystem.Subsystem) []string {
var makeVarRegexp = regexp.MustCompile(`[^\w]|^([^a-z0-9]+)`)
type templateSubsystem struct {
- VarName string
- Name string
- Syscalls string
- PathRules string
- Lists string
- Maintainers string
- Parents []string
- NoReminders bool
+ VarName string
+ Name string
+ Syscalls string
+ PathRules string
+ Lists string
+ Maintainers string
+ Parents []string
+ NoReminders bool
+ NoIndirectCc bool
}
type templateVars struct {
@@ -172,6 +174,9 @@ var {{range $i, $item := .List}}
{{- if .NoReminders}}
NoReminders: true,
{{- end}}
+{{- if .NoIndirectCc}}
+NoIndirectCc: true,
+{{- end}}
}
{{end}}