diff --git a/vmm/src/config.rs b/vmm/src/config.rs index 49d906d31..03e5ba1a2 100644 --- a/vmm/src/config.rs +++ b/vmm/src/config.rs @@ -1154,6 +1154,11 @@ impl Drop for NetConfig { fn drop(&mut self) { if let Some(mut fds) = self.fds.take() { for fd in fds.drain(..) { + // Skip reserved FDs + if fd <= 2 { + continue; + } + // SAFETY: Safe as the fd was given to the config by the API unsafe { libc::close(fd) }; }