Skip to content

fix(imagecache): keep the owner an image layer gives its files - #115

Merged
QuentinBisson merged 2 commits into
giantswarmfrom
fork/image-layer-ownership
Oct 5, 2026
Merged

QuentinBisson merged 2 commits into
giantswarmfrom
fork/image-layer-ownership

Conversation

@QuentinBisson

Copy link
Copy Markdown

Problem

atelet unpacks image layers with every capability dropped, so every image-layer file is root's whatever the tar says (agent-substrate#2036). With #103 an actor runs as its image's USER, and such a user cannot write what its image gave it: kagent's Go ADK golden boot fails with open /config/config.json: permission denied on 1.4.0-rc.2 (giantswarm/kagent-upstream#125).

Change

atelet records the tar's non-root owners (with the setuid/setgid bits a chown clears) in the layer metadata; ateom's FinalizeLayer applies them to the pooled layer tree once per layer node-wide under its own owners-applied marker, so the merged rootfs presents them with no copy-up. A layer pooled before this is backfilled from its tar headers when a pull reuses it. Written for upstream against agent-substrate#2036, which agent-substrate#1918 needs before it merges.

  • Tests pass (imagecache as root too: owners applied, kept across a backfill, presented by the overlay)
  • Appropriate changes to documentation are included in the PR

Towards giantswarm/giantswarm#38054

atelet unpacks layers with every capability dropped, so every file it
writes belongs to root whatever the layer tar says. An actor that runs as
its image's USER could not write what its image gave it: an image that
creates a directory for its user saw it owned by root.

atelet now records the tar's non-root owners in the layer metadata, with
the setuid and setgid bits a chown clears, and ateom's FinalizeLayer applies
them to the pooled layer tree once per layer node-wide, under a marker of
its own. The merged rootfs presents them without copying anything up. A
layer pooled before owners were recorded is backfilled from its tar
headers the next time a pull reuses it.

Signed-off-by: QuentinBisson <quentin@giantswarm.io>
@QuentinBisson
QuentinBisson marked this pull request as ready for review October 5, 2026 07:24
@QuentinBisson
QuentinBisson requested a review from a team as a code owner October 5, 2026 07:24
@QuentinBisson
QuentinBisson merged commit 81abb52 into giantswarm Oct 5, 2026
6 of 13 checks passed
@QuentinBisson
QuentinBisson deleted the fork/image-layer-ownership branch October 5, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant