1
0
Fork 0

bluetooth: Validate socket address length in sco_sock_bind().

[ Upstream commit 5233252fce ]

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wifi-calibration
David S. Miller 2015-12-15 15:39:08 -05:00 committed by Greg Kroah-Hartman
parent 262ee9759e
commit 1814295365
1 changed files with 3 additions and 0 deletions

View File

@ -520,6 +520,9 @@ static int sco_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_le
if (!addr || addr->sa_family != AF_BLUETOOTH)
return -EINVAL;
if (addr_len < sizeof(struct sockaddr_sco))
return -EINVAL;
lock_sock(sk);
if (sk->sk_state != BT_OPEN) {