Commit 1674767
fix(security): handle runc CLONE_INTO_CGROUP to fix cgroup ID propagation
Recent versions of runc use clone3(2) with CLONE_INTO_CGROUP when available,
placing new container processes directly into the target cgroup at spawn time
without writing the PID to cgroup.procs. This eliminates the
CgroupWriteEventType event that the security agent was relying on to propagate
cgroup context to newly created processes, causing incorrect cgroup ID
assignment.
Remove the parent cgroup inheritance via fill_cgroup_context during exec event
handling. Instead, an empty CGroupContext is passed when inserting the exec
entry, which causes the cgroup resolver to fall back to procfs
(/proc/<pid>/cgroup) to resolve the correct cgroup ID. Also inline
copy_proc_cache into its single call site in trace__cgroup_write.
runc reference: opencontainers/runc@5af4dd4
Co-Authored-By: Sylvain Baubeau <sylvain.baubeau@datadoghq.com>1 parent 377ebbd commit 1674767
3 files changed
+2
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | 39 | | |
45 | 40 | | |
46 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
| 63 | + | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
781 | 781 | | |
782 | 782 | | |
783 | 783 | | |
784 | | - | |
785 | | - | |
786 | | - | |
787 | 784 | | |
788 | 785 | | |
789 | 786 | | |
| |||
0 commit comments