diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-12-19 01:20:59 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-12-19 07:48:27 -0500 |
commit | 71bb99a02b32b4cc4265118e85f6035ca72923f0 (patch) | |
tree | 79c19bfc7537216f352e5ce7fda0a1a473d8dbf6 | |
parent | 96c26653ce65bf84f3212f8b00d4316c1efcbf4c (diff) |
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>
-rw-r--r-- | net/bluetooth/bnep/core.c | 3 |
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) | |||
533 | 533 | ||
534 | BT_DBG(""); | 534 | BT_DBG(""); |
535 | 535 | ||
536 | if (!l2cap_is_socket(sock)) | ||
537 | return -EBADFD; | ||
538 | |||
536 | baswap((void *) dst, &l2cap_pi(sock->sk)->chan->dst); | 539 | baswap((void *) dst, &l2cap_pi(sock->sk)->chan->dst); |
537 | baswap((void *) src, &l2cap_pi(sock->sk)->chan->src); | 540 | baswap((void *) src, &l2cap_pi(sock->sk)->chan->src); |
538 | 541 | ||