Skip to content

Commit

Permalink
Fix cgroup dentry resolution for cgroups v1
Browse files Browse the repository at this point in the history
  • Loading branch information
lebauce committed Dec 3, 2024
1 parent def8858 commit dffc829
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 @@ -824,7 +824,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 dffc829

Please sign in to comment.