mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Follow the "exe" symlink from the PID directory in /proc
It is necessary to do this at the start of the VMM execution rather than later as it must be done in the main thread in order to satisfy the checks required by PTRACE_MODE_READ_FSCREDS (see proc(5) and ptrace(2)) The alternative is to run as CAP_SYS_PTRACE but that has its disadvantages. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
@@ -39,6 +39,7 @@ use signal_hook::{iterator::Signals, SIGINT, SIGTERM, SIGWINCH};
|
||||
use std::ffi::CString;
|
||||
use std::fs::File;
|
||||
use std::io;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::{Arc, Mutex, RwLock};
|
||||
use std::{result, str, thread};
|
||||
use vm_allocator::{GsiApic, SystemAllocator};
|
||||
@@ -223,6 +224,7 @@ impl Vm {
|
||||
config: Arc<Mutex<VmConfig>>,
|
||||
exit_evt: EventFd,
|
||||
reset_evt: EventFd,
|
||||
vmm_path: PathBuf,
|
||||
) -> Result<Self> {
|
||||
let kvm = Kvm::new().map_err(Error::KvmNew)?;
|
||||
|
||||
@@ -343,6 +345,7 @@ impl Vm {
|
||||
memory_manager.clone(),
|
||||
&exit_evt,
|
||||
&reset_evt,
|
||||
vmm_path,
|
||||
)
|
||||
.map_err(Error::DeviceManager)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user