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

dnsdist: Protect GnuTLS tickets key rotation with a read-write lock #7256

Merged

Conversation

@rgacogne
Copy link
Member

@rgacogne rgacogne commented Dec 4, 2018

Short description

Otherwise a thread can replace the shared pointer hold by the GnuTLSIOCtx while another thread is accessing it. The usage count is not incremented since no copy is made, so the content might get deleted while a thread is still accessing it, leading to use-after-free and possibly a crash.

Also fixes the type of ticketsKeysRotationDelay and numberOfTicketsKeys, apparently broken since the localbind_t type accepts an integer value.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)
rgacogne added 2 commits Dec 4, 2018
Otherwise a thread can replace the shared pointer hold by the
GnuTLSIOCtx while another thread is accessing it. The usage count
is not incremented since no copy is made, so the content might get
deleted while a thread is still accessing it, leading to
use-after-free and possibly a crash.
We were trying to retrieve two parameters, ticketsKeysRotationDelay
and numberOfTicketsKeys, as strings then convert them to integers,
but the Lua wrapper already exposes them as numerical values.
@rgacogne rgacogne added this to the dnsdist-1.3.x milestone Dec 4, 2018
@rgacogne rgacogne requested a review from chbruyand Dec 4, 2018
@rgacogne rgacogne merged commit 595f72e into PowerDNS:master Dec 4, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@rgacogne rgacogne deleted the rgacogne:dnsdist-lock-tickets-key-rotation branch Dec 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants