diff options
author | David S. Miller <davem@davemloft.net> | 2015-12-15 15:39:08 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-12-15 15:39:08 -0500 |
commit | 5233252fce714053f0151680933571a2da9cbfb4 (patch) | |
tree | 6e9fc25f2484e14db4f241f49965d865188ef146 /net/bluetooth | |
parent | 225734de70cd0a9e0b978f3583a4a87939271d5e (diff) | |
download | linux-5233252fce714053f0151680933571a2da9cbfb4.tar.gz linux-5233252fce714053f0151680933571a2da9cbfb4.tar.bz2 linux-5233252fce714053f0151680933571a2da9cbfb4.zip |
bluetooth: Validate socket address length in sco_sock_bind().
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bluetooth')
-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 fe129663bd3f..f52bcbf2e58c 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) { |