Repository navigation
Commit 76cba32
authored
ocispec: make gVisor durable directory root mode 0777 (agent-substrate#3457)
Part of agent-substrate#3226.
The API guide says a `durableDir` is created `0777`, like an emptyDir.
On gVisor its root is `01777`. The volume is a tmpfs inside the sandbox,
and its mount hint sets no mode, so it gets the tmpfs default. With the
sticky bit, a user can't delete or rename another user's files in the
volume's root.
A durable dir created before this keeps `01777` when it is restored from
a VOLUMES or ROOTFS snapshot, since the snapshot records its mode.
Breaking Change:
A gVisor actor whose template has a `durableDir` can't restore a MEMORY
snapshot taken before this change. On a MEMORY restore, runsc checks
that the sandbox spec's mount hints match the checkpoint, except
`.source`. The new `dev.gvisor.spec.mount.<volume>.options` key doesn't
match, so `runsc restore` fails and the actor goes to `CRASHED`. This
includes MEMORY golden snapshots of these templates, and actors
suspended while their worker rolls during the upgrade. No API restores
such a snapshot without its memory.
On upgrade:
- Recreate affected templates so they take new golden snapshots.
- Delete and recreate affected actors that hold a MEMORY snapshot from
before the upgrade.
A rollback breaks the same way. MEMORY snapshots taken after the upgrade
fail to restore on the old worker. From v1.0.0, changes must keep
upgrades and rollbacks working, so this has to land before then.
AI use:
AI-assisted, I reviewed and tested it.
- [x] Tests pass
- [ ] Docs updated
Signed-off-by: Nayana Bidari <[email protected]>1 parent 1b8f2e0 commit 76cba32
2 files changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
231 | 234 | | |
232 | 235 | | |
233 | 236 | | |
| |||
0 commit comments