Skip to content

Commit edebe7b

Browse files
jeckersbcgwalters
authored andcommitted
install: Label composefs objects as /usr for SELinux
The composefs object store currently has no matching SELinux policy for its storage path, so its contents end up labeled as default_t which causes AVC denials at runtime. Explicitly label the composefs directory tree as /usr (giving objects usr_t) after the composefs install completes. Future work should increase the granularity of SELinux behavior here, ideally adding composefs-specific types and policy instead of re-using usr_t. Closes: #1826 Assisted-by: OpenCode (claude-opus-4-6) Signed-off-by: John Eckersberg <jeckersb@redhat.com>
1 parent 68e2010 commit edebe7b

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

crates/lib/src/install.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1967,6 +1967,19 @@ async fn install_to_filesystem_impl(
19671967
state.composefs_options.allow_missing_verity,
19681968
)
19691969
.await?;
1970+
1971+
// Label composefs objects as /usr so they get usr_t rather than
1972+
// default_t (which has no policy match).
1973+
if let Some(policy) = state.load_policy()? {
1974+
tracing::info!("Labeling composefs objects as /usr");
1975+
crate::lsm::relabel_recurse(
1976+
&rootfs.physical_root,
1977+
"composefs",
1978+
Some("/usr".into()),
1979+
&policy,
1980+
)
1981+
.context("SELinux labeling of composefs objects")?;
1982+
}
19701983
} else {
19711984
ostree_install(state, rootfs, cleanup).await?;
19721985
}

0 commit comments

Comments
 (0)