summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-12-19 06:20:59 +0000
committerWilly Tarreau <w@1wt.eu>2017-11-01 22:12:41 +0100
commitb8d57eb2f414876510ffffa88105a9d4f350f575 (patch)
treea67ffd4a37af06246ea74ef3db0020def93ed693
parent69ddef7b41fdad8123a9a4a6eb2a1aa57aafc92b (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>
-rw-r--r--net/bluetooth/bnep/core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
index e430b1abcd2f..e387e6719fa2 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);