mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 03:10:12 +00:00
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: Mathias Krause <minipli@googlemail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ee7255ada3
commit
a5f6fc28d6
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue