[PATCH] mISDN: Fixing missing validation in base_sock_bind()

From: Emrah Demir
Date: Fri Apr 08 2016 - 15:16:47 EST


From: Emrah Demir <ed@xxxxxxxxxx>

Add validation code into mISDN/socket.c

Signed-off-by: Emrah Demir <ed@xxxxxxxxxx>
---
drivers/isdn/mISDN/socket.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c
index 0d29b5a..99e5f97 100644
--- a/drivers/isdn/mISDN/socket.c
+++ b/drivers/isdn/mISDN/socket.c
@@ -715,6 +715,9 @@ base_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
if (!maddr || maddr->family != AF_ISDN)
return -EINVAL;

+ if (addr_len < sizeof(struct sockaddr_mISDN))
+ return -EINVAL;
+
lock_sock(sk);

if (_pms(sk)->dev) {
--
2.8.0.rc3