libct/cg/sd: set the DeviceAllow property before DevicePolicy#4612
Merged
AkihiroSuda merged 1 commit intoopencontainers:mainfrom Feb 7, 2025
Merged
libct/cg/sd: set the DeviceAllow property before DevicePolicy#4612AkihiroSuda merged 1 commit intoopencontainers:mainfrom
AkihiroSuda merged 1 commit intoopencontainers:mainfrom
Conversation
Contributor
Author
|
Before the fix, the test case fails like this: root@kir-tp1:/home/kir/git/runc# export RUNC_USE_SYSTEMD=yes
root@kir-tp1:/home/kir/git/runc# bats tests/integration/dev.bats
dev.bats
✓ runc run [redundant default /dev/tty]
✓ runc run [redundant default /dev/ptmx]
✓ runc run/update [device cgroup deny]
✓ runc run [device cgroup allow rw char device]
✓ runc run [device cgroup allow rm block device]
✓ runc exec vs systemctl daemon-reload
✗ runc run [systemd daemon-reload not needed]
(from function `check_systemd_value' in file tests/integration/helpers.bash, line 283,
in test file tests/integration/dev.bats, line 154)
`check_systemd_value "NeedDaemonReload" "no"' failed
runc spec (status=0):
runc run -d --console-socket /tmp/bats-run-rnDsXP/runc.NyH2cg/tty/sock test_need_reload (status=0):
systemd NeedDaemonReload: got yes, want no
--- teardown ---
7 tests, 1 failure |
Contributor
Author
|
As this is a small change, and fixes a real issue, I think we can backport it to release-1.2. |
rata
approved these changes
Feb 5, 2025
Member
rata
left a comment
There was a problem hiding this comment.
LGTM, thanks! And I agree to 1.2 backporting too :)
Every unit created by runc need daemon reload since systemd v230. This breaks support for NVIDIA GPUs, see opencontainers#3708 (comment) A workaround is to set DeviceAllow before DevicePolicy. Also: - add a test case (which fails before the fix) by @kolyshkin - better explain why we need empty DeviceAllow (by @cyphar) Fixes 4568. Reported-by: Jian Wen <wenjianhn@gmail.com> Co-authored-by: Jian Wen <wenjianhn@gmail.com> Co-authored-by: Aleksa Sarai <cyphar@cyphar.com> Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
1a34d17 to
d84388a
Compare
Contributor
Author
|
@giuseppe FYI I've checked (using the test case from this PR) that crun is not affected (probably because it doesn't add an empty |
Contributor
Author
|
@cyphar @AkihiroSuda PTAL (I want 1.2.5 to have this) |
AkihiroSuda
approved these changes
Feb 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(this is a carry of #4569 which adds a better comment and a test case)
Every unit created by runc need daemon reload since systemd v230. This breaks support for NVIDIA GPUs, see
#3708 (comment)
A workaround is to set DeviceAllow before DevicePolicy.
Also:
Fixes #4568.
Reported-by: Jian Wen wenjianhn@gmail.com
Co-authored-by: Jian Wen wenjianhn@gmail.com
Co-authored-by: Aleksa Sarai cyphar@cyphar.com
1.2 backport: #4615