diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-12-19 06:20:59 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-11 09:30:09 -0700 |
commit | f6237750acc4494cb28e174289d5d335313ff2ea (patch) | |
tree | ba0e9a95e8ec62f6cae9a031e1d97592e17fe4f2 /net/bluetooth/bnep | |
parent | 354ff8045083e3f4e2257bd51ca06deda7dac7d6 (diff) | |
download | linux-stable-f6237750acc4494cb28e174289d5d335313ff2ea.tar.gz linux-stable-f6237750acc4494cb28e174289d5d335313ff2ea.tar.bz2 linux-stable-f6237750acc4494cb28e174289d5d335313ff2ea.zip |
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/bnep')
-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) 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); |