Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Bugs with dedicated resolvers #126

Closed
infosec-it-init opened this issue Mar 17, 2022 · 1 comment
Closed

Bugs with dedicated resolvers #126

infosec-it-init opened this issue Mar 17, 2022 · 1 comment

Comments

@infosec-it-init
Copy link
Contributor

Hi @blechschmidt
Thanks for including our PR #116 and supporting dedicated resolvers per request.
I was busy with other stuff, so I noticed the merge only lately.
And now, during testing your new code I found a bug with the dedicated resolvers feature (probably introduced by supporting multiple types):
The previous array of resolvers is not reset, so the array is extended for every query. Also, there is a malloc/free problem due to this multi-usage of the dedicated resolvers.

Linux:

free(): corrupted unsorted chunks

macOS:

massdns(11933,0x113e75600) malloc: Incorrect checksum for freed object 0x7fcc167045f8: probably modified after being freed.
Corrupt value: 0xafffffffffffffff
massdns(11933,0x113e75600) malloc: *** set a breakpoint in malloc_error_break to debug

A simple test to reproduce:

one.one.one.one
google-public-dns-a.google.com 0.0.0.0 0.0.0.0 8.8.4.4
google-public-dns-b.google.com 0.0.0.0 0.0.0.0 1.1.1.1

resolvers file:

8.8.8.8

Expectation:

google-public-dns-a.google.com. 8.8.4.4:53
google-public-dns-b.google.com. 1.1.1.1:53
one.one.one.one. 8.8.8.8:53

for

"$DIR"/../../bin/massdns --extended-input -c 50 -r "$DIR"/google-dns.txt --quiet -o J "$DIR"/names.txt | jq -r '(.name + " " + .resolver)' | sort | grep -E -q "`cat $DIR/expected`"

I created a PR to fix the bug including the test case: #125

@blechschmidt
Copy link
Owner

Thank you very much! I have merged your fix.

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

No branches or pull requests

2 participants