xen-netback: don't populate the hash cache on XenBus disconnect
authorIgor Druzhinin <igor.druzhinin@citrix.com>
Thu, 28 Feb 2019 14:11:26 +0000 (14:11 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 Mar 2019 06:17:19 +0000 (07:17 +0100)
commite5e5840183deac7b135b35c199968b3e61949851
tree95360b6f6aee3818eb42cd7ab10ed57776e86692
parent488b940719b708c9fae904bac95d4db832bf05f0
xen-netback: don't populate the hash cache on XenBus disconnect

[ Upstream commit a2288d4e355992d369c50c45d017a85f6061ff71 ]

Occasionally, during the disconnection procedure on XenBus which
includes hash cache deinitialization there might be some packets
still in-flight on other processors. Handling of these packets includes
hashing and hash cache population that finally results in hash cache
data structure corruption.

In order to avoid this we prevent hashing of those packets if there
are no queues initialized. In that case RCU protection of queues guards
the hash cache as well.

Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/xen-netback/hash.c
drivers/net/xen-netback/interface.c