summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-12-15 21:39:08 +0100
committerDavid S. Miller <davem@davemloft.net>2015-12-15 21:39:08 +0100
commit5233252fce714053f0151680933571a2da9cbfb4 (patch)
tree6e9fc25f2484e14db4f241f49965d865188ef146
parentnet_sched: make qdisc_tree_decrease_qlen() work for non mq (diff)
downloadlinux-5233252fce714053f0151680933571a2da9cbfb4.tar.xz
linux-5233252fce714053f0151680933571a2da9cbfb4.zip
bluetooth: Validate socket address length in sco_sock_bind().
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/bluetooth/sco.c3
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) {