Skip to content

Commit 552cf7d

Browse files
georgepisaltuberciuliviu
authored andcommitted
seccomp: allow syscalls used in rust panic
Signed-off-by: George Pisaltu <[email protected]>
1 parent 8f44986 commit 552cf7d

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [Unreleased]
4+
5+
### Fixed
6+
7+
- Fixed seccomp blocking syscalls necessary for Rust panics.
8+
39
## [0.24.4]
410

511
### Fixed

src/vmm/src/default_syscalls/filters.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ pub fn default_filter() -> Result<SeccompFilter, Error> {
115115
allow_syscall(libc::SYS_read),
116116
// Used by the API thread and vsock
117117
allow_syscall(libc::SYS_recvfrom),
118+
allow_syscall_if(
119+
libc::SYS_rt_sigaction,
120+
or![and![Cond::new(0, ArgLen::DWORD, Eq, libc::SIGABRT as u64)?]],
121+
),
122+
allow_syscall(libc::SYS_rt_sigprocmask),
118123
// SYS_rt_sigreturn is needed in case a fault does occur, so that the signal handler
119124
// can return. Otherwise we get stuck in a fault loop.
120125
allow_syscall(libc::SYS_rt_sigreturn),
@@ -135,12 +140,15 @@ pub fn default_filter() -> Result<SeccompFilter, Error> {
135140
// Used to kick vcpus
136141
allow_syscall_if(
137142
libc::SYS_tkill,
138-
or![and![Cond::new(
139-
1,
140-
ArgLen::DWORD,
141-
Eq,
142-
(sigrtmin() + super::super::vstate::vcpu::VCPU_RTSIG_OFFSET) as u64
143-
)?]],
143+
or![
144+
and![Cond::new(
145+
1,
146+
ArgLen::DWORD,
147+
Eq,
148+
(sigrtmin() + super::super::vstate::vcpu::VCPU_RTSIG_OFFSET) as u64
149+
)?],
150+
and![Cond::new(1, ArgLen::DWORD, Eq, libc::SIGABRT as u64)?],
151+
],
144152
),
145153
// Used to kick vcpus, on gnu
146154
#[cfg(target_env = "gnu")]

tests/integration_tests/build/test_coverage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# this contains the frequency while on AMD it does not.
2424
# Checkout the cpuid crate. In the future other
2525
# differences may appear.
26-
COVERAGE_DICT = {"Intel": 85.1, "AMD": 84.37, "ARM": 83.16}
26+
COVERAGE_DICT = {"Intel": 85.15, "AMD": 84.37, "ARM": 83.07}
2727

2828
PROC_MODEL = proc.proc_type()
2929

0 commit comments

Comments
 (0)