Skip to content

Commit 2cd0afc

Browse files
p-huebergregkh
authored andcommitted
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>
1 parent 354f791 commit 2cd0afc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/l2tp/l2tp_ip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ static int l2tp_ip_backlog_recv(struct sock *sk, struct sk_buff *skb)
383383
drop:
384384
IP_INC_STATS(sock_net(sk), IPSTATS_MIB_INDISCARDS);
385385
kfree_skb(skb);
386-
return -1;
386+
return 0;
387387
}
388388

389389
/* Userspace will call sendmsg() on the tunnel socket to send L2TP

0 commit comments

Comments
 (0)