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

Invalid IP address in unbound.conf causes Segmentation Fault on OpenBSD #878

Closed
sean102 opened this issue Apr 19, 2023 · 3 comments
Closed

Comments

@sean102
Copy link

sean102 commented Apr 19, 2023

The Following config file causes a Segmentation Fault.
server:
interface: ::1i

Other invalid IP addresses including IPv4 also cause Segmentation Fault. Just add a character after the address
This behavior seems perfectly reproducible.

unbound -d -c ub2.conf

[1681863179] unbound[73354:0] error: node ::1i:53 getaddrinfo: name or service is not known
Segmentation fault

On OpenBSD with unbound installed from the standard package..

unbound -V

Version 1.16.3

Configure line: --enable-allsymbols --with-ssl=/usr --with-libevent=/usr --with-libexpat=/usr --without-pythonmodule --with-chroot-dir=/var/unbound --with-pidfile= --with-rootkey-file=/var/unbound/db/root.key --with-conf-file=/var/unbound/etc/unbound.conf --with-username=_unbound --disable-shared --disable-explicit-port-randomisation --without-pthreads
Linked libs: pluggable-libevent 1.4.15-stable (it uses kqueue), LibreSSL 3.6.0
Linked modules: dns64 respip validator iterator

@wcawijngaards
Copy link
Member

The commit fixes the issue, by checking that the freeaddrinfo function has valid inputs. This does not crash elsewhere, so I could not test if this is the cause of the problem, on OpenBSD. The server is going to exit with an error, but the cleanup procedure seems to fail. Hopefully the fix can alleviate the problem.

@sean102
Copy link
Author

sean102 commented Apr 19, 2023

I would have to rebuild from source to test this.. That's a bit of effort. But I have confirmed that freeaddinfo(NULL) raises a Segmentation Fault on OpenBSD so NULL should definitely not be passed to this function. I think the fix will work.

@wcawijngaards
Copy link
Member

Thank you for the test. The fix likely works, so the issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants