Discussion:
[Dnsmasq-discuss] dnsmasqd crash
Justin Jose
2017-06-19 00:02:36 UTC
Permalink
???Hi,


I got a couple of dnsmasqd crash and on investigating I found the crash is due to accessing a NULL pointer.

I have a fix for this problem and attached with this mail.


Would you have any suggestion for this fix?


Thanks

Justin
Kevin Darbyshire-Bryant
2017-06-19 08:56:37 UTC
Permalink
On 19/06/17 01:02, Justin Jose wrote:
> ​​​Hi,
>
>
> I got a couple of dnsmasqd crash and on investigating I found the crash
> is due to accessing a NULL pointer.

What version of dnsmasq?

>
> I have a fix for this problem and attached with this mail.
>
>
> Would you have any suggestion for this fix?

hostname_isequal is used in quite a few places and should never be
passed a null pointer, so in my opinion the fix is a sticking plaster
over the issue and has the potential result of leaving null pointers
hanging around for other functions to fall over anyway. The root cause
should be found and squished. Any idea which particular call to
hostname_isequal was involved?

Cheers,

Kevin
Kevin Darbyshire-Bryant
2017-06-20 09:53:08 UTC
Permalink
Probably best to reply to the list as well where there are much better
experts than me.

On 19/06/17 22:39, Justin Jose wrote:
> Hi Kevin,
>
> Thank you for the response. Here are my answers for your questions.
>
> Q. What version of dnsmasq?
>
> [Ans] The dnsmasq version I am using is 2.55.

2.55 is some 7 years old, 2.77 being released 2 weeks or so ago and 2.78
fixing a couple of oversights in that release due 'soon'.

>
> Q. hostname_isequal is used in quite a few places and should never be
> passed a null pointer, so in my opinion the fix is a sticking plaster
> over the issue and has the potential result of leaving null pointers
> hanging around for other functions to fall over anyway. The root cause
> should be found and squished. Any idea which particular call to
> hostname_isequal was involved?
>
> [Ans:] When the crash happened, the call to hostname_isequal is occured from forward_query at round line number 500.
> I am not sure the reason for the NULL arguments here.

The first step here has to be to update to a much more recent version of
dnsmasq and see if the problem still occurs. Is the error repeatable?
If so, that would make testing a lot easier.

Cheers,

Kevin
Justin Jose
2017-06-20 21:44:50 UTC
Permalink
Hi Kevin,

Thank you for the response. Here are my answers for your questions.

Q. What version of dnsmasq?

[Ans] The dnsmasq version I am using is 2.55.

Q. hostname_isequal is used in quite a few places and should never be
passed a null pointer, so in my opinion the fix is a sticking plaster
over the issue and has the potential result of leaving null pointers
hanging around for other functions to fall over anyway. The root cause
should be found and squished. Any idea which particular call to
hostname_isequal was involved?

[Ans:] When the crash happened, the call to hostname_isequal is occured from forward_query at round line number 500.
I am not sure the reason for the NULL arguments here.

Regards
Justin
________________________________________
From: Dnsmasq-discuss <dnsmasq-discuss-***@lists.thekelleys.org.uk> on behalf of Kevin Darbyshire-Bryant <***@darbyshire-bryant.me.uk>
Sent: Monday, 19 June 2017 8:56 p.m.
To: dnsmasq-***@lists.thekelleys.org.uk
Subject: Re: [Dnsmasq-discuss] dnsmasqd crash

On 19/06/17 01:02, Justin Jose wrote:
> ​​​Hi,
>
>
> I got a couple of dnsmasqd crash and on investigating I found the crash
> is due to accessing a NULL pointer.

What version of dnsmasq?

>
> I have a fix for this problem and attached with this mail.
>
>
> Would you have any suggestion for this fix?

hostname_isequal is used in quite a few places and should never be
passed a null pointer, so in my opinion the fix is a sticking plaster
over the issue and has the potential result of leaving null pointers
hanging around for other functions to fall over anyway. The root cause
should be found and squished. Any idea which particular call to
hostname_isequal was involved?

Cheers,

Kevin

_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-***@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Simon Kelley
2017-06-25 20:49:31 UTC
Permalink
Can you reproduce the crash? What triggers it?

2.55 is seven years old now, and predates our use of git, so it's pretty
difficult to point to a fix, but I suspect that this bug is long gone.
Finding how to reproduce it and showing that it doesn't happen with
newer releases would be the best way.




Cheers,

Simon.

On 20/06/17 22:44, Justin Jose wrote:
> Hi Kevin,
>
> Thank you for the response. Here are my answers for your questions.
>
> Q. What version of dnsmasq?
>
> [Ans] The dnsmasq version I am using is 2.55.
>
> Q. hostname_isequal is used in quite a few places and should never be
> passed a null pointer, so in my opinion the fix is a sticking plaster
> over the issue and has the potential result of leaving null pointers
> hanging around for other functions to fall over anyway. The root cause
> should be found and squished. Any idea which particular call to
> hostname_isequal was involved?
>
> [Ans:] When the crash happened, the call to hostname_isequal is occured from forward_query at round line number 500.
> I am not sure the reason for the NULL arguments here.
>
> Regards
> Justin
> ________________________________________
> From: Dnsmasq-discuss <dnsmasq-discuss-***@lists.thekelleys.org.uk> on behalf of Kevin Darbyshire-Bryant <***@darbyshire-bryant.me.uk>
> Sent: Monday, 19 June 2017 8:56 p.m.
> To: dnsmasq-***@lists.thekelleys.org.uk
> Subject: Re: [Dnsmasq-discuss] dnsmasqd crash
>
> On 19/06/17 01:02, Justin Jose wrote:
>> ​​​Hi,
>>
>>
>> I got a couple of dnsmasqd crash and on investigating I found the crash
>> is due to accessing a NULL pointer.
>
> What version of dnsmasq?
>
>>
>> I have a fix for this problem and attached with this mail.
>>
>>
>> Would you have any suggestion for this fix?
>
> hostname_isequal is used in quite a few places and should never be
> passed a null pointer, so in my opinion the fix is a sticking plaster
> over the issue and has the potential result of leaving null pointers
> hanging around for other functions to fall over anyway. The root cause
> should be found and squished. Any idea which particular call to
> hostname_isequal was involved?
>
> Cheers,
>
> Kevin
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-***@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-***@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>
Justin Jose
2017-06-28 03:15:10 UTC
Permalink
Hi Simon.

The issue is reproducible on my device. It is very difficult for me to upgrade the current version to the latest.

But after close investigation I found a bug in our code and the issue is resolved now. Basically domain in the 'forward_query' function should
always point to the current server's domain.

Thanks
Justin
________________________________________
From: Dnsmasq-discuss <dnsmasq-discuss-***@lists.thekelleys.org.uk> on behalf of Simon Kelley <***@thekelleys.org.uk>
Sent: Monday, 26 June 2017 8:49 a.m.
To: dnsmasq-***@lists.thekelleys.org.uk
Subject: Re: [Dnsmasq-discuss] dnsmasqd crash

Can you reproduce the crash? What triggers it?

2.55 is seven years old now, and predates our use of git, so it's pretty
difficult to point to a fix, but I suspect that this bug is long gone.
Finding how to reproduce it and showing that it doesn't happen with
newer releases would be the best way.




Cheers,

Simon.

On 20/06/17 22:44, Justin Jose wrote:
> Hi Kevin,
>
> Thank you for the response. Here are my answers for your questions.
>
> Q. What version of dnsmasq?
>
> [Ans] The dnsmasq version I am using is 2.55.
>
> Q. hostname_isequal is used in quite a few places and should never be
> passed a null pointer, so in my opinion the fix is a sticking plaster
> over the issue and has the potential result of leaving null pointers
> hanging around for other functions to fall over anyway. The root cause
> should be found and squished. Any idea which particular call to
> hostname_isequal was involved?
>
> [Ans:] When the crash happened, the call to hostname_isequal is occured from forward_query at round line number 500.
> I am not sure the reason for the NULL arguments here.
>
> Regards
> Justin
> ________________________________________
> From: Dnsmasq-discuss <dnsmasq-discuss-***@lists.thekelleys.org.uk> on behalf of Kevin Darbyshire-Bryant <***@darbyshire-bryant.me.uk>
> Sent: Monday, 19 June 2017 8:56 p.m.
> To: dnsmasq-***@lists.thekelleys.org.uk
> Subject: Re: [Dnsmasq-discuss] dnsmasqd crash
>
> On 19/06/17 01:02, Justin Jose wrote:
>> ​​​Hi,
>>
>>
>> I got a couple of dnsmasqd crash and on investigating I found the crash
>> is due to accessing a NULL pointer.
>
> What version of dnsmasq?
>
>>
>> I have a fix for this problem and attached with this mail.
>>
>>
>> Would you have any suggestion for this fix?
>
> hostname_isequal is used in quite a few places and should never be
> passed a null pointer, so in my opinion the fix is a sticking plaster
> over the issue and has the potential result of leaving null pointers
> hanging around for other functions to fall over anyway. The root cause
> should be found and squished. Any idea which particular call to
> hostname_isequal was involved?
>
> Cheers,
>
> Kevin
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-***@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-***@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>
Loading...