Commit 948a7d9
committed
rootfs: always pivot_root(2) and treat --no-pivot as a fallback
Despite the hardenings we've added to the MS_MOVE+chroot dance over the
years like commit 28a697c ("rootfs: umount all procfs and sysfs
with --no-pivot"), --no-pivot is fundamentally insecure and the primary
reason why people use it (to run containers from initramfs) can now be
done safely with pivot_root(2).
So we should always try to pivot_root(2) and give a warning to the user
that their configuration is insecure if we have to use the --no-pivot
fallback (users should not see this message in practice, because the
primary users that couldn't use pivot_root(2) now can and will
transparently use it if possible).
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>1 parent 16b45c8 commit 948a7d9
1 file changed
+12
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
206 | | - | |
207 | | - | |
| 205 | + | |
208 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
209 | 218 | | |
210 | 219 | | |
211 | 220 | | |
| |||
0 commit comments