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:
@@ -380,17 +380,9 @@ pub fn get_seccomp_filter(
|
||||
) -> Result<BpfProgram, Error> {
|
||||
match seccomp_action {
|
||||
SeccompAction::Allow => Ok(vec![]),
|
||||
SeccompAction::Log => SeccompFilter::new(
|
||||
get_seccomp_rules(thread_type).into_iter().collect(),
|
||||
SeccompAction::Log,
|
||||
SeccompAction::Allow,
|
||||
env::consts::ARCH.try_into().unwrap(),
|
||||
)
|
||||
.and_then(|filter| filter.try_into())
|
||||
.map_err(Error::Backend),
|
||||
_ => SeccompFilter::new(
|
||||
get_seccomp_rules(thread_type).into_iter().collect(),
|
||||
SeccompAction::Trap,
|
||||
seccomp_action.clone(),
|
||||
SeccompAction::Allow,
|
||||
env::consts::ARCH.try_into().unwrap(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user