capability.LastCap fails when /proc/sys/kernel/cap_last_cap is unavailable
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 50/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- go, linux
- Ambito
- operating-systems, security
Direzione di ricerca
Start with the LastCap function in the capability package and the ListSupported path that calls it, both of which read /proc/sys/kernel/cap_last_cap directly. Check how the error propagates, then find a way to determine the last capability without that file, such as probing with prctl. Done means LastCap no longer fails when the file is absent, with a test that simulates the missing file.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
capability.LastCap() returns an error when /proc/sys/kernel/cap_last_cap is unavailable. This can cause callers to fail after entering a rootfs that does not contain a /proc mount.
I encountered this through runc 1.3.4. With an OCI configuration containing mounts: [] and five explicitly empty capability sets, runc create failed 5/5 times with:
open /proc/sys/kernel/cap_last_cap: no such file or directory
The workload was /bin/true, so it did not access /proc. Adding only a private /proc mount made runc succeed 5/5 times. crun and youki accepted the original configuration.
It appears that ListSupported() calls LastCap(), which directly opens /proc/sys/kernel/cap_last_cap and returns the error without a fallback.
I expected capability handling, especially for empty capability sets, not to require this file to exist inside the current rootfs.
Original runc report and full reproducer:
https://github.com/opencontainers/runc/issues/5551
- Lingua principale
- Go
- Stelle
- 102
- Fork
- 62
- Merge medio
- 6m
- PR unite (30g)
- 2
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di moby/sys
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
devices: ignore .incus-mounts in GetDevicesForse già presa @SashaMIT l’ha presa 8 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
[userns-remap] Bug: ToHost incorrectly maps non-root container UID to root when it collides with RootPairForse già presa @okhowang l’ha presa 75 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 74/100
-
user: parseLine silently ignores uid/gid conversion errors, malformed ids parse as 0Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
cloudflare/terraform-provider-cloudflare#7423 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
router-for-me/CLIProxyAPI#6746 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
ViewData can pair the in-flight proposal with the prepared flag of another proposalForse già presa @HagarMeir l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
hyperledger/SmartBFT#710 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100