Skip to content

fork+exec fails to close other file descriptors #44

@weissi

Description

@weissi

https://github.com/iCharlesHu/swift-experimental-subprocess/blob/7204d94bc468c0669a326fe584bf240e1eecbb2b/Sources/_SubprocessCShims/process_shims.c#L322

UNIX programs typically need to close all other open fds that they don't want to inherit into the child process after fork() but before execve(). This code fails to do so, this is security-relevant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions