mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices, vmm: Fix the '--seccomp false' option
We are relying on applying empty 'seccomp' filters to support the '--seccomp false' option, which will be treated as an error with the updated 'seccompiler' crate. This patch fixes this issue by explicitly checking whether the 'seccomp' filter is empty before applying the filter. Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
+14
-10
@@ -1880,11 +1880,13 @@ impl Vm {
|
||||
thread::Builder::new()
|
||||
.name("signal_handler".to_string())
|
||||
.spawn(move || {
|
||||
if let Err(e) = apply_filter(&signal_handler_seccomp_filter)
|
||||
.map_err(Error::ApplySeccompFilter)
|
||||
{
|
||||
error!("Error applying seccomp filter: {:?}", e);
|
||||
return;
|
||||
if !signal_handler_seccomp_filter.is_empty() {
|
||||
if let Err(e) = apply_filter(&signal_handler_seccomp_filter)
|
||||
.map_err(Error::ApplySeccompFilter)
|
||||
{
|
||||
error!("Error applying seccomp filter: {:?}", e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Vm::os_signal_handler(signals, console, on_tty, exit_evt);
|
||||
@@ -2442,11 +2444,13 @@ impl Snapshottable for Vm {
|
||||
thread::Builder::new()
|
||||
.name("signal_handler".to_string())
|
||||
.spawn(move || {
|
||||
if let Err(e) = apply_filter(&signal_handler_seccomp_filter)
|
||||
.map_err(Error::ApplySeccompFilter)
|
||||
{
|
||||
error!("Error applying seccomp filter: {:?}", e);
|
||||
return;
|
||||
if !signal_handler_seccomp_filter.is_empty() {
|
||||
if let Err(e) = apply_filter(&signal_handler_seccomp_filter)
|
||||
.map_err(Error::ApplySeccompFilter)
|
||||
{
|
||||
error!("Error applying seccomp filter: {:?}", e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Vm::os_signal_handler(signals, console, on_tty, exit_evt)
|
||||
|
||||
Reference in New Issue
Block a user