summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2015-12-14 13:48:36 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-01-22 19:47:55 -0800
commit83f2b0860770d05f14cb8ce29ffd18f2f5585a4e (patch)
treedd1556ce0ce3f0f5bfc3071826b17f56d4b70ec9 /drivers
parent457fca596cd37ea06006b290bdbc5c7c5d8a12e3 (diff)
downloadlinux-stable-83f2b0860770d05f14cb8ce29ffd18f2f5585a4e.tar.gz
linux-stable-83f2b0860770d05f14cb8ce29ffd18f2f5585a4e.tar.bz2
linux-stable-83f2b0860770d05f14cb8ce29ffd18f2f5585a4e.zip
pptp: verify sockaddr_len in pptp_bind() and pptp_connect()
[ Upstream commit 09ccfd238e5a0e670d8178cf50180ea81ae09ae1 ] Reported-by: Dmitry Vyukov <dvyukov@gmail.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ppp/pptp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ppp/pptp.c b/drivers/net/ppp/pptp.c
index 0d5a5faaf83b..9a423435039a 100644
--- a/drivers/net/ppp/pptp.c
+++ b/drivers/net/ppp/pptp.c
@@ -420,6 +420,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;
@@ -441,6 +444,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;