Skip to content

Commit a5f6fc2

Browse files
miniplidavem330
authored andcommitted
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 <[email protected]> Signed-off-by: Mathias Krause <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ee7255a commit a5f6fc2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/ppp/pptp.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,9 @@ static int pptp_getname(struct socket *sock, struct sockaddr *uaddr,
506506
int len = sizeof(struct sockaddr_pppox);
507507
struct sockaddr_pppox sp;
508508

509-
sp.sa_family = AF_PPPOX;
509+
memset(&sp.sa_addr, 0, sizeof(sp.sa_addr));
510+
511+
sp.sa_family = AF_PPPOX;
510512
sp.sa_protocol = PX_PROTO_PPTP;
511513
sp.sa_addr.pptp = pppox_sk(sock->sk)->proto.pptp.src_addr;
512514

0 commit comments

Comments
 (0)