From: Emrah Demir Date: Fri, 8 Apr 2016 19:16:11 +0000 (+0300) Subject: mISDN: Fixing missing validation in base_sock_bind() X-Git-Tag: MMI-PSA29.97-13-9~8098^2~37 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b821646826e22f0491708768fccce58eef3f5704;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git mISDN: Fixing missing validation in base_sock_bind() Add validation code into mISDN/socket.c Signed-off-by: Emrah Demir Signed-off-by: David S. Miller --- diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c index 0d29b5a6356d..99e5f9751e8b 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) {