Skip to content

Commit 2896480

Browse files
committed
Remove seccomp advanced rule for clock_gettime
VDSO overrides this syscall in userspace, on most platforms, esentially bypassing seccomp. To keep Firecracker working on targets that don't provide this function in vdso, we need to allow it via seccomp. Signed-off-by: alindima <[email protected]>
1 parent 74a5731 commit 2896480

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/vmm/src/default_syscalls/filters.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,10 @@ pub fn default_filter() -> Result<SeccompFilter, Error> {
3333
),
3434
// Called for expanding the heap
3535
allow_syscall(libc::SYS_brk),
36-
// Used for metrics, via the helpers in utils/src/time.rs
37-
allow_syscall_if(
38-
libc::SYS_clock_gettime,
39-
or![and![Cond::new(
40-
0,
41-
ArgLen::DWORD,
42-
Eq,
43-
libc::CLOCK_PROCESS_CPUTIME_ID as u64
44-
)?],],
45-
),
36+
// Used for metrics and logging, via the helpers in utils/src/time.rs
37+
// It's not called on some platforms, because of vdso optimisations. In those cases,
38+
// musl falls back to the regular syscall.
39+
allow_syscall(libc::SYS_clock_gettime),
4640
allow_syscall(libc::SYS_close),
4741
// Needed for vsock
4842
allow_syscall(libc::SYS_connect),

0 commit comments

Comments
 (0)