Skip to content

Commit b860d3c

Browse files
miniplidavem330
authored andcommitted
l2tp: fix info leak in l2tp_ip6_recvmsg()
The L2TP code for IPv6 fails to initialize the l2tp_conn_id member of struct sockaddr_l2tpip6 and therefore leaks four bytes kernel stack in l2tp_ip6_recvmsg() in case msg_name is set. Initialize l2tp_conn_id with 0 to avoid the info leak. Signed-off-by: Mathias Krause <minipli@googlemail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a5598bd commit b860d3c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: net/l2tp/l2tp_ip6.c

+1
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,7 @@ static int l2tp_ip6_recvmsg(struct kiocb *iocb, struct sock *sk,
690690
lsa->l2tp_addr = ipv6_hdr(skb)->saddr;
691691
lsa->l2tp_flowinfo = 0;
692692
lsa->l2tp_scope_id = 0;
693+
lsa->l2tp_conn_id = 0;
693694
if (ipv6_addr_type(&lsa->l2tp_addr) & IPV6_ADDR_LINKLOCAL)
694695
lsa->l2tp_scope_id = IP6CB(skb)->iif;
695696
}

0 commit comments

Comments
 (0)