Skip to content

Commit afb62e1

Browse files
authored
atelet: add CAP_DAC_OVERRIDE to reset dirs a non-root container wrote (agent-substrate#1910)
Follow-up to agent-substrate#1906. Removing a directory entry needs write permission on the directory that holds it, and with all capabilities dropped uid 0 gets no exemption. A non-root container can create a subdirectory in its `0777` durable dir; that subdirectory belongs to the container's uid, typically `0755`, so root cannot empty it. `resetActorDirs` fails after every checkpoint of such an actor and the suspend never completes. Chmod first, as the bundle dir does, is no way out: chmod needs ownership or `CAP_FOWNER`. Why atelet and not ateom, which already holds the capability: an ateom that dies before cleanup leaves the files behind and moves the hang to the next resume on that node. atelet owns the actor directories and needs it on the crash path either way. Manifest only, so no unit test. Exercised on kind with the micro-VM class: uid 65532 writes a durable dir, then suspend and resume. Without the capability the same run hangs in `SUSPENDING`. - [x] Tests pass - [x] Appropriate changes to documentation are included in the PR (none needed)
1 parent 6c60ec5 commit afb62e1

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎manifests/ate-install/atelet.yaml‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,10 @@ spec:
161161
- --drain-timeout=5m
162162
# atelet does no mounts, netlink, device, or namespace operations (those
163163
# live in the ateom worker pod) — it only reads/writes the
164-
# /var/lib/ate hostPath as root, so it needs no Linux
165-
# capabilities. (Unpacking arbitrary actor images can require writing into
166-
# image-defined read-only dirs; the untar in cmd/atelet/oci.go extracts
167-
# directories writable then restores the image's modes, and removal makes
168-
# them writable again first, so root suffices without CAP_DAC_OVERRIDE.)
164+
# /var/lib/ate hostPath as root. CAP_DAC_OVERRIDE is for one thing:
165+
# emptying a directory a non-root actor created in its 0777 durable dir.
166+
# It is owned by the actor's uid, typically 0755, so root has no write
167+
# access to it and resetActorDirs fails after every checkpoint.
169168
# runAsUser is pinned explicitly rather than relying on the base image's
170169
# default user.
171170
securityContext:
@@ -174,6 +173,8 @@ spec:
174173
capabilities:
175174
drop:
176175
- ALL
176+
add:
177+
- DAC_OVERRIDE
177178
# Keep per-node reservations small; omit limits to allow usage to grow
178179
# with the number of hosted actors.
179180
resources:

0 commit comments

Comments
 (0)