|
Repo Added
|
Build
3240
Last
|
Files
250
|
Badge
README BADGES
|
github
update-ldcache hook: exec ldconfig from a sealed memfd UpdateLDCache used to mount a fresh /proc inside the container root, just so it could bind-mount the host ldconfig binary in through a TOCTOU-safe /proc/self/fd/<n> target and then exec it by that same path once pivoted. This breaks under gVisor. Its createContainer hook doesn't have permission to mount a new /proc inside the container, so mountProc fails with EPERM. This constitutes a real regression, because this hook worked fine before the changes described above were introduced. To address this, UpdateLDCache now clones the host ldconfig binary into a sealed, anonymous memfd (via libcontainer/exeseal.CloneBinary) before touching any namespace or pivoting, then execs it by descriptor with execveat(fd, "", ..., AT_EMPTY_PATH). A memfd has no path and no mount-namespace membership, so it comes through pivot_root untouched. We don't need to bind-mount anything into the container, and we don't need to mount /proc anywhere. This is also more isolated than before. Since ldconfig has no use for /proc or /sys, prepareRoot now masks both with an empty tmpfs before pivoting, if they're present in the container root, instead of leaving a real working procfs mounted there and trusting ldconfig never reads it. We verified all of this against real GPU hardware through gVisor's runsc runtime, as well as standard runc. `docker run --runtime=runsc --device nvidia.com/gpu=0` against a non-Debian image resolves the driver libraries and runs nvidia-smi correctly, confirming the hook and the /proc/sys masking both work under gVisor's restricted- namespace gofer process. Signed-off-by: Kevin Klues <kklues@nvidia.com> (cherry picked from commit 111337006)
0 of 58 new or added lines in 2 files covered. (0.0%)
5 existing lines in 2 files now uncovered.5960 of 13528 relevant lines covered (44.06%)
0.44 hits per line
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|
![]() |
Badge your Repo: nvidia-container-toolkitWe detected this repo isn’t badged! Grab the embed code to the right, add it to your repo to show off your code coverage, and when the badge is live hit the refresh button to remove this message.Could not find badge in README. |
|
Embed ▾
README BADGES
|