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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAF1J0HN5k5=kJtcX_enDYBqnAf2HAH5s84nBOb9QjShWnvwmug@mail.gmail.com>
Date:	Sat, 8 Jun 2013 11:23:27 +0300
From:	Mike Rapoport <mike.rapoport@...ellosystems.com>
To:	Stephen Hemminger <stephen@...workplumber.org>
Cc:	Cong Wang <xiyou.wangcong@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next 03/10] vxlan: move IGMP join/leave to work queue

On Wed, Jun 5, 2013 at 6:41 PM, Stephen Hemminger
<stephen@...workplumber.org> wrote:
> On Wed, 5 Jun 2013 10:29:10 +0300
> Mike Rapoport <mike.rapoport@...ellosystems.com> wrote:
>
>> On Wed, Jun 5, 2013 at 9:47 AM, Cong Wang <xiyou.wangcong@...il.com> wrote:
>> > On Wed, 05 Jun 2013 at 04:24 GMT, Stephen Hemminger <stephen@...workplumber.org> wrote:
>> >> Do join/leave from work queue to avoid lock inversion problems
>> >> between normal socket and RTNL. The code comes out cleaner
>> >> as well.
>> >>
>> >> Uses Cong Wang's suggestion to turn refcnt into a real atomic
>> >> since now need to handle case where last use of socket is IGMP
>> >> worker.
>> >>
>> >> Also fixes race where vxlan_stop could be called after
>> >> device was deleted on module removal. The call to rtnl_link_unregister
>> >> would call dellink while vxlan device was still up. Reordering
>> >> the calls fixes it.
>> >>
>> >
>> > After the first 3 patches applied, I got:
>> >
>> > [   55.010954] general protection fault: 0000 [#1] SMP DEBUG_PAGEALLOC
>> > [   55.013309] CPU: 1 PID: 163 Comm: kworker/1:2 Not tainted
>> > 3.10.0-rc2+ #1150
>> > [   55.013309] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
>> > [   55.013309] Workqueue: events vxlan_igmp_work
>>
>> I think the problem happens because vxlan_dellink does
>> unregister_netdevice_queue and then immediately calls
>> vxlan_sock_release and thus vs_sock is released before igmp_work
>> starts
>
> This is handled because a refcount is acquired before the igmp_work
> is scheduled.

As far as I can tell, the vxlan_sock_release in vxlan_dellink call
occurs before vxlan_stop is invoked, and therefore before refcount is
acquired for igmp_work.
When I tried to use unregister_netdevice_queue(dev, NULL) I haven't
seen crashes.


--
Sincerely yours,
Mike.
--
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