Skip to content

[1.4] Close fds on error#5168

Merged
kolyshkin merged 4 commits intoopencontainers:release-1.4from
cyphar:1.4-5009-close-fd-on-error
Mar 12, 2026
Merged

[1.4] Close fds on error#5168
kolyshkin merged 4 commits intoopencontainers:release-1.4from
cyphar:1.4-5009-close-fd-on-error

Conversation

@cyphar
Copy link
Copy Markdown
Member

@cyphar cyphar commented Mar 12, 2026

Backport of #5009.


This addresses cases reported by @arinochk in #5008.

See individual commits for details.

This function calls Init what normally never returns, so the defer only
works if there is an error and we can safely use it to close those fds
we opened. This was done for most but not all fds.

Reported in issue 5008.

Reported-by: Arina Cherednik <arinacherednik034@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 88f8971)
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Reported in issue 5008.

Reported-by: Arina Cherednik <arinacherednik034@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit c24965b)
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Reported in issue 5008.

Reported-by: Arina Cherednik <arinacherednik034@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 8a9b4dc)
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Reported in issue 5008.

Reported-by: Arina Cherednik <arinacherednik034@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 93792e6)
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
@cyphar cyphar added this to the 1.4.1 milestone Mar 12, 2026
@cyphar cyphar added the backport/1.4-pr A backport PR to release-1.4 label Mar 12, 2026
Copy link
Copy Markdown
Member

@rata rata left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Copy Markdown
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

LGTM

@kolyshkin kolyshkin merged commit 485f8f6 into opencontainers:release-1.4 Mar 12, 2026
41 checks passed
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