From eea45a2c78b1f4884efa3d2d941062de22745e56 Mon Sep 17 00:00:00 2001 From: Praveen K Paladugu Date: Fri, 1 Mar 2024 21:05:17 +0000 Subject: [PATCH] vmm: Enable Landlock in restore path Signed-off-by: Praveen K Paladugu --- vmm/src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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()