lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAO7SqHA5pBs7Tmop1ukS_AEXO8K9Np7odo20QdTYHBg2qoV49Q@mail.gmail.com>
Date:	Fri, 27 Sep 2013 16:04:00 -0700
From:	Salam Noureddine <noureddine@...stanetworks.com>
To:	Stephen Hemminger <stephen@...workplumber.org>
Cc:	"David S. Miller" <davem@...emloft.net>,
	Alexey Kuznetsov <kuznet@....inr.ac.ru>,
	James Morris <jmorris@...ei.org>,
	Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
	Patrick McHardy <kaber@...sh.net>, netdev@...r.kernel.org
Subject: Re: [PATCH 2/2] ipv4 igmp: use del_timer_sync instead of del_timer in ip_mc_down

I tried using in_dev_put instead of __in_dev_put and it seems to work
fine in my testing on linux-3.4. I don't quite understand the reason
for having __in_dev_put decrement the refcnt without destroying the
in_device in case it reaches 0. If the timer handler assumes it cannot
be the last one to hold a reference then that would mean it doesn't
need the reference in the first place.

If this solution is preferable to using del_timer_sync I would go
ahead and submit a new patch.

Thanks,

Salam

On Thu, Sep 5, 2013 at 10:22 AM, Salam Noureddine
<noureddine@...stanetworks.com> wrote:
> On Thu, Sep 5, 2013 at 8:43 AM, Stephen Hemminger
> <stephen@...workplumber.org> wrote:
>> On Wed,  4 Sep 2013 23:43:24 -0700
>> Salam Noureddine <noureddine@...stanetworks.com> wrote:
>>
>>> Delete timers using del_timer_sync in ip_mc_down. Otherwise, it is
>>> possible for the timer to be the last to release its reference to the
>>> in_device and since __in_dev_put doesn't destroy the in_device we
>>> would end up leaking a reference to the net_device and see messages
>>> like the following,
>>>
>>> unregister_netdevice: waiting for eth0 to become free. Usage count = 1
>>>
>>> Tested on linux-3.4.43.
>>>
>>> Signed-off-by: Salam Noureddine <noureddine@...stanetworks.com>
>>
>> Why not just call in_dev_put instead which just proper cleanup.
>> It is less risky of deadlock than del_timer_sync.
>
> I was wondering if there was a reason behind using __in_dev_put since
> the multicast code
> is the only user of that function. I can test using in_dev_put
> instead. Should __in_dev_put
> be removed altogether in that case?
>
> Thanks,
>
> Salam
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ