Skip to content

Commit 51fb60e

Browse files
p-hueberdavem330
authored andcommitted
l2tp: avoid use-after-free caused by l2tp_ip_backlog_recv
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>
1 parent 1ecc9ad commit 51fb60e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/l2tp/l2tp_ip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ static int l2tp_ip_backlog_recv(struct sock *sk, struct sk_buff *skb)
388388
drop:
389389
IP_INC_STATS(sock_net(sk), IPSTATS_MIB_INDISCARDS);
390390
kfree_skb(skb);
391-
return -1;
391+
return 0;
392392
}
393393

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

0 commit comments

Comments
 (0)