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
auth-zone section in config may lead to segfault #220
Comments
Addition: |
I was able to reproduce with config as simple as:
|
@gthess |
Which version of unbound are you running? |
unbound-1.10.0-1.fc33 steps to reproduce: |
I believe you are referring to the same issue that sibeream reported (env==NULL) as the only reproducible SEGV here is of the same nature. |
Yes, We're working on the same issue. |
It should be fixed now, if not (or something similar happens) feel free to reopen. |
* nlnet/master: - Fix for count of reply states in the mesh. Fix that it is --enable-rpath, for NLnetLabs#222. - Fix NLnetLabs#222: --with-rpath, fails to rpath python lib. - Document SNI support in unbound-anchor.8.in. - Update Changelog for PR NLnetLabs#221. - Enable SNI by default in unbound-anchor. Revert "- Remove SNI support from unbound-anchor; TLS is used only for" - Remove SNI support from unbound-anchor; TLS is used only for encryption and not validation. - Add SNI support on more TLS connections (fixes NLnetLabs#193). - Add SNI support to unbound-anchor. - Add doxygen documentation for DSCP. - Fix for posix shell syntax for trap in run_msg.sh test script. - Fix for posix shell syntax for trap in nsd-control-setup. - Fix help return code in unbound-control-setup script. - Fix NLnetLabs#220: auth-zone section in config may lead to segfault.
Hello,
I tried the following with an unbound build from the current master.
If I have auth-zone configured and I start and stop the service in a short period of time, segfault happens.
The reason is that
env
variable isNULL
on services/authzone.c:6394.if(env->outnet->want_to_quit) {
.It happens because of the
daemon_cleanup
function in daemon/daemon.c callsauth_zones_cleanup
function, which callsxfr_probe_disown
, which has the following codexfr->task_probe->env = NULL;
After that,
worker_delete
is called, which does a chain of calls ending up inmesh_state_cleanup
function (services/mesh.c:861), which iterates through callback list and calls callbacks themselves. One of those callbacks isauth_xfer_probe_lookup_callback
(services/authzone.c:6385) which doesn't expectenv
to beNULL
The possible solution would be to change 'if' statement on services/authzone.c:6394 to look something like
if(env && env->outnet->want_to_quit) {
.However I'm not sure if suggested solution satisfies application logic.
The text was updated successfully, but these errors were encountered: