Skip to content

Danger of leaking file descriptors when spawning processes #12148

Closed
@alexcrichton

Description

@alexcrichton

We're not opening anything with CLOEXEC, so we're in theory leaking file descriptors across forks (they stay alive as long as the child stays alive).

We currently use getdtablesize to close all these descriptors, but as #12103 (comment) says, this isn't enough if a thread manually lowers RLIMIT_NOFILE.

We should consider opening file descriptors wherever possible with CLOEXEC, but this also sounds like it's a tricky situation (not always supported to specify the flag at open-time).

Metadata

Metadata

Assignees

Labels

A-securityArea: Security (example: address space layout randomization).I-needs-decisionIssue: In need of a decision.P-mediumMedium priority

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions