提交 a5f6fc28 编写于 作者: M Mathias Krause 提交者: David S. Miller

pptp: fix stack info leak in pptp_getname()

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: NMathias Krause <minipli@googlemail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ee7255ad
...@@ -506,6 +506,8 @@ static int pptp_getname(struct socket *sock, struct sockaddr *uaddr, ...@@ -506,6 +506,8 @@ static int pptp_getname(struct socket *sock, struct sockaddr *uaddr,
int len = sizeof(struct sockaddr_pppox); int len = sizeof(struct sockaddr_pppox);
struct sockaddr_pppox sp; struct sockaddr_pppox sp;
memset(&sp.sa_addr, 0, sizeof(sp.sa_addr));
sp.sa_family = AF_PPPOX; sp.sa_family = AF_PPPOX;
sp.sa_protocol = PX_PROTO_PPTP; sp.sa_protocol = PX_PROTO_PPTP;
sp.sa_addr.pptp = pppox_sk(sock->sk)->proto.pptp.src_addr; sp.sa_addr.pptp = pppox_sk(sock->sk)->proto.pptp.src_addr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册