[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1364015648-4195-2-git-send-email-amwang@redhat.com>
Date: Sat, 23 Mar 2013 13:14:08 +0800
From: Cong Wang <amwang@...hat.com>
To: netdev@...r.kernel.org
Cc: "David S. Miller" <davem@...emloft.net>,
David Ward <david.ward@...mit.edu>,
"Jorge Boncompte [DTI2]" <jorge@...2.net>,
Cong Wang <amwang@...hat.com>
Subject: [PATCH net-next] 802: fix a possible race condition
From: Cong Wang <amwang@...hat.com>
garp_pdu_queue() should ways be called with this spin lock.
garp_uninit_applicant() only holds rtnl lock which is not
enough here.
Found by code inspection.
Cc: "David S. Miller" <davem@...emloft.net>
Cc: David Ward <david.ward@...mit.edu>
Cc: "Jorge Boncompte [DTI2]" <jorge@...2.net>
Signed-off-by: Cong Wang <amwang@...hat.com>
---
net/802/garp.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/net/802/garp.c b/net/802/garp.c
index 8456f5d..5d9630a 100644
--- a/net/802/garp.c
+++ b/net/802/garp.c
@@ -609,8 +609,12 @@ void garp_uninit_applicant(struct net_device *dev, struct garp_application *appl
/* Delete timer and generate a final TRANSMIT_PDU event to flush out
* all pending messages before the applicant is gone. */
del_timer_sync(&app->join_timer);
+
+ spin_lock_bh(&app->lock);
garp_gid_event(app, GARP_EVENT_TRANSMIT_PDU);
garp_pdu_queue(app);
+ spin_unlock_bh(&app->lock);
+
garp_queue_xmit(app);
dev_mc_del(dev, appl->proto.group_address);
--
1.7.7.6
--
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