Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

--bind-try fails when the source is a bind mounted deleted file

Aperta
#811 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
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c, linux

Direzione di ricerca

Start by reproducing the two shell examples with bwrap --bind-try and compare the successful first mount with the failed mount after deleting the source. Read the trimmed strace around openat2, file descriptors 5 and 4, and mount; done means the deleted bind-mounted file follows the expected ok1, ok2 behavior or the failure policy is clearly established.

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

Descrizione

touch a b
mount --bind a b
bwrap --bind-try b /x --ro-bind / / echo ok1
rm a
bwrap --bind-try b /x --ro-bind / / echo ok2

alternate example, without root:

touch a b; bwrap --bind / / --ro-bind $PWD/a $PWD/b sh -c 'bwrap --bind-try b /x --ro-bind / / echo ok1; rm a && bwrap --bind-try b /x --ro-bind / / echo ok2'

expected behavior: ok1, ok2
actual behavior: ok1, bwrap: Can't bind mount /tmp/x/b on /x: Unable to mount source on destination: No such file or directory

trimmed example strace output:

[pid 30523] openat(AT_FDCWD</>, "/oldroot", O_RDONLY|O_NOCTTY|O_CLOEXEC|O_PATH) = 4</oldroot>
[pid 30523] openat2(4</oldroot>, "/tmp/x/b", {flags=O_RDONLY|O_PATH, resolve=RESOLVE_NO_MAGICLINKS|RESOLVE_IN_ROOT}, 24) = 5</oldroot/tmp/x/b>(deleted)
[pid 30523] close(4</oldroot>)          = 0
[pid 30523] fstat(5</oldroot/tmp/x/b>(deleted), {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
[pid 30523] openat(AT_FDCWD</>, "/newroot", O_RDONLY|O_NOCTTY|O_CLOEXEC|O_PATH) = 4</newroot>
[pid 30523] openat2(4</newroot>, "/", {flags=O_RDONLY|O_DIRECTORY, resolve=RESOLVE_NO_MAGICLINKS|RESOLVE_IN_ROOT}, 24) = 6</newroot>
[pid 30523] close(4</newroot>)          = 0
[pid 30523] openat(6</newroot>, "x", O_WRONLY|O_CREAT|O_EXCL|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC, 0444) = 4</newroot/x>
[pid 30523] close(4</newroot/x>)        = 0
[pid 30523] openat(6</newroot>, "x", O_RDONLY|O_NOFOLLOW|O_CLOEXEC|O_PATH) = 4</newroot/x>
[pid 30523] fstat(4</newroot/x>, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
[pid 30523] readlink("/proc/self/fd/4", "/newroot/x", 99) = 10
[pid 30523] mount("/proc/self/fd/5", "/proc/self/fd/4", NULL, MS_BIND|MS_REC|MS_SILENT, NULL) = -1 ENOENT (No such file or directory)

basically, the file exists in the sense that it can be opened and I/O performed, but cannot be bind-mounted from. unfortunately, it doesn't seem to be possible to work around with new mount API. I'm not sure whether it makes more sense to argue the case to kernel maintainers, or silently ignore this error in bubblewrap.

Lingua principale
C
Stelle
8.9k
Fork
391
Merge medio
17h 45m
PR unite (30g)
10

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

  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/bubblewrap

Tutte le issue di containers/bubblewrap

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.