Skip to content

Commit

Permalink
[CWS] Fix cgroup dentry resolution for RHEL 7 (#31666)
Browse files Browse the repository at this point in the history
  • Loading branch information
lebauce authored Dec 3, 2024
1 parent c06bdd6 commit d667639
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/security/probe/probe_ebpf.go
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,11 @@ func (p *EBPFProbe) handleEvent(CPU int, data []byte) {
if pce != nil {
path, err := p.Resolvers.DentryResolver.Resolve(event.CgroupWrite.File.PathKey, true)
if err == nil && path != "" {
cgroupID := containerutils.CGroupID(filepath.Dir(string(path)))
if !p.kernelVersion.IsRH7Kernel() {
path = filepath.Dir(string(path))
}

cgroupID := containerutils.CGroupID(path)
pce.CGroup.CGroupID = cgroupID
pce.Process.CGroup.CGroupID = cgroupID
cgroupFlags := containerutils.CGroupFlags(event.CgroupWrite.CGroupFlags)
Expand Down

0 comments on commit d667639

Please sign in to comment.