Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

l2tp: fix info leak via getsockname()

The L2TP code for IPv6 fails to initialize the l2tp_unused member of
struct sockaddr_l2tpip6 and that for leaks two bytes kernel stack via
the getsockname() syscall. Initialize l2tp_unused with 0 to avoid the
info leak.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: James Chapman <jchapman@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Mathias Krause and committed by
David S. Miller
04d4fbca 792039c7

+1
+1
net/l2tp/l2tp_ip6.c
··· 410 410 lsa->l2tp_family = AF_INET6; 411 411 lsa->l2tp_flowinfo = 0; 412 412 lsa->l2tp_scope_id = 0; 413 + lsa->l2tp_unused = 0; 413 414 if (peer) { 414 415 if (!lsk->peer_conn_id) 415 416 return -ENOTCONN;