Skip to content

Commit 1ff0b48

Browse files
committed
Require exact ACME mount boundary failure
1 parent 7270a43 commit 1ff0b48

3 files changed

Lines changed: 20 additions & 9 deletions

File tree

crates/fluxheim-acme/src/acme_directory.rs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -321,14 +321,20 @@ mod tests {
321321
let _mount = BindMount(mount_point.clone());
322322

323323
let boundary_directory = open_directory_no_symlinks(&boundary).unwrap();
324-
assert!(
325-
reconcile_private_directory_subtree(
326-
&boundary,
327-
&boundary_directory,
328-
&mount_point.join("child"),
329-
(65_534, 65_534),
330-
)
331-
.is_err()
324+
let error = reconcile_private_directory_subtree(
325+
&boundary,
326+
&boundary_directory,
327+
&mount_point.join("child"),
328+
(
329+
rustix::process::geteuid().as_raw(),
330+
rustix::process::getegid().as_raw(),
331+
),
332+
)
333+
.unwrap_err();
334+
assert_eq!(
335+
error.raw_os_error(),
336+
Some(rustix::io::Errno::XDEV.raw_os_error()),
337+
"bind-mount traversal must be rejected by RESOLVE_NO_XDEV"
332338
);
333339

334340
let after = std::fs::symlink_metadata(&outside).unwrap();

release-notes/RELEASE_NOTES_1.7.9.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ products.
5555
dedicated smoke using root-mapped user and private mount namespaces, without
5656
a privileged container. Hosts that disable user namespaces use a
5757
digest-pinned, network-isolated, read-only container with every capability
58-
dropped except the mount operation's required `SYS_ADMIN` capability.
58+
dropped except the mount operation's required `SYS_ADMIN` capability. The
59+
regression requires the precise `EXDEV` result from Linux `RESOLVE_NO_XDEV`
60+
using the namespace's mapped identity, so a later ownership error cannot
61+
produce a false pass.
5962
- Managed ACME account generation now creates P-256 material in zeroizing
6063
RustCrypto secret/document types before importing it into Ring and retaining
6164
the durable copy in `sanitization::SecretVec`, removing the transient

scripts/validate-acme-mount-boundary-plan.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ require_text() {
1919
}
2020

2121
require_text "$test_source" '#[ignore = "requires an isolated privileged mount namespace"]'
22+
require_text "$test_source" 'Some(rustix::io::Errno::XDEV.raw_os_error())'
23+
require_text "$test_source" 'bind-mount traversal must be rejected by RESOLVE_NO_XDEV'
2224
require_text "$smoke" 'unshare --user --map-root-user --mount --propagation private --fork'
2325
require_text "$smoke" '--cap-drop ALL'
2426
require_text "$smoke" '--cap-add SYS_ADMIN'

0 commit comments

Comments
 (0)