summaryrefslogtreecommitdiff
path: root/net/bluetooth
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-12-19 09:20:59 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-08-11 19:30:09 +0300
commitf6237750acc4494cb28e174289d5d335313ff2ea (patch)
treeba0e9a95e8ec62f6cae9a031e1d97592e17fe4f2 /net/bluetooth
parent354ff8045083e3f4e2257bd51ca06deda7dac7d6 (diff)
downloadlinux-f6237750acc4494cb28e174289d5d335313ff2ea.tar.xz
Bluetooth: bnep: bnep_add_connection() should verify that it's dealing with l2cap socket
commit 71bb99a02b32b4cc4265118e85f6035ca72923f0 upstream. same story as cmtp Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/bnep/core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
index 85bcc21e84d2..ce82722d049b 100644
--- a/net/bluetooth/bnep/core.c
+++ b/net/bluetooth/bnep/core.c
@@ -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);