Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the handling of file descriptors when new connections fd are in the 0~MAX_PASS_FD range #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

loos-br
Copy link

@loos-br loos-br commented Jul 13, 2016

See:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211038
https://redmine.pfsense.org/issues/6315

This happens because the UDP service was using the 0 (zero) file descriptor for the (new) received connection (which was later closed before it could be used by the child).

This is easily reproducible by setting a single UDP service in xinted.

loos-br added 2 commits July 13, 2016 14:49
…s here, if they are open dup2() will close them before copy the new file descriptor.

This fixes part of the bug where a valid file descriptor in this range is closed before the child is runs (easily reproductible with a single UDP service).

Obtained from:	pfSense
…FD range as in this case it will also close the copied file descriptor (dup2() does nothing when src == dst).

This fixes the other part of the bug where a valid file descriptor in this range is closed before the child is runs (easily reproductible with a single UDP service).

Obtained from:	pfSense
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant