diff options
author | Mathias Krause <minipli@googlemail.com> | 2014-11-19 18:05:26 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-12-06 15:05:47 -0800 |
commit | f0eed5a220e777b9e01b9eb45d7e387a35f1f6fa (patch) | |
tree | 8ce38bd9dc8ecc0779c9c2dc6f72ea6f7e60eafc /drivers | |
parent | 3b0c6ddf7b237a203de34024de655cbb30e928b2 (diff) | |
download | lwn-f0eed5a220e777b9e01b9eb45d7e387a35f1f6fa.tar.gz lwn-f0eed5a220e777b9e01b9eb45d7e387a35f1f6fa.zip |
pptp: fix stack info leak in pptp_getname()
[ Upstream commit a5f6fc28d6e6cc379c6839f21820e62262419584 ]
pptp_getname() only partially initializes the stack variable sa,
particularly only fills the pptp part of the sa_addr union. The code
thereby discloses 16 bytes of kernel stack memory via getsockname().
Fix this by memset(0)'ing the union before.
Cc: Dmitry Kozlov <xeb@mail.ru>
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ppp/pptp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ppp/pptp.c b/drivers/net/ppp/pptp.c index 8161c3f066a3..0d5a5faaf83b 100644 --- a/drivers/net/ppp/pptp.c +++ b/drivers/net/ppp/pptp.c @@ -506,7 +506,9 @@ static int pptp_getname(struct socket *sock, struct sockaddr *uaddr, int len = sizeof(struct sockaddr_pppox); struct sockaddr_pppox sp; - sp.sa_family = AF_PPPOX; + memset(&sp.sa_addr, 0, sizeof(sp.sa_addr)); + + sp.sa_family = AF_PPPOX; sp.sa_protocol = PX_PROTO_PPTP; sp.sa_addr.pptp = pppox_sk(sock->sk)->proto.pptp.src_addr; |