Skip to content

Commit

Permalink
bluetooth: Validate socket address length in sco_sock_bind().
Browse files Browse the repository at this point in the history
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
davem330 committed Dec 15, 2015
1 parent 225734d commit 5233252
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/bluetooth/sco.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5233252

Please sign in to comment.