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 <hi@alyssa.is>
This commit is contained in:
Alyssa Ross 2024-08-12 17:23:05 +02:00 committed by Liu Wei
parent 1c7997c5c3
commit cbb588c380

View File

@ -209,6 +209,10 @@ fn virtio_vsock_thread_rules() -> Vec<(i64, Vec<SeccompRule>)> {
(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![]),
]
}