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

Starting mdnsd -d with more than 30 interfaces causes a segfault #31

Open
opsec opened this issue Aug 4, 2018 · 3 comments
Open

Starting mdnsd -d with more than 30 interfaces causes a segfault #31

opsec opened this issue Aug 4, 2018 · 3 comments

Comments

@opsec
Copy link

opsec commented Aug 4, 2018

mdnsd -d cat /tmp/list
with more than 30 interfaces causes mdnsd to segfault.

@opsec
Copy link
Author

opsec commented Aug 4, 2018

(ups: On freebsd 11.1, amd64)

@jbeich
Copy link
Contributor

jbeich commented Aug 16, 2018

Can you try the following? It should crash but show where (use gdb/lldb). If ASan is happy with symbols it may even point at a bug.

$ make all install DEBUG_FLAGS=-g NO_CPU_CFLAGS= -C /usr/src/lib/libc
$ make all install DEBUG_FLAGS=-g NO_CPU_CFLAGS= -C /usr/src/lib/libthr
$ CFLAGS=-fsanitize=address make clean all deinstall install WITH_DEBUG= NO_CPU_CFLAGS= -C /usr/ports/devel/libevent
$ CFLAGS=-fsanitize=address make clean all deinstall install WITH_DEBUG= NO_CPU_CFLAGS= -C /usr/ports/devel/libopenbsd
$ CFLAGS=-fsanitize=address make clean all deinstall install WITH_DEBUG= NO_CPU_CFLAGS= -C /usr/ports/dns/openmdns
$ mdnsd -d `cat /tmp/list`

@twinshadow
Copy link

After looking at the code, this is probably triggered by PGE_RR_MAX being set to 32 and the limit never being checked when adding reverse records via pge_initprimary, setting up the code to write to unallocated memory. The first entry is set to "0.0.0.0" leaving only 30 entries left.

@twinshadow twinshadow mentioned this issue Dec 16, 2019
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

3 participants