fou: clean up socket with kfree_rcu
authorHannes Frederic Sowa <hannes@stressinduktion.org>
Tue, 15 Dec 2015 20:01:53 +0000 (21:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Jan 2016 04:54:16 +0000 (20:54 -0800)
commit2bc1b5b3a634081d49dbb16aab2b55cec1eb55b9
treea535a9cdd7d908b82ca9577e2772245813bd1613
parent78e1970233fd270349834bb8b7ca84c58c7c974c
fou: clean up socket with kfree_rcu

[ Upstream commit 3036facbb7be3a169e35be3b271162b0fa564a2d ]

fou->udp_offloads is managed by RCU. As it is actually included inside
the fou sockets, we cannot let the memory go out of scope before a grace
period. We either can synchronize_rcu or switch over to kfree_rcu to
manage the sockets. kfree_rcu seems appropriate as it is used by vxlan
and geneve.

Fixes: 23461551c00628c ("fou: Support for foo-over-udp RX path")
Cc: Tom Herbert <tom@herbertland.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/fou.c