pptp: verify sockaddr_len in pptp_bind() and pptp_connect()
Subsystems (2)
PATCH 1/1 pptp: verify sockaddr_len in pptp_bind() and pptp_connect()
Reported-by Dmitry Vyukov <[email protected]>
Signed-off-by Cong Wang <[email protected]>
--- drivers/net/ppp/pptp.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ppp/pptp.c +6 -0
@@ -419,6 +419,9 @@ static int pptp_bind(struct socket *sock, struct sockaddr *uservaddr,struct pptp_opt *opt = &po->proto.pptp;int error =0 ; +if (sockaddr_len <sizeof (struct sockaddr_pppox )) +return -EINVAL ; +lock_sock (sk); opt->src_addr = sp->sa_addr.pptp;
@@ -440,6 +443,9 @@ static int pptp_connect(struct socket *sock, struct sockaddr *uservaddr,struct flowi4 fl4;int error =0 ; +if (sockaddr_len <sizeof (struct sockaddr_pppox )) +return -EINVAL ; +if (sp->sa_protocol !=PX_PROTO_PPTP )return -EINVAL ;
Signature · 1 line
1.8.3.1
David Miller
maintainerFrom: Cong Wang <[email protected]>
Date: Mon, 14 Dec 2015 13:48:36 -0800
Quoted 2 lines
Reported-by Dmitry Vyukov <[email protected]>Signed-off-by Cong Wang <[email protected]>
Applied and queued up for -stable, thanks.