oxidecomputer / oxidecomputer/omicron
zones should be created with dtrace_user and dtrace_proc privileges
Open
@leftwo is already working on this.
Since Dec 28, 2023.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
Currently, our zones are created without the dtrace_user and dtrace_proc privileges. We probably want to create all zones with dtrace_user and dtrace_proc -- and we probably want to strongly consider granting dtrace_kernel to the switch zone. Untested diffs:
diff --git a/sled-agent/src/services.rs b/sled-agent/src/services.rs
index a9000a1c4..42bdc103f 100644
--- a/sled-agent/src/services.rs
+++ b/sled-agent/src/services.rs
@@ -1258,14 +1258,20 @@ impl ServiceManager {
}
// Check the services intended to run in the zone to determine whether any
- // additional privileges need to be enabled for the zone.
+ // additional privileges need to be enabled for the zone. (Note that we
+ // grant every zone the dtrace_user and dtrace_proc privileges.)
fn privs_needed(zone_args: &ZoneArgs<'_>) -> Vec<String> {
- let mut needed = Vec::new();
+ let mut needed = vec![
+ "default".to_string(),
+ "dtrace_user".to_string(),
+ "dtrace_proc".to_string(),
+ ];
+
for svc_details in zone_args.sled_local_services() {
match svc_details {
SwitchService::Tfport { .. } => {
- needed.push("default".to_string());
needed.push("sys_dl_config".to_string());
+ needed.push("dtrace_kernel".to_string());
}
_ => (),
}
@@ -1275,7 +1281,6 @@ impl ServiceManager {
match omicron_zone_type {
OmicronZoneType::BoundaryNtp { .. }
| OmicronZoneType::InternalNtp { .. } => {
- needed.push("default".to_string());
needed.push("sys_time".to_string());
needed.push("proc_priocntl".to_string());
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.