From cbb588c3805368e2451a933669209897ad4f6108 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 12 Aug 2024 17:23:05 +0200 Subject: [PATCH] virtio-devices: allow vsock to call fcntl in debug This fixes the vsock::device::tests::test_virtio_device test with Rust 1.80.0 or later, where this check was introduced. Signed-off-by: Alyssa Ross --- virtio-devices/src/seccomp_filters.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/virtio-devices/src/seccomp_filters.rs b/virtio-devices/src/seccomp_filters.rs index d535c7dcc..c4896d5cf 100644 --- a/virtio-devices/src/seccomp_filters.rs +++ b/virtio-devices/src/seccomp_filters.rs @@ -209,6 +209,10 @@ fn virtio_vsock_thread_rules() -> Vec<(i64, Vec)> { (libc::SYS_ioctl, create_vsock_ioctl_seccomp_rule()), (libc::SYS_recvfrom, vec![]), (libc::SYS_socket, vec![]), + // If debug_assertions is enabled, closing a file first checks + // whether the FD is valid with fcntl. + #[cfg(debug_assertions)] + (libc::SYS_fcntl, vec![]), ] }