Skip to content

RawFdContainer seems to be unsound #363

@eduardosm

Description

@eduardosm

RawFdContainer allows to wrap and close arbitrary file descriptors, which does not seem very safe. In fact, the standard library has this, where the from_raw_fd method is unsafe.

The solution would be to make RawFdContainer::new unsafe, remove impl<T: IntoRawFd> From<T> for RawFdContainer, and possibly implement std::os::unix::io::FromRawFd for RawFdContainer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Priority ImportantbugSomething isn't workingsafetySomething can lead to memory-unsafeness

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions