mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-10-01 01:35:54 -04:00
28 lines
776 B
Diff
28 lines
776 B
Diff
From 5233252fce714053f0151680933571a2da9cbfb4 Mon Sep 17 00:00:00 2001
|
|
From: "David S. Miller" <davem@davemloft.net>
|
|
Date: Tue, 15 Dec 2015 15:39:08 -0500
|
|
Subject: bluetooth: Validate socket address length in sco_sock_bind().
|
|
|
|
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
---
|
|
net/bluetooth/sco.c | 3 +++
|
|
1 file changed, 3 insertions(+)
|
|
|
|
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) {
|
|
--
|
|
cgit v1.1
|
|
|