Skip to content

[1.2] libcontainer: Prevent startup hang when CloseExecFrom errors#4647

Merged
cyphar merged 1 commit intoopencontainers:release-1.2from
kolyshkin:1.2-4599
Feb 27, 2025
Merged

[1.2] libcontainer: Prevent startup hang when CloseExecFrom errors#4647
cyphar merged 1 commit intoopencontainers:release-1.2from
kolyshkin:1.2-4599

Conversation

@kolyshkin
Copy link
Contributor

This is a backport of #4599 to release-1.2.


The previous logic caused runc to hang if CloseExecFrom returned an error, as the defer waiting on logsDone never finished as the parent process was never started (and it controls the closing of logsDone via it's logsPipe).

This moves the defer to after we have started the parent, with means all the logic related to managing the logsPipe should also be running.

(cherry picked from commit 7b26da9)

@kolyshkin kolyshkin added the backport/1.2-pr A backport PR to release-1.2 label Feb 26, 2025
@kolyshkin kolyshkin added this to the 1.2.6 milestone Feb 26, 2025
The previous logic caused runc to hang if CloseExecFrom returned an
error, as the defer waiting on logsDone never finished as the parent
process was never started (and it controls the closing of logsDone via
it's logsPipe).

This moves the defer to after we have started the parent, with means all
the logic related to managing the logsPipe should also be running.

Signed-off-by: Evan Phoenix <evan@phx.io>
(cherry picked from commit 7b26da9)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@cyphar cyphar merged commit 4dbf9ac into opencontainers:release-1.2 Feb 27, 2025
35 checks passed
@rata rata mentioned this pull request Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants