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

khorben/coverity/1355235 TOCTOU #286

Merged
merged 4 commits into from Aug 29, 2018

Conversation

khorben
Copy link
Contributor

@khorben khorben commented Aug 27, 2018

These changes leverage fstat() to avoid TOCTOU conditions. This also requires fileno() when using fopen(). Judging from the existing code, fileno() may not be available on every platform (like Windows). In this case the fallback code is equivalent to the previous one with the flaw.

Reported in Coverity as issue 1355235.

This is the first part of three for Coverity issue 1355235.
This also needs fileno() after fopen().

This is the second part of three for Coverity issue 1355235.
This also needs fileno() after fopen(). This time it addresses the code
for the client.

This is the third part of three for Coverity issue 1355235.
This should help fwknop remain as portable as before.
The fallback code still suffers from the TOCTOU condition though.
@mrash mrash merged commit 7ac347f into mrash:master Aug 29, 2018
@mrash
Copy link
Owner

mrash commented Aug 29, 2018

Excellent, thanks.

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.

None yet

2 participants