[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1458115601-5762-76-git-send-email-lizf@kernel.org>
Date: Wed, 16 Mar 2016 16:06:10 +0800
From: lizf@...nel.org
To: stable@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, WANG Cong <xiyou.wangcong@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Zefan Li <lizefan@...wei.com>
Subject: [PATCH 3.4 076/107] pptp: verify sockaddr_len in pptp_bind() and pptp_connect()
From: WANG Cong <xiyou.wangcong@...il.com>
3.4.111-rc1 review patch. If anyone has any objections, please let me know.
------------------
commit 09ccfd238e5a0e670d8178cf50180ea81ae09ae1 upstream.
Reported-by: Dmitry Vyukov <dvyukov@...il.com>
Signed-off-by: Cong Wang <xiyou.wangcong@...il.com>
Signed-off-by: David S. Miller <davem@...emloft.net>
Signed-off-by: Zefan Li <lizefan@...wei.com>
---
drivers/net/ppp/pptp.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/ppp/pptp.c b/drivers/net/ppp/pptp.c
index 9f047a0..5a13ad0 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;
--
1.9.1
Powered by blists - more mailing lists