netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Benc <jbenc@redhat.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, maheshb@google.com, dcbw@redhat.com
Subject: Re: [PATCH net] ipvlan: fix addr hash list corruption
Date: Tue, 24 Mar 2015 18:06:28 +0100	[thread overview]
Message-ID: <20150324180628.278017fb@griffin> (raw)
In-Reply-To: <20150324.130037.1897087027068811494.davem@davemloft.net>

On Tue, 24 Mar 2015 13:00:37 -0400 (EDT), David Miller wrote:
> From: Jiri Benc <jbenc@redhat.com>
> Date: Mon, 23 Mar 2015 22:10:19 +0100
> 
> > @@ -504,7 +504,8 @@ static void ipvlan_link_delete(struct net_device *dev, struct list_head *head)
> >  
> >  	if (ipvlan->ipv6cnt > 0 || ipvlan->ipv4cnt > 0) {
> >  		list_for_each_entry_safe(addr, next, &ipvlan->addrs, anode) {
> > -			ipvlan_ht_addr_del(addr, !dev->dismantle);
> > +			if (netif_running(dev))
> > +				ipvlan_ht_addr_del(addr, !dev->dismantle);
> >  			list_del_rcu(&addr->anode);
> >  		}
> >  	}
> 
> This is so error prone, because you are depending upon so many implementation
> details to infer a boolean state "is this address hashed".
> 
> So just add the boolean state to struct ipvl_addr, and manage it in
> the ipvlan_ht_addr_{add,del}() code.

I had that originally but then decided to go with smaller memory
footprint. Which obviously doesn't matter much here. I'll send v2 with
the boolean state.

 Jiri

-- 
Jiri Benc

  reply	other threads:[~2015-03-24 17:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23 21:10 [PATCH net] ipvlan: fix addr hash list corruption Jiri Benc
2015-03-24  1:10 ` Mahesh Bandewar
2015-03-24  8:58   ` Jiri Benc
2015-03-24 17:00 ` David Miller
2015-03-24 17:06   ` Jiri Benc [this message]
2015-03-24 23:16     ` Mahesh Bandewar
2015-03-25  1:18       ` David Miller
2015-03-25  8:58       ` Jiri Benc
2015-03-25 15:46         ` David Miller
2015-03-25 18:11           ` Mahesh Bandewar
2015-03-25 18:47             ` Dan Williams
2015-03-25 23:21             ` Jiri Benc
2015-03-25 23:49               ` Jiri Benc
2015-03-26  2:15               ` Mahesh Bandewar
2015-03-26  8:45                 ` Jiri Benc
2015-03-27  5:00                   ` Mahesh Bandewar

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=20150324180628.278017fb@griffin \
    --to=jbenc@redhat.com \
    --cc=davem@davemloft.net \
    --cc=dcbw@redhat.com \
    --cc=maheshb@google.com \
    --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).