mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
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
1528eb776d
commit
0a2214f20a
1 changed files with 4 additions and 0 deletions
|
@ -50,6 +50,7 @@
|
|||
#include <asm/unaligned.h>
|
||||
|
||||
#include <net/bluetooth/bluetooth.h>
|
||||
#include <net/bluetooth/l2cap.h>
|
||||
#include <net/bluetooth/hci_core.h>
|
||||
#include <net/bluetooth/l2cap.h>
|
||||
|
||||
|
@ -565,6 +566,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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue