cilium / tetragon

eBPF-based Security Observability and Runtime Enforcement
https://tetragon.io
Apache License 2.0
3.66k stars 369 forks source link

Add condition for procfs/version if procfs/version_signature fails #3108

Open harisudarsan1 opened 1 week ago

harisudarsan1 commented 1 week ago

Description

Previously func GetKernelVersion(kernelVersion string, procfs string) (int, string, error) helper only checks the procfs/version_signature. I have added a condition to check procfs/version if first check fails.

olsajiri commented 4 days ago

func GetKernelVersion(kernelVersion string, procfs string) (int, string, error) helper only checks the procfs/version_signature. I have added a condition to check procfs/version

the current code falls back to get version from uname.. what's the benefit of reading /proc/version? is there some scenario where current code is broken/gives bad result?

harisudarsan1 commented 3 days ago

@olsajiri I included /proc/version as an additional check because it is available in most Linux distributions, whereas /proc/version_signature is specific to Ubuntu-based derivatives. However, the version still needs to be extracted from the contents of /proc/version.

harisudarsan1 commented 3 days ago

But I think if we are anyways falling back to uname then there is no need of /proc/version