Skip to content

Conversation

@cyphar
Copy link
Member

@cyphar cyphar commented Nov 12, 2025

Backport of #4949.


The main update is actually in github.com/opencontainers/cgroups, but we
need to also update runtime-spec to a newer pre-release version to get
the updates from there as well.

In short, the behaviour change is now that "0" is treated as a valid
value to set in "pids.max", "-1" means "max" and unset/nil means "do
nothing". As described in the opencontainers/cgroups PR, this change is
actually backwards compatible because our internal state.json stores
PidsLimit, and that entry is marked as "omitempty". So, an old runc
would omit PidsLimit=0 in state.json, and this will be parsed by a new
runc as being "nil" -- and both would treat this case as "do not set
anything".

Fixes #4014
Closes #4015
Closes #4023
Signed-off-by: Aleksa Sarai [email protected]

The main update is actually in github.com/opencontainers/cgroups, but we
need to also update runtime-spec to a newer pre-release version to get
the updates from there as well.

In short, the behaviour change is now that "0" is treated as a valid
value to set in "pids.max", "-1" means "max" and unset/nil means "do
nothing". As described in the opencontainers/cgroups PR, this change is
actually backwards compatible because our internal state.json stores
PidsLimit, and that entry is marked as "omitempty". So, an old runc
would omit PidsLimit=0 in state.json, and this will be parsed by a new
runc as being "nil" -- and both would treat this case as "do not set
anything".

Signed-off-by: Aleksa Sarai <[email protected]>
(cherry picked from commit 3b75374)
Signed-off-by: Aleksa Sarai <[email protected]>
Signed-off-by: Aleksa Sarai <[email protected]>
(cherry picked from commit 72421e0)
Signed-off-by: Aleksa Sarai <[email protected]>
This is much easier to read and removes the need for explicit per-type
helper functions.

Signed-off-by: Aleksa Sarai <[email protected]>
(cherry picked from commit 8ab2458)
Signed-off-by: Aleksa Sarai <[email protected]>
@cyphar cyphar added this to the 1.4.0 milestone Nov 12, 2025
@cyphar cyphar added the backport/1.4-pr A backport PR to release-1.4 label Nov 12, 2025
@cyphar cyphar changed the title 1.4 pids limit 0 [1.4] runtime-spec: update pids.limit handling to match new guidance Nov 12, 2025
@AkihiroSuda AkihiroSuda merged commit e3bfca3 into opencontainers:release-1.4 Nov 18, 2025
53 of 55 checks passed
@cyphar cyphar deleted the 1.4-pids-limit-0 branch November 18, 2025 06:37
@cyphar cyphar mentioned this pull request Nov 20, 2025
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/1.4-pr A backport PR to release-1.4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants