Skip to content

Allocate exclusive per-container UID/GID blocks#78

Open
yaoxin-jing wants to merge 1 commit intonestybox:masterfrom
yaoxin-jing:exclusive-uid-alloc
Open

Allocate exclusive per-container UID/GID blocks#78
yaoxin-jing wants to merge 1 commit intonestybox:masterfrom
yaoxin-jing:exclusive-uid-alloc

Conversation

@yaoxin-jing
Copy link

Sysbox-CE currently maps all containers to the same host UID/GID range, meaning container root (UID 0) resolves to the same host user across all containers. This weakens isolation since a breakout from one container could access another container's files.

Change Alloc() to hand out sequential, non-overlapping 65536-uid/gid blocks from the subordinate range. Each container ID gets its own block; repeated calls with the same ID return the existing allocation. Free() recycles blocks for reuse.

Also increase subidRangeSize from 65536 to 268435456 so that configSubidRange() provisions enough subordinate IDs for up to 4096 concurrent containers (same capacity as Sysbox-EE).

Sysbox-CE currently maps all containers to the same host UID/GID
range, meaning container root (UID 0) resolves to the same host user
across all containers. This weakens isolation since a breakout from
one container could access another container's files.

Change Alloc() to hand out sequential, non-overlapping 65536-uid/gid
blocks from the subordinate range. Each container ID gets its own
block; repeated calls with the same ID return the existing allocation.
Free() recycles blocks for reuse.

Also increase subidRangeSize from 65536 to 268435456 so that
configSubidRange() provisions enough subordinate IDs for up to 4096
concurrent containers (same capacity as Sysbox-EE).

Signed-off-by: yaoxin jing <yaoxin19950517@gmail.com>
@yaoxin-jing
Copy link
Author

yaoxin-jing commented Feb 5, 2026

@ctalledo could you have a look on this patch. many thanks

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