rshared bind mount loses the peer group of its source on kernel 6.12

Aperta
#2,392 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@kolyshkin ci sta già lavorando.

Dal 21/10/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

A bind mount with the rshared option is expected to stay in the peer group of its source, so that mounts made on the host below the source propagate into the container (#2122, fixed by 39c49297 for the pre-created bind mounts).

On CentOS Stream 10 (kernel 6.12.0-84.el10), the bind mount in the container is not shared at all. The mount-propagation-shared test in tests/test_mounts.py fails there with the current main (98558b51):

# bind mount at /mnt has no shared peer group
# mountinfo line: 308 531 252:2 /usr /mnt rw,relatime - xfs /dev/vda2 rw,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota

while on the host /usr is part of /, which is shared:

69 1 252:2 / / rw,relatime shared:1 - xfs /dev/vda2 rw,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota

The same test passes on Fedora 45 with kernel 7.3, where crun sets up the rootfs with OPEN_TREE_NAMESPACE instead of unshare(CLONE_NEWNS) + pivot_root, so the fix might cover only that path. I have not looked into the root cause yet.

To reproduce, as root, run a container with

{"destination": "/mnt", "type": "bind", "source": "/usr", "options": ["bind", "rshared"]}

and check that /mnt in /proc/self/mountinfo of the container has the same shared:N tag as the host mount that /usr is on.

Note that tests/test_mounts.py is skipped in the CI, as the libmount python module is not available on the Ubuntu runners, so this test has not been run there.

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.