From 0728bece0c7a0b005b64605244448fd6a91b04b9 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 27 May 2020 15:35:28 +0100 Subject: [PATCH] vmm: seccomp: Ensure that umask() can be reprogrammed When doing self spawning the child will attempt to set the umask() again. Let it through the seccomp rules so long as it the safe mask again. Signed-off-by: Rob Bradford --- vmm/src/seccomp_filters.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vmm/src/seccomp_filters.rs b/vmm/src/seccomp_filters.rs index 5eb994642..52907bc9b 100644 --- a/vmm/src/seccomp_filters.rs +++ b/vmm/src/seccomp_filters.rs @@ -276,6 +276,10 @@ pub fn vmm_thread_filter() -> Result { allow_syscall(libc::SYS_statx), allow_syscall(libc::SYS_tgkill), allow_syscall(libc::SYS_tkill), + allow_syscall_if( + libc::SYS_umask, + or![and![Cond::new(0, ArgLen::DWORD, Eq, 0o077)?]], + ), #[cfg(target_arch = "x86_64")] allow_syscall(libc::SYS_unlink), allow_syscall(libc::SYS_wait4),