diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2014-12-19 06:20:59 +0000 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2017-11-06 15:17:38 +0100 |
| commit | 1beb8475b291ea7f295ab5f21f98c04a1adffb60 (patch) | |
| tree | fc53761d146fca2aae2082d8f1dc1925d65ef274 /net/bluetooth | |
| parent | cf9932e5076a92074c1ced41d4e6879003080175 (diff) | |
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: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'net/bluetooth')
| -rw-r--r-- | net/bluetooth/bnep/core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c index e430b1abc..e387e6719 100644 --- a/net/bluetooth/bnep/core.c +++ b/net/bluetooth/bnep/core.c @@ -32,6 +32,7 @@ #include <asm/unaligned.h> #include <net/bluetooth/bluetooth.h> +#include <net/bluetooth/l2cap.h> #include <net/bluetooth/hci_core.h> #include "bnep.h" @@ -539,6 +540,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, &bt_sk(sock->sk)->dst); baswap((void *) src, &bt_sk(sock->sk)->src); |
