mISDN: Fixing missing validation in base_sock_bind()
authorEmrah Demir <ed@abdsec.com>
Fri, 8 Apr 2016 19:16:11 +0000 (22:16 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 14 Apr 2016 03:00:50 +0000 (23:00 -0400)
Add validation code into mISDN/socket.c

Signed-off-by: Emrah Demir <ed@abdsec.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/isdn/mISDN/socket.c

index 0d29b5a..99e5f97 100644 (file)
@@ -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) {