From 38ab0122a8d69368833457aad6d3d68858c0b561 Mon Sep 17 00:00:00 2001 From: Mahe Tardy Date: Thu, 13 Jun 2024 16:59:17 +0200 Subject: [PATCH] pkg/sensors: pin the ratelimit_map to the fs Signed-off-by: Mahe Tardy --- pkg/sensors/tracing/generickprobe.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/sensors/tracing/generickprobe.go b/pkg/sensors/tracing/generickprobe.go index 41d1f6ea05d..785d280b4df 100644 --- a/pkg/sensors/tracing/generickprobe.go +++ b/pkg/sensors/tracing/generickprobe.go @@ -344,6 +344,11 @@ func createMultiKprobeSensor(sensorPath, policyName string, multiIDs []idtable.E maps = append(maps, socktrack) } + if kernels.EnableLargeProgs() { + ratelimitMap := program.MapBuilderPin("ratelimit_map", sensors.PathJoin(sensorPath, "ratelimit_map"), load) + maps = append(maps, ratelimitMap) + } + enforcerDataMap := enforcerMap(policyName, load) maps = append(maps, enforcerDataMap) @@ -900,6 +905,11 @@ func createKprobeSensorFromEntry(kprobeEntry *genericKprobe, sensorPath string, maps = append(maps, socktrack) } + if kernels.EnableLargeProgs() { + ratelimitMap := program.MapBuilderPin("ratelimit_map", sensors.PathJoin(sensorPath, "ratelimit_map"), load) + maps = append(maps, ratelimitMap) + } + enforcerDataMap := enforcerMap(kprobeEntry.policyName, load) maps = append(maps, enforcerDataMap)