This is a note to let you know that I've just added the patch titled geneve: Remove socket and offload handlers at destruction. to the 3.18-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: geneve-remove-socket-and-offload-handlers-at-destruction.patch and it can be found in the queue-3.18 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Sat Jan 17 18:12:21 PST 2015 From: Jesse Gross <jesse@xxxxxxxxxx> Date: Tue, 16 Dec 2014 18:25:31 -0800 Subject: geneve: Remove socket and offload handlers at destruction. From: Jesse Gross <jesse@xxxxxxxxxx> [ Upstream commit 7ed767f73192d6daf673c6d885cd02d5f280ac1f ] Sockets aren't currently removed from the the global list when they are destroyed. In addition, offload handlers need to be cleaned up as well. Fixes: 0b5e8b8e ("net: Add Geneve tunneling protocol driver") CC: Andy Zhou <azhou@xxxxxxxxxx> Signed-off-by: Jesse Gross <jesse@xxxxxxxxxx> Acked-by: Thomas Graf <tgraf@xxxxxxx> Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- net/ipv4/geneve.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) --- a/net/ipv4/geneve.c +++ b/net/ipv4/geneve.c @@ -165,6 +165,15 @@ static void geneve_notify_add_rx_port(st } } +static void geneve_notify_del_rx_port(struct geneve_sock *gs) +{ + struct sock *sk = gs->sock->sk; + sa_family_t sa_family = sk->sk_family; + + if (sa_family == AF_INET) + udp_del_offload(&gs->udp_offloads); +} + /* Callback from net/ipv4/udp.c to receive packets */ static int geneve_udp_encap_recv(struct sock *sk, struct sk_buff *skb) { @@ -318,9 +327,17 @@ EXPORT_SYMBOL_GPL(geneve_sock_add); void geneve_sock_release(struct geneve_sock *gs) { + struct net *net = sock_net(gs->sock->sk); + struct geneve_net *gn = net_generic(net, geneve_net_id); + if (!atomic_dec_and_test(&gs->refcnt)) return; + spin_lock(&gn->sock_lock); + hlist_del_rcu(&gs->hlist); + geneve_notify_del_rx_port(gs); + spin_unlock(&gn->sock_lock); + queue_work(geneve_wq, &gs->del_work); } EXPORT_SYMBOL_GPL(geneve_sock_release); Patches currently in stable-queue which might be from jesse@xxxxxxxxxx are queue-3.18/net-generalize-ndo_gso_check-to-ndo_features_check.patch queue-3.18/geneve-remove-socket-and-offload-handlers-at-destruction.patch queue-3.18/geneve-fix-races-between-socket-add-and-release.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html