Skip to content

plugins/winbind: Check fdopen() before starting the helper - #666

Open
grey3228 wants to merge 1 commit into
ppp-project:masterfrom
grey3228:fix/winbind-fdopen
Open

grey3228 wants to merge 1 commit into
ppp-project:masterfrom
grey3228:fix/winbind-fdopen

Conversation

@grey3228

Copy link
Copy Markdown
Contributor

fdopen() can fail even when pipe() succeeded. Both streams are used without checking for NULL, so a stream allocation failure can crash pppd during authentication.

Open the streams before forking ntlm_auth and fail authentication if either fdopen() fails. Close any streams and pipe descriptors owned by the plugin on setup failure, including a failed pipe() or fork().

Found by Linux Verification Center (linuxtesting.org) with SVACE.

fdopen() can fail even when pipe() succeeded. Both streams are used
without checking for NULL, so a stream allocation failure can crash
pppd during authentication.

Open the streams before forking ntlm_auth and fail authentication if
either fdopen() fails. Close any streams and pipe descriptors owned by
the plugin on setup failure, including a failed pipe() or fork().

Found by Linux Verification Center (linuxtesting.org) with SVACE.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant