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)

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 merged commit 595f72e into PowerDNS:master Dec 4, 2018
@rgacogne rgacogne deleted the dnsdist-lock-tickets-key-rotation branch December 4, 2018 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants