mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Support setting seccomp to errno
This will generate -EPERM on seccomp violations as opposed to causing the VMM to exit with SIGSYS. Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
@@ -454,7 +454,7 @@ fn get_cli_options_sorted(
|
||||
Arg::new("seccomp")
|
||||
.long("seccomp")
|
||||
.num_args(1)
|
||||
.value_parser(["true", "false", "log"])
|
||||
.value_parser(["true", "false", "log", "errno"])
|
||||
.default_value("true"),
|
||||
Arg::new("serial")
|
||||
.long("serial")
|
||||
@@ -588,6 +588,7 @@ fn start_vmm(
|
||||
"true" => SeccompAction::Trap,
|
||||
"false" => SeccompAction::Allow,
|
||||
"log" => SeccompAction::Log,
|
||||
"errno" => SeccompAction::Errno(libc::EPERM as u32),
|
||||
val => {
|
||||
// The user providing an invalid value will be rejected
|
||||
panic!("Invalid parameter {val} for \"--seccomp\" flag");
|
||||
|
||||
Reference in New Issue
Block a user