l2tp: hold session while sending creation notifications
authorGuillaume Nault <g.nault@alphalink.fr>
Thu, 21 May 2020 23:57:16 +0000 (00:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 May 2020 14:40:29 +0000 (16:40 +0200)
commitddda402d21dc991be3d314aba08a015db1475b32
tree47e02025c0c799d9818685b93aabf30f4aaf4e88
parent1d175333f1a0d0fefd248513be5178f330e11e5c
l2tp: hold session while sending creation notifications

commit 5e6a9e5a3554a5b3db09cdc22253af1849c65dff upstream.

l2tp_session_find() doesn't take any reference on the returned session.
Therefore, the session may disappear while sending the notification.

Use l2tp_session_get() instead and decrement session's refcount once
the notification is sent.

Backporting Notes

This is a backport of a backport.

Fixes: 33f72e6f0c67 ("l2tp : multicast notification to the registered listeners")
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/l2tp/l2tp_netlink.c