From 6e246992ef22d548e63bd141cd0087a0553b82d6 Mon Sep 17 00:00:00 2001 From: Hasan Mahmood Date: Thu, 9 Jan 2025 15:34:50 -0600 Subject: [PATCH] Disable protocol classification on rhel 9+ --- .../tracer/connection/kprobe/tracer.go | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/pkg/network/tracer/connection/kprobe/tracer.go b/pkg/network/tracer/connection/kprobe/tracer.go index 52d7f6737c50f..0fd21dd880531 100644 --- a/pkg/network/tracer/connection/kprobe/tracer.go +++ b/pkg/network/tracer/connection/kprobe/tracer.go @@ -53,6 +53,8 @@ var ( tracerOffsetGuesserRunner = offsetguess.TracerOffsets.Offsets errCORETracerNotSupported = errors.New("CO-RE tracer not supported on this platform") + + rhel9KernelVersion = kernel.VersionCode(5, 14, 0) ) // ClassificationSupported returns true if the current kernel version supports the classification feature. @@ -71,7 +73,23 @@ func ClassificationSupported(config *config.Config) bool { return false } - return currentKernelVersion >= classificationMinimumKernel + if currentKernelVersion < classificationMinimumKernel { + return false + } + + // TODO: fix protocol classification is not supported on RHEL 9+ + family, err := kernel.Family() + if err != nil { + log.Warnf("could not determine OS family: %s", err) + return false + } + + if family == "rhel" && currentKernelVersion >= rhel9KernelVersion { + log.Warn("protocol classification is currently not supported on RHEL 9+") + return false + } + + return true } // LoadTracer loads the co-re/prebuilt/runtime compiled network tracer, depending on config