1.31: rootless exec fails when the caller's NPROC hard limit is lower than the container's

Aperta
#2,495 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c, linux

Direzione di ricerca

Start by reading the change in crun PR 2299 and the related issue 2466, then trace how rootless exec and healthcheck setup apply RLIMIT_NPROC. Reproduce with the two Podman commands in the issue, using caller and container limits of 10000 and 10001. Done when both commands succeed under the lower caller limit without weakening the container's intended limit.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Starting with crun 1.31, rootless podman exec or podman healthcheck run might fail if the NPROC hard limit in the shell calling them is lower than the limit set in the running container.

This looks like it was introduced by https://github.com/containers/crun/pull/2299
This seems similar to https://github.com/containers/crun/issues/2466

Should the limit be set to the lower of the 2 hard limits available? Or is there a better way?

Reproducing the failure:

Podman exec
# Start a container with a NPROC limit at 10001
 ( ulimit -u 10001; podman run --rm -d --name test --runtime=crun docker.io/alpine sleep infinity )

# Run exec with a lower NPROC
( ulimit -u 10000; podman exec test true; )

This gives then:

Error: crun: setrlimit `RLIMIT_NPROC`: Operation not permitted: OCI permission denied

instead of succeeding.

Cleanup by running: podman kill test

Podman healthcheck run
# Start a container with a NPROC limit at 10001
( ulimit -u 10001; podman run -d --name test --runtime=crun --health-cmd=true --health-interval=disable docker.io/alpine sleep infinity )

# Run the healthcheck, this will fail
( ulimit -u 10000; podman healthcheck run test )

This gives then:

unhealthy

instead of healthy.

Cleanup by running: podman kill test

Lingua principale
C
Stelle
4.2k
Fork
476
Merge medio
1g 10h
PR unite (30g)
55

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di containers/crun

Tutte le issue di containers/crun

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.