Skip to content

incusd/instance/lxc: Reject overlapping fixed isolated ID maps - #4000

Closed
fivetime wants to merge 3 commits into
lxc:mainfrom
fivetime:upstream/idmap-overlap-20260915
Closed

fivetime wants to merge 3 commits into
lxc:mainfrom
fivetime:upstream/idmap-overlap-20260915

Conversation

@fivetime

@fivetime fivetime commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Selecting security.idmap.base currently bypasses checks against other isolated containers. Reject fixed ranges that overlap another isolated container on the same server, while allowing the owning instance to retain its range and snapshots to inherit it.

This changes existing behavior: two isolated containers can no longer intentionally share a fixed range through this path. The documentation explains how to select a different base or use automatic allocation when copying a container. This checks configured allocation ranges; it does not redefine raw.idmap or introduce cross-server coordination.

Rebased onto current upstream main, retaining the allocation locking introduced by #3999 and the exact-gap regression from #3998. The system test covers conflicting creation and update requests, retaining the owner's range, snapshots, and copying with a different fixed base.

The previous amd64 and arm64 dir system jobs both failed because the test used incus delete idmap1/fixed-idmap. Snapshot creation and the preceding overlap checks had succeeded. This now uses incus snapshot delete idmap1 fixed-idmap.

Validation: Linux go test -v ./... and make static-analysis pass. The full system matrix remains subject to the new upstream CI run; it is not claimed as locally passed.

The contributor's existing DCO sign-offs are preserved on all three commits.

@github-actions github-actions Bot added the Documentation Documentation needs updating label Sep 15, 2026
@fivetime
fivetime force-pushed the upstream/idmap-overlap-20260915 branch from 4d13202 to 01ee062 Compare September 15, 2026 02:59
Signed-off-by: Simon Zhou <jp.zdm2008@gmail.com>
Signed-off-by: Simon Zhou <jp.zdm2008@gmail.com>
Signed-off-by: Simon Zhou <jp.zdm2008@gmail.com>
@fivetime
fivetime force-pushed the upstream/idmap-overlap-20260915 branch from 01ee062 to 6ad4ad4 Compare September 18, 2026 16:17
@fivetime
fivetime marked this pull request as ready for review September 18, 2026 16:17
@fivetime
fivetime requested a review from stgraber as a code owner September 18, 2026 16:17
@fivetime
fivetime deleted the upstream/idmap-overlap-20260915 branch September 23, 2026 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Documentation needs updating

Development

Successfully merging this pull request may close these issues.

1 participant