FS#60366 - [dnsmasq] configuration-dependent segfault

Attached to Project: Arch Linux
Opened by Daniel Hogan (dhogan) - Wednesday, 10 October 2018, 01:58 GMT
Last edited by Toolybird (Toolybird) - Wednesday, 27 September 2023, 06:13 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Christian Hesse (eworm)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
I use dnsmasq as a DNS-based ad blocker, using StevenBlack's list of ad-serving domains. His list is available at https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts and is then processed into a dnsmasq compatible format. One of these hosts causes dnsmasq to segfault when added to the configuration file. The configuration file passes dnsmasq's internal configuration check ('dnsmasq --test'). The configuration did not cause previous versions to segfault, and the regression was introduced between versions 2.79-1 and 2.79-3.

Additional info:
dnsmasq 2.79-3

Steps to reproduce:
Add the line 'address=/r6---sn-5ualdne7.c.2mdn.net/0.0.0.0/' to /etc/dnsmasq.conf
Start dnsmasq.service
Dnsmasq segfaults
This task depends upon

Closed by  Toolybird (Toolybird)
Wednesday, 27 September 2023, 06:13 GMT
Reason for closing:  Upstream
Additional comments about closing:  This look a bit old and stale. If still happening, please report to upstream mailing list as mentioned in the comments.
Comment by Tasnad K (tasnad) - Tuesday, 23 October 2018, 15:28 GMT
I can confirm this. Same situation, same domain, newer
dnsmasq version 2.80.
I guess it would be better to report this upstream, but I'm not sure which bugtracker to use. The thekelleys.org.uk/dnsmasq repo has no tracking and the github mirror seems unmaintained...
Comment by Jelle van der Waa (jelly) - Tuesday, 08 January 2019, 19:41 GMT
This does not segfault anymore since we now run dnsmasq --test before ExecStartPre.

And when running it manually I can also not reproduce it.

[jelle@helium][~]%sudo dnsmasq -C /etc/dnsmasq.conf

dnsmasq: bad option at line 680 of /etc/dnsmasq.conf
Comment by Tasnad K (tasnad) - Tuesday, 08 January 2019, 20:18 GMT
Still broken for me, but not a segfault, just dnsmasq failing to start (which has the same effect for me).

Does
echo 'address=/hm--test2.vergic.com/#' | dnsmasq -C -
work for you?
The end of you comment sounds like you also have the bug (although with slightly other wording of the error message).
I get "dnsmasq: error at line 1 of stdin".
The same happens with 'dnsmaq --test'.

I'm still on version 2.80 and there is no newer version updtream, as far as I can tell.

Cheers,
Tasnad
Comment by Jelle van der Waa (jelly) - Tuesday, 08 January 2019, 20:23 GMT
I have the same error as your example.
Comment by Tasnad K (tasnad) - Tuesday, 08 January 2019, 20:26 GMT
So I consider this a bug then, since the URLs are valid.
My guess is that it's related to arg parsing, since it appears when double dashes are in the URLs.
Any suggestions where to report it?
Comment by Jelle van der Waa (jelly) - Tuesday, 08 January 2019, 20:30 GMT
I presume you will have to escape the -, the following works:

echo 'address=/hm\-\-test2.vergic.com/#' | dnsmasq -C -
Comment by Tasnad K (tasnad) - Tuesday, 08 January 2019, 20:59 GMT
I tried that. Although it prevents dnsmasq from failing, it renders the whole line ineffective.
Comment by Jelle van der Waa (jelly) - Thursday, 10 January 2019, 21:15 GMT
Please contact the dnsmasq mailinsg list about this issue http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss since there is no bug tracker.
Comment by Buggy McBugFace (bugbot) - Tuesday, 08 August 2023, 19:11 GMT
This is an automated comment as this bug is open for more then 2 years. Please reply if you still experience this bug otherwise this issue will be closed after 1 month.

Loading...