Skip to content

Commit

Permalink
pptp: fix stack info leak in pptp_getname()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Mathias Krause <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
minipli authored and davem330 committed Nov 21, 2014
1 parent ee7255a commit a5f6fc2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/ppp/pptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit a5f6fc2

Please sign in to comment.