802: fix a possible race condition
authorCong Wang <amwang@redhat.com>
Tue, 2 Apr 2013 21:52:40 +0000 (21:52 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 7 Apr 2013 21:04:17 +0000 (17:04 -0400)
commitcfbe800b8b771afc7d5aa113e19f85ec933b7618
tree153b62e924d6a9982788f294590d0e78d7e53d08
parent23a9544206dd91dfe048fcf67abec3f3104c42b9
802: fix a possible race condition

(Resend with a better changelog)

garp_pdu_queue() should ways be called with this spin lock.
garp_uninit_applicant() only holds rtnl lock which is not
enough here.  A possible race can happen as garp_pdu_rcv()
is called in BH context:

garp_pdu_rcv()
  |->garp_pdu_parse_msg()
    |->garp_pdu_parse_attr()
      |-> garp_gid_event()

Found by code inspection.

Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: David Ward <david.ward@ll.mit.edu>
Cc: "Jorge Boncompte [DTI2]" <jorge@dti2.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/802/garp.c