]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
Bluetooth: bnep: bnep_add_connection() should verify that it's dealing with l2cap...
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 19 Dec 2014 06:20:59 +0000 (06:20 +0000)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 19 Dec 2014 12:48:27 +0000 (13:48 +0100)
same story as cmtp

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/bnep/core.c

index 85bcc21e84d2006c4839b2b7f409f2595cb41858..ce82722d049b7c013fd06f66f726fbbf75a01f56 100644 (file)
@@ -533,6 +533,9 @@ int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock)
 
        BT_DBG("");
 
+       if (!l2cap_is_socket(sock))
+               return -EBADFD;
+
        baswap((void *) dst, &l2cap_pi(sock->sk)->chan->dst);
        baswap((void *) src, &l2cap_pi(sock->sk)->chan->src);