]> git.baikalelectronics.ru Git - kernel.git/commit
ipvlan: fix addr hash list corruption
authorJiri Benc <jbenc@redhat.com>
Sat, 28 Mar 2015 18:13:22 +0000 (19:13 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 31 Mar 2015 17:28:33 +0000 (13:28 -0400)
commitff900d2727c2eaced2d3569169596cd14487bb60
tree75496324aa43dd29aff4a12f44ee2b19e5b27f0d
parente96363ea65db39bdd6755b01a3b99e4336a4c0a6
ipvlan: fix addr hash list corruption

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.

When the interface is down, the addresses should be kept off the hash list
for performance reasons. Ensure this is true, which also fixes the double add
problem. To fix the double free, check whether the address is hashed before
removing it.

Reported-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipvlan/ipvlan_core.c
drivers/net/ipvlan/ipvlan_main.c