diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2023-02-03 18:14:33 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2023-02-10 14:34:44 +0100 |
| commit | 9fabcd5358c5e2df6f3936739fd726ed12d86b3a (patch) | |
| tree | 61948381d3c06d42684c233151b25ee46c0b0dac /pkg/subsystem/linux/subsystems.go | |
| parent | ba1c7407eaa0c09e93d8f319c9e7e65bdf0187d3 (diff) | |
pkg/subsystem/linux: add custom call lists
This information will let us extract subsystems from reproducers.
Diffstat (limited to 'pkg/subsystem/linux/subsystems.go')
| -rw-r--r-- | pkg/subsystem/linux/subsystems.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/subsystem/linux/subsystems.go b/pkg/subsystem/linux/subsystems.go index 468ba5fbc..9d9688758 100644 --- a/pkg/subsystem/linux/subsystems.go +++ b/pkg/subsystem/linux/subsystems.go @@ -85,9 +85,19 @@ func (ctx *linuxCtx) getSubsystems() ([]*entity.Subsystem, error) { if err := setSubsystemNames(ret); err != nil { return nil, fmt.Errorf("failed to set names: %w", err) } + ctx.applyExtraRules(ret) return ret, nil } +func (ctx *linuxCtx) applyExtraRules(list []*entity.Subsystem) { + if ctx.extraRules == nil { + return + } + for _, entry := range list { + entry.Syscalls = ctx.extraRules.subsystemCalls[entry.Name] + } +} + func mergeRawRecords(subsystem *entity.Subsystem, records []*maintainersRecord) { unique := func(list []string) []string { m := make(map[string]struct{}) |
