cargo / socket2

socket2

cargo

Utilities for handling networking sockets with a maximal amount of configuration possible intended.

Audits

PE Patrick Elsen 2026-06-02

socket2@0.6.4

socket2 0.6.4 is the rust-lang FFI wrapper over the platform socket API: Socket, SockAddr, SockRef, TcpKeepalive, plus MsgHdr/MaybeUninitSlice. Source matches upstream byte-for-byte. ~240 unsafe sites, all behind a single syscall! macro per back-end (libc on Unix/WASI, windows-sys on Windows); fd/SOCKET lifetimes delegated to libstd's OwnedFd/OwnedSocket. No filesystem, env, exec, crypto, or concurrency primitives implemented. No findings.

filesystem-safehas-binarieshas-build-exechas-fuzz-testshas-install-exechas-integration-testshas-property-testshas-unit-testsimpl-algorithmimpl-concurrencyimpl-cryptoimpl-datastructureimpl-interpreterimpl-jitimpl-parserimpl-protocolis-benignnetwork-safeunsafe-documentedunsafe-minimalunsafe-safeunsafe-testeduses-concurrencyuses-cryptouses-environmentuses-execuses-filesystemuses-interpreteruses-jituses-networkuses-unsafe
PE Patrick Elsen 2026-05-27

socket2@0.6.3

socket2 0.6.3 is a thin wrapper over OS socket APIs exposing the full setsockopt/getsockopt surface and low-level socket control that std::net omits. The 229 unsafe occurrences are structurally uniform: generic getsockopt/setsockopt wrappers with explicit type-safety contracts, SockAddr construction with family-checked casts, and SockRef lifetime management. All unsafe blocks carry SAFETY comments and the invariants hold on review. No findings were recorded.

has-binarieshas-build-exechas-fuzz-testshas-install-exechas-integration-testshas-property-testshas-unit-testsimpl-algorithmimpl-concurrencyimpl-cryptoimpl-datastructureimpl-interpreterimpl-jitimpl-parserimpl-protocolis-benignunsafe-documentedunsafe-minimalunsafe-safeunsafe-testeduses-concurrencyuses-cryptouses-environmentuses-execuses-filesystemuses-interpreteruses-jituses-networkuses-unsafe