Skip to content

Commit 5233252

Browse files
committed
bluetooth: Validate socket address length in sco_sock_bind().
Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 225734d commit 5233252

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: net/bluetooth/sco.c

+3
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,9 @@ static int sco_sock_bind(struct socket *sock, struct sockaddr *addr,
526526
if (!addr || addr->sa_family != AF_BLUETOOTH)
527527
return -EINVAL;
528528

529+
if (addr_len < sizeof(struct sockaddr_sco))
530+
return -EINVAL;
531+
529532
lock_sock(sk);
530533

531534
if (sk->sk_state != BT_OPEN) {

0 commit comments

Comments
 (0)