-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libct/cg/sd: set the DeviceAllow property before DevicePolicy #4612
Conversation
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 |
As this is a small change, and fixes a real issue, I think we can backport it to release-1.2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]> Co-authored-by: Jian Wen <[email protected]> Co-authored-by: Aleksa Sarai <[email protected]> Signed-off-by: Kir Kolyshkin <[email protected]>
1a34d17
to
d84388a
Compare
@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 |
@cyphar @AkihiroSuda PTAL (I want 1.2.5 to have this) |
(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 [email protected]
Co-authored-by: Jian Wen [email protected]
Co-authored-by: Aleksa Sarai [email protected]
1.2 backport: #4615