From: David S. Miller Date: Tue, 15 Dec 2015 20:39:08 +0000 (-0500) Subject: bluetooth: Validate socket address length in sco_sock_bind(). X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5233252fce714053f0151680933571a2da9cbfb4;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git bluetooth: Validate socket address length in sco_sock_bind(). Signed-off-by: David S. Miller --- 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) {