diff --git a/pkg/security/ebpf/kernel/kernel.go b/pkg/security/ebpf/kernel/kernel.go index 65170a4d53c0f..7ff8ef846ac9e 100644 --- a/pkg/security/ebpf/kernel/kernel.go +++ b/pkg/security/ebpf/kernel/kernel.go @@ -251,6 +251,11 @@ func (k *Version) IsRH9_3Kernel() bool { return k.IsRH9Kernel() && strings.HasPrefix(k.OsRelease["VERSION_ID"], "9.3") } +// IsRH9_4Kernel returns whether the kernel is a rh9.3 kernel +func (k *Version) IsRH9_4Kernel() bool { + return k.IsRH9Kernel() && strings.HasPrefix(k.OsRelease["VERSION_ID"], "9.4") +} + // IsSuseKernel returns whether the kernel is a suse kernel func (k *Version) IsSuseKernel() bool { return k.IsSLESKernel() || k.OsRelease["ID"] == "opensuse-leap" diff --git a/pkg/security/probe/probe_ebpf.go b/pkg/security/probe/probe_ebpf.go index f93605ac53282..2729554affe28 100644 --- a/pkg/security/probe/probe_ebpf.go +++ b/pkg/security/probe/probe_ebpf.go @@ -2338,6 +2338,10 @@ func getOvlPathInOvlInode(kernelVersion *kernel.Version) uint64 { return 2 } + if kernelVersion.IsInRangeCloseOpen(kernel.Kernel5_14, kernel.Kernel5_15) && kernelVersion.IsRH9_4Kernel() { + return 2 + } + // https://github.com/torvalds/linux/commit/ffa5723c6d259b3191f851a50a98d0352b345b39 // changes a bit how the lower dentry/inode is stored in `ovl_inode`. To check if we // are in this configuration we first probe the kernel version, then we check for the