|
Ran
|
Jobs
1
|
Files
248
|
Run time
1min
|
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
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 40 |
0.0 |
0.0% | internal/ldconfig/ldconfig_linux.go |
| 18 |
31.5 |
-0.71% | internal/ldconfig/ldconfig.go |
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 4 |
31.5 |
-0.71% | internal/ldconfig/ldconfig.go |
| 1 |
0.0 |
0.0% | internal/ldconfig/ldconfig_linux.go |
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 34539754510.1 | 248 |
44.06 |
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|