Bluetooth: bnep: bnep_add_connection() should verify that it's dealing with l2cap socket
same story as cmtp Bug: 33982955 Change-Id: I60ce3e3b5a5a0e41ddaec155a0c6a46307eedeb7 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
872f98667e
commit
2c589c8338
|
@ -50,8 +50,8 @@
|
||||||
#include <asm/unaligned.h>
|
#include <asm/unaligned.h>
|
||||||
|
|
||||||
#include <net/bluetooth/bluetooth.h>
|
#include <net/bluetooth/bluetooth.h>
|
||||||
#include <net/bluetooth/hci_core.h>
|
|
||||||
#include <net/bluetooth/l2cap.h>
|
#include <net/bluetooth/l2cap.h>
|
||||||
|
#include <net/bluetooth/hci_core.h>
|
||||||
|
|
||||||
#include "bnep.h"
|
#include "bnep.h"
|
||||||
|
|
||||||
|
@ -563,6 +563,9 @@ int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock)
|
||||||
u8 dst[ETH_ALEN], src[ETH_ALEN];
|
u8 dst[ETH_ALEN], src[ETH_ALEN];
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
if (!l2cap_is_socket(sock))
|
||||||
|
return -EBADFD;
|
||||||
|
|
||||||
BT_DBG("");
|
BT_DBG("");
|
||||||
|
|
||||||
baswap((void *) dst, &bt_sk(sock->sk)->dst);
|
baswap((void *) dst, &bt_sk(sock->sk)->dst);
|
||||||
|
|
Loading…
Reference in New Issue