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

rec: Delay the creation of RPZ threads until we have dropped privileges #6792

Merged
merged 1 commit into from Aug 3, 2018

Conversation

Projects
None yet
2 participants
@rgacogne
Member

rgacogne commented Jul 13, 2018

Short description

On Linux/glibc, calling set*id() from a thread results in the other threads being sent the SIGRT_1 signal so they are aware that they should switch credentials too, because POSIX requires that all threads use the same credentials but Linux actually handles it per thread. The reception of the signal interrupts the current syscall with EINTR, causing the loading of the RPZ zone to fail.

Fixes #6778.

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)
rec: Delay the creation of RPZ threads until we have dropped privileges
On Linux/glibc, calling `set*id()` from a thread results in the other
threads being sent the `SIGRT_1` signal so they are aware that they
should switch credentials too, because `POSIX` requires that all threads
use the same credentials but Linux actually handles it per thread.
The reception of the signal interrupts the current `syscall` with
`EINTR`, causing the loading of the `RPZ` zone to fail.

@rgacogne rgacogne added this to the rec-4.2.0 milestone Jul 13, 2018

@rgacogne rgacogne requested a review from chbruyand Aug 3, 2018

@chbruyand

Looks good !

@rgacogne rgacogne merged commit 5b78c50 into PowerDNS:master Aug 3, 2018

4 checks passed

LGTM analysis: C/C++ 2 new alerts and 2 fixed alerts
Details
LGTM analysis: JavaScript No alert changes
Details
LGTM analysis: Python No alert changes
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@rgacogne rgacogne deleted the rgacogne:rec-delay-lua-conf-threads branch Aug 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment