Skip to content

[1.1] libcontainer: skip chown of /dev/null caused by fd redirection#3731

Merged
AkihiroSuda merged 2 commits intoopencontainers:release-1.1from
kolyshkin:1.1-fix-dev-null
Feb 9, 2023
Merged

[1.1] libcontainer: skip chown of /dev/null caused by fd redirection#3731
AkihiroSuda merged 2 commits intoopencontainers:release-1.1from
kolyshkin:1.1-fix-dev-null

Conversation

@kolyshkin
Copy link
Contributor

This is a backport of #3707 to release-1.1 branch, fixing #3674.

Clean cherry-pick, no issues.

Dzejrou and others added 2 commits February 8, 2023 19:49
In 18c4760 (libct: fixStdioPermissions: skip chown if not needed)
the check whether the STDIO file descriptors point to /dev/null was
removed which can cause /dev/null to change ownership e.g. when using
docker exec on a running container:

$ ls -l /dev/null
crw-rw-rw- 1 root root 1, 3 Aug 1 14:12 /dev/null
$ docker exec -u test 0ad6d3064e9d ls
$ ls -l /dev/null
crw-rw-rw- 1 test root 1, 3 Aug 1 14:12 /dev/null

Signed-off-by: Jaroslav Jindrak <dzejrou@gmail.com>
(cherry picked from commit 7e5e017)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 1bb6209)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin
Copy link
Contributor Author

@cyphar @AkihiroSuda @thaJeztah PTAL

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah
Copy link
Member

@kolyshkin can this be moved out of draft?

@kolyshkin kolyshkin marked this pull request as ready for review February 9, 2023 09:14
@AkihiroSuda AkihiroSuda merged commit 3775df9 into opencontainers:release-1.1 Feb 9, 2023
@kolyshkin
Copy link
Contributor Author

This is a regression in 1.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/1.1-pr A backport PR to release-1.1 regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants