l2tp: avoid use-after-free caused by l2tp_ip_backlog_recv
authorPaul Hüber <phueber@kernsp.in>
Sun, 26 Feb 2017 16:58:19 +0000 (17:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Mar 2017 11:43:32 +0000 (12:43 +0100)
commit837786cbbb60f00770b02efd15546b36008b536e
tree96ed249883c2449aa5999ad1a9be8d80deed3dc5
parent063893e4ec88c253ff52a8e8486169fcf5e2d840
l2tp: avoid use-after-free caused by l2tp_ip_backlog_recv

[ Upstream commit 51fb60eb162ab84c5edf2ae9c63cf0b878e5547e ]

l2tp_ip_backlog_recv may not return -1 if the packet gets dropped.
The return value is passed up to ip_local_deliver_finish, which treats
negative values as an IP protocol number for resubmission.

Signed-off-by: Paul Hüber <phueber@kernsp.in>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/l2tp/l2tp_ip.c