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-Tag: v2.6.32.70~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba76e37468ac7158282460b06c03bbe71174ce8e;p=thirdparty%2Fkernel%2Fstable.git bluetooth: Validate socket address length in sco_sock_bind(). commit 5233252fce714053f0151680933571a2da9cbfb4 upstream. Signed-off-by: David S. Miller Signed-off-by: Ben Hutchings Signed-off-by: Willy Tarreau --- diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index e52443ce4f9c2..735b5fb8e2044 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c @@ -463,6 +463,9 @@ static int sco_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_le 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) {