Fix rootless launches with subordinate ID maps
Resolve and verify canonical caller subordinate ranges, launch preparation and runtime workers through mapped causal acquisition, and keep runsc in the existing user namespace. Repair descriptor-relative OCI cleanup and absent-mount recovery so failed launches can progress to the corrected path.
This commit is contained in:
parent
b9dbd78087
commit
73e3e9fdee
1 changed files with 1424 additions and 172 deletions
|
|
@ -1,11 +1,12 @@
|
|||
use super::{
|
||||
CanonicalDerivedNetworkPolicy, CommittedSandboxRuntime, CoordinatorChannel,
|
||||
GitRoutingCoordinator, MountIdentity, NamespaceIdentity, NetworkCoordinator,
|
||||
NetworkProbeRequest, NetworkReadinessEvidence, PidfsProcessIdentityV1, PipeFlags,
|
||||
PreparedArtifactId, ProcessOwnershipCommitAck, ReachabilityExpectation, RetainedProcess,
|
||||
RuntimeSupervisorLaunch, SandboxCoordinator, SandboxCoordinatorError, SandboxHandoffAuthority,
|
||||
StagedProcessOwnership, StateAnchorCoordinator, SupervisorEvent, child_broker,
|
||||
cleanup_supervisor, current_process_identity, io, pipe_with, private_seqpacket_pair,
|
||||
AcknowledgedChildAcquisition, CanonicalDerivedNetworkPolicy, CommittedSandboxRuntime,
|
||||
CoordinatorChannel, GitRoutingCoordinator, MountIdentity, NamespaceIdentity,
|
||||
NetworkCoordinator, NetworkProbeRequest, NetworkReadinessEvidence, PidfsProcessIdentityV1,
|
||||
PipeFlags, PreparedArtifactId, ProcessOwnershipCommitAck, ReachabilityExpectation,
|
||||
RetainedProcess, RuntimeSupervisorLaunch, SandboxCoordinator, SandboxCoordinatorError,
|
||||
SandboxHandoffAuthority, StagedProcessOwnership, StateAnchorCoordinator, SupervisorEvent,
|
||||
child_broker, cleanup_supervisor, current_process_identity, io, pipe_with,
|
||||
private_seqpacket_pair,
|
||||
};
|
||||
|
||||
pub struct AwaitingAttachedRunsc {
|
||||
|
|
@ -216,11 +217,20 @@ impl AwaitingAttachedRunsc {
|
|||
let (coordinator_control, supervisor_control) = private_seqpacket_pair()?;
|
||||
let (supervisor_lifetime, coordinator_lifetime) =
|
||||
pipe_with(PipeFlags::CLOEXEC).map_err(io::Error::from)?;
|
||||
let process = child_broker().acquire_with_stdio(
|
||||
parent,
|
||||
launch.ownership(),
|
||||
launch.target(),
|
||||
launch.child_standard_io(supervisor_control, supervisor_lifetime)?,
|
||||
let user_namespace_map =
|
||||
launch
|
||||
.user_namespace_map()
|
||||
.ok_or(SandboxCoordinatorError::InvalidState(
|
||||
"Runtime Supervisor user namespace map is absent",
|
||||
))?;
|
||||
let process = child_broker().acquire_with_stdio_in_user_namespace(
|
||||
AcknowledgedChildAcquisition {
|
||||
expected_parent: parent,
|
||||
ownership: launch.ownership(),
|
||||
target: launch.target(),
|
||||
standard_io: launch.child_standard_io(supervisor_control, supervisor_lifetime)?,
|
||||
},
|
||||
user_namespace_map,
|
||||
|staged| {
|
||||
coordinator
|
||||
.stage_runtime_supervisor(staged)
|
||||
|
|
|
|||
Loading…
Reference in a new issue