netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <amwang@redhat.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, david.ward@ll.mit.edu, jorge@dti2.net
Subject: Re: [PATCH net-next] 802: fix a possible race condition
Date: Mon, 25 Mar 2013 21:32:18 +0800	[thread overview]
Message-ID: <1364218338.2532.15.camel@cr0> (raw)
In-Reply-To: <20130324.172403.776354963637295731.davem@davemloft.net>

On Sun, 2013-03-24 at 17:24 -0400, David Miller wrote:
> From: Cong Wang <amwang@redhat.com>
> Date: Sat, 23 Mar 2013 13:14:08 +0800
> 
> > 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>
> 
> Under what conditions can entries be removed or added to
> these RB-trees without the RTNL being held?

At least garp_join_timer() calls garp_pdu_queue() in a timer:

static void garp_join_timer(unsigned long data)
{
        struct garp_applicant *app = (struct garp_applicant *)data;

        spin_lock(&app->lock);
        garp_gid_event(app, GARP_EVENT_TRANSMIT_PDU);
        garp_pdu_queue(app);
        spin_unlock(&app->lock);

        garp_queue_xmit(app);
        garp_join_timer_arm(app);
}

which I don't think can hold RTNL lock possibly.

> 
> If such events cannot happen, then no locking is needed.
> 
> Even if your change is correct and necessary, the answer to my
> needs to be added to your commit message.

Ok, I will.

Thanks.

  reply	other threads:[~2013-03-25 13:32 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   ` [PATCH net-next] 802: fix a possible race condition Cong Wang
2013-03-24 21:24     ` David Miller
2013-03-25 13:32       ` Cong Wang [this message]
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=1364218338.2532.15.camel@cr0 \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).