diff options
author | David S. Miller <davem@davemloft.net> | 2015-12-15 20:39:08 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-12-15 20:39:08 (GMT) |
commit | 5233252fce714053f0151680933571a2da9cbfb4 (patch) | |
tree | 6e9fc25f2484e14db4f241f49965d865188ef146 | |
parent | 225734de70cd0a9e0b978f3583a4a87939271d5e (diff) | |
download | linux-5233252fce714053f0151680933571a2da9cbfb4.tar.xz |
bluetooth: Validate socket address length in sco_sock_bind().
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/bluetooth/sco.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index fe12966..f52bcbf 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c @@ -526,6 +526,9 @@ static int sco_sock_bind(struct socket *sock, struct sockaddr *addr, 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) { |