diff --git a/vmm/src/lib.rs b/vmm/src/lib.rs index 3358b7a1e..2ec59f621 100644 --- a/vmm/src/lib.rs +++ b/vmm/src/lib.rs @@ -1459,6 +1459,18 @@ impl RequestHandler for Vmm { )?; self.vm = Some(vm); + if self + .vm_config + .as_ref() + .unwrap() + .lock() + .unwrap() + .landlock_enable + { + apply_landlock(self.vm_config.as_ref().unwrap().clone()) + .map_err(VmError::ApplyLandlock)?; + } + // Now we can restore the rest of the VM. if let Some(ref mut vm) = self.vm { vm.restore()