diff --git a/Cargo.lock b/Cargo.lock index 4c89f9ea7..0d3c47b00 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2531,9 +2531,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.1.1" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" +checksum = "1788edb87fdc09c7e26304471e2f5be8cdefb1b6930d6e3985fc02ff53bf86ee" dependencies = [ "libc", "log", @@ -4124,12 +4124,12 @@ checksum = "ef784004ca8777809dcdad6ac37629f0a97caee4c685fcea805278d81dd8b857" [[package]] name = "socket2" -version = "0.6.2" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0" +checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -4517,9 +4517,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.49.0" +version = "1.54.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" +checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3" dependencies = [ "bytes", "libc", @@ -4534,13 +4534,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.6.0" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" +checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 3.0.6", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 74ef3590f..a4dcde700 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -149,7 +149,7 @@ tar = "0.4.45" tempfile = "3.14.0" test-log = "0.2.18" thiserror = "2" -tokio = "1.48.0" +tokio = "1.53.3" tokio-util = "0.7.17" toml = "1.0.0" tracing = "0.1.43" diff --git a/crates/fspy_seccomp_unotify/src/supervisor/listener.rs b/crates/fspy_seccomp_unotify/src/supervisor/listener.rs index 0de6f89f5..487768d60 100644 --- a/crates/fspy_seccomp_unotify/src/supervisor/listener.rs +++ b/crates/fspy_seccomp_unotify/src/supervisor/listener.rs @@ -21,7 +21,11 @@ impl TryFrom for NotifyListener { type Error = io::Error; fn try_from(value: OwnedFd) -> Result { - Ok(Self { async_fd: AsyncFd::new(value)?, notif_buf: alloc_seccomp_notif() }) + // SAFETY: `value` is an owned fd. `AsyncFd` stores it until the + // `AsyncFd` is dropped, and nothing replaces or closes the descriptor + // while it is registered. + let async_fd = unsafe { AsyncFd::register(value)? }; + Ok(Self { async_fd, notif_buf: alloc_seccomp_notif() }) } } impl AsFd for NotifyListener {