Skip to content

[1.4] libct: close the mount source fd ASAP!#5201

Merged
cyphar merged 3 commits intoopencontainers:release-1.4from
lifubang:backport-5177-1.4
Mar 29, 2026
Merged

[1.4] libct: close the mount source fd ASAP!#5201
cyphar merged 3 commits intoopencontainers:release-1.4from
lifubang:backport-5177-1.4

Conversation

@lifubang
Copy link
Copy Markdown
Member

backport #5177

This commit factors out setupAndMountToRootfs without changing any
logic. Use "Hide whitespace changes" during review to focus on the
actual changes.

The refactor ensures the mount source file descriptor is closed via
defer in each loop iteration, reducing the total number of open FDs
in runc. This helps avoid hitting the file descriptor limit under
high concurrency or when handling many mounts.

Signed-off-by: lifubang <lifubang@acmcoder.com>
(cherry picked from commit 0d0fd95)
Signed-off-by: lifubang <lifubang@acmcoder.com>
This commit factors out setupAndMountToRootfs without changing any
logic. Use "Hide whitespace changes" during review to focus on the
actual changes.

The refactor ensures the mount source file descriptor is closed via
defer in each loop iteration, reducing the total number of open FDs
in runc. This helps avoid hitting the file descriptor limit under
high concurrency or when handling many mounts.

Signed-off-by: lifubang <lifubang@acmcoder.com>
(cherry picked from commit c77e71a)
Signed-off-by: lifubang <lifubang@acmcoder.com>
Signed-off-by: lifubang <lifubang@acmcoder.com>
(cherry picked from commit 7fdab1c)
Signed-off-by: lifubang <lifubang@acmcoder.com>
@lifubang lifubang added the backport/1.4-pr A backport PR to release-1.4 label Mar 29, 2026
@kolyshkin kolyshkin added this to the 1.4.2 milestone Mar 29, 2026
@cyphar cyphar enabled auto-merge March 29, 2026 08:56
@cyphar cyphar merged commit 226ff03 into opencontainers:release-1.4 Mar 29, 2026
42 checks passed
@kolyshkin kolyshkin mentioned this pull request Apr 2, 2026
Maks1mS pushed a commit to stplr-dev/stplr that referenced this pull request Apr 5, 2026
This PR contains the following updates:

| Package | Type | Update | Change | OpenSSF |
|---|---|---|---|---|
| [github.com/opencontainers/runc](https://github.com/opencontainers/runc) | require | patch | `v1.4.1` → `v1.4.2` | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/opencontainers/runc/badge)](https://securityscorecards.dev/viewer/?uri=github.com/opencontainers/runc) |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/23) for more information.

---

### Release Notes

<details>
<summary>opencontainers/runc (github.com/opencontainers/runc)</summary>

### [`v1.4.2`](https://github.com/opencontainers/runc/releases/tag/v1.4.2): runc v1.4.2 -- &quot;Я — Земля! Я своих провожаю питомцев&quot;

[Compare Source](opencontainers/runc@v1.4.1...v1.4.2)

This is the second patch release of the 1.4.z release series of runc.

##### Fixed

- A regression in runc v1.3.0 which can result in a stuck `runc exec` or
  `runc run` when the container process runs for a short time. ([#&#8203;5208](opencontainers/runc#5208),
  [#&#8203;5210](opencontainers/runc#5210), [#&#8203;5216](opencontainers/runc#5216))

- Mount sources that need to be open on the host are now closed earlier during
  container start, reducing the total amount of used file descriptors and
  helping to avoid hitting the open files limit when handling many such mounts.
  ([#&#8203;5177](opencontainers/runc#5177), [#&#8203;5201](opencontainers/runc#5201))

##### Static Linking Notices

The `runc` binary distributed with this release are *statically linked* with
the following [GNU LGPL-2.1][lgpl-2.1] licensed libraries, with `runc` acting
as a "work that uses the Library":

[lgpl-2.1]: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html

- [libseccomp](https://github.com/seccomp/libseccomp)

The versions of these libraries were not modified from their upstream versions,
but in order to comply with the LGPL-2.1 (§6(a)), we have attached the
complete source code for those libraries which (when combined with the attached
runc source code) may be used to exercise your rights under the LGPL-2.1.

However we strongly suggest that you make use of your distribution's packages
or download them from the authoritative upstream sources, especially since
these libraries are related to the security of your containers.

***

Thanks to the following contributors for making this release possible:

- Ayato Tokubi <atokubi@redhat.com>
- Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
- Aleksa Sarai <cyphar@cyphar.com>
- Kir Kolyshkin <kolyshkin@gmail.com>
- Li Fubang <lifubang@acmcoder.com>
- Rodrigo Campos Catelin <rodrigo@amutable.com>

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At 12:00 AM through 04:59 AM and 10:00 PM through 11:59 PM, Monday through Friday ( * 0-4,22-23 * * 1-5 ), Only on Sunday and Saturday ( * * * * 0,6 ) (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My44Ni4xIiwidXBkYXRlZEluVmVyIjoiNDMuODYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiS2luZC9EZXBlbmRlbmNpZXMiXX0=-->

Reviewed-on: https://altlinux.space/stapler/stplr/pulls/387
Co-authored-by: Renovate Bot <stapler-helper-bot@noreply.altlinux.space>
Co-committed-by: Renovate Bot <stapler-helper-bot@noreply.altlinux.space>
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