dhcpcd-discuss

Re: [dhcpcd-6.11.2] share SIGSEGV issue patch

Roy Marples

Thu Aug 18 11:30:23 2016

Hello Koichi san

On 18/08/2016 06:48, Okamoto, Koichi wrote:
> I came across SIGSEGV issue in dhcpcd-6.11.2 version on Linux-3.10.20.
> 
>     The following procedure on Linux3.10.26 causes SIGSEGV:
>       # dhcpcd -M -b wlan0
>       # dhcpcd --exit wlan0
>       # dhcpcd --exit eth0
> 
>     ifp->options became NULL at "ifp->options->options |= opts;" in
>     dhcpcd_handleargs() function in that case.
>     I added NULL check for this portion. That resolves this issue.
>     But I am not sure whether it is correct way. because there are
>     some ifp->options->options access without ifp->options pointer
>     check. If I could get more overall view of dhcpcd software
>     structure, I concluded other way. Anyway, this is my current
>     solution.
> 
>     Please note that to invoke stop_interface() didn't cause SIGSEGV
>     in that case because ifp->active was IF_INACTIVE (immediate value is 0)
>     at that time. But I consider there is no meaning to call stop_interface()
>     when ifp->options is nullptr under master mode.

Fixed here:
http://roy.marples.name/projects/dhcpcd/ci/f808c49c241712de?sbs=0

I changed your diff a little.
We should check active first, if active there are options, if not active
there may not be.

Thanks

Roy

Follow-Ups:
RE: [dhcpcd-6.11.2] share SIGSEGV issue patchOkamoto, Koichi
References:
[dhcpcd-6.11.2] share SIGSEGV issue patchOkamoto, Koichi
Archive administrator: postmaster@marples.name