From 9fabcd5358c5e2df6f3936739fd726ed12d86b3a Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Fri, 3 Feb 2023 18:14:33 +0100 Subject: pkg/subsystem/linux: add custom call lists This information will let us extract subsystems from reproducers. --- pkg/subsystem/linux/subsystems.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pkg/subsystem/linux/subsystems.go') 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{}) -- cgit mrf-deployment