Commit a58f134
linux: move pivot_root before container mounts
Use the new mount API (fsopen/fsconfig/fsmount) to create detached
mounts for each non-bind filesystem type before pivot_root. After
the pivot, place them via move_mount so the kernel mnt_already_visible
check is satisfied. set_mounts then mounts fresh instances on top
with the correct OCI flags.
This fixes mounting proc/sysfs/cgroup in containers that use a user
namespace, where the kernel denies these mounts unless a mount of
the same type is already visible.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>1 parent d12f8b7 commit a58f134
5 files changed
Lines changed: 482 additions & 149 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1339 | 1339 | | |
1340 | 1340 | | |
1341 | 1341 | | |
1342 | | - | |
1343 | | - | |
1344 | | - | |
1345 | | - | |
1346 | | - | |
1347 | 1342 | | |
1348 | 1343 | | |
1349 | 1344 | | |
| |||
1357 | 1352 | | |
1358 | 1353 | | |
1359 | 1354 | | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
1360 | 1364 | | |
1361 | 1365 | | |
1362 | 1366 | | |
| |||
1376 | 1380 | | |
1377 | 1381 | | |
1378 | 1382 | | |
1379 | | - | |
1380 | | - | |
1381 | | - | |
1382 | | - | |
1383 | | - | |
1384 | | - | |
1385 | | - | |
1386 | 1383 | | |
1387 | 1384 | | |
1388 | 1385 | | |
| |||
0 commit comments