From: Jiri Benc <jbenc@redhat.com>
To: Mahesh Bandewar <maheshb@google.com>
Cc: linux-netdev <netdev@vger.kernel.org>, Dan Williams <dcbw@redhat.com>
Subject: Re: [PATCH net] ipvlan: fix addr hash list corruption
Date: Tue, 24 Mar 2015 09:58:09 +0100 [thread overview]
Message-ID: <20150324095809.6d6b911c@griffin> (raw)
In-Reply-To: <CAF2d9jgbJ793VygsX0vmPDP-2mttVn_eT26NdirkaKg-hQ7FYw@mail.gmail.com>
On Mon, 23 Mar 2015 18:10:01 -0700, Mahesh Bandewar wrote:
> On Mon, Mar 23, 2015 at 2:10 PM, Jiri Benc <jbenc@redhat.com> wrote:
> > When ipvlan interface with IP addresses attached is brought down and then
> > deleted, the assigned addresses are deleted twice from the address hash
> > list, first on the interface down and second on the link deletion.
> > Similarly, when an address is added while the interface is down, it is added
> > second time once the interface is brought up.
> >
> Presumably this is creating problems for you and I'm not sure why? Do
> you have a script / (sequence of commands) to produce this condition?
You cannot call hlist_del_rcu on the same pointer twice. Nor
hlist_add_head_rcu, for that matter.
Try e.g.:
ip link add link eth0 name ipvl0 type ipvlan mode l2
ip link set ipvl0 up
ip addr add 1.2.3.1/24 dev ipvl0
ip link set ipvl0 down
-> ipvlan_ht_addr_del(1.2.3.1)
ip link del ipvl0
-> ipvlan_ht_addr_del(1.2.3.1)
-> crash
Or:
ip link add link eth0 name ipvl0 type ipvlan mode l2
ip addr add 1.2.3.1/24 dev ipvl0
-> ipvlan_ht_addr_add(1.2.3.1)
ip link set ipvl0 up
-> ipvlan_ht_addr_add(1.2.3.1)
-> does not crash immediately but the list is corrupted, go see how the
pointers in port->hlhead[hash] list look now
> ipvlan_ht_addr_del() does use synchronize_rcu() expect when the device
> in dismantle state. Could that be a reason?
This has nothing to do with RCU.
Jiri
--
Jiri Benc
next prev parent reply other threads:[~2015-03-24 8:58 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 [this message]
2015-03-24 17:00 ` David Miller
2015-03-24 17:06 ` Jiri Benc
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=20150324095809.6d6b911c@griffin \
--to=jbenc@redhat.com \
--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 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.