From: Cong Wang <amwang@redhat.com>
To: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
David Ward <david.ward@ll.mit.edu>,
"Jorge Boncompte [DTI2]" <jorge@dti2.net>,
Cong Wang <amwang@redhat.com>
Subject: [PATCH net-next] 802: fix a possible race condition
Date: Sat, 23 Mar 2013 13:14:08 +0800 [thread overview]
Message-ID: <1364015648-4195-2-git-send-email-amwang@redhat.com> (raw)
In-Reply-To: <1364015648-4195-1-git-send-email-amwang@redhat.com>
From: Cong Wang <amwang@redhat.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@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>
---
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
next prev parent reply other threads:[~2013-03-23 5:14 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-22 7:50 [Patch net-next] ip_gre: increase inner ip header ID during segmentation Cong Wang
2013-03-22 7:57 ` Cong Wang
2013-03-22 10:31 ` [PATCH net-next 1/2] " Cong Wang
2013-03-22 10:31 ` [PATCH net-next 2/2] udp: " Cong Wang
2013-03-22 14:24 ` David Miller
2013-03-22 14:24 ` [PATCH net-next 1/2] ip_gre: " David Miller
2013-03-22 17:12 ` Pravin Shelar
2013-03-23 3:25 ` Cong Wang
2013-03-23 5:14 ` [PATCH net-next] 8021q: fix a potential use-after-free Cong Wang
2013-03-23 5:14 ` Cong Wang [this message]
2013-03-24 21:24 ` [PATCH net-next] 802: fix a possible race condition David Miller
2013-03-25 13:32 ` Cong Wang
2013-03-25 14:08 ` Eric Dumazet
2013-03-26 3:01 ` Cong Wang
2013-03-23 15:16 ` [PATCH net-next] 8021q: fix a potential use-after-free Eric Dumazet
2013-03-24 21:27 ` David Miller
-- strict thread matches above, loose matches on Subject: below --
2013-04-03 7:52 [PATCH net-next] 802: fix a possible race condition Cong Wang
2013-04-07 21:04 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1364015648-4195-2-git-send-email-amwang@redhat.com \
--to=amwang@redhat.com \
--cc=davem@davemloft.net \
--cc=david.ward@ll.mit.edu \
--cc=jorge@dti2.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.