summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-12-19 06:20:59 +0000
committerMarcel Holtmann <marcel@holtmann.org>2014-12-19 13:48:27 +0100
commit71bb99a02b32b4cc4265118e85f6035ca72923f0 (patch)
tree79c19bfc7537216f352e5ce7fda0a1a473d8dbf6 /net
parent96c26653ce65bf84f3212f8b00d4316c1efcbf4c (diff)
downloadblackbird-op-linux-71bb99a02b32b4cc4265118e85f6035ca72923f0.tar.gz
blackbird-op-linux-71bb99a02b32b4cc4265118e85f6035ca72923f0.zip
Bluetooth: bnep: bnep_add_connection() should verify that it's dealing with l2cap socket
same story as cmtp Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net')
-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);
OpenPOWER on IntegriCloud