Skip to content

Commit

Permalink
Bluetooth: bnep: bnep_add_connection() should verify that it's dealin…
Browse files Browse the repository at this point in the history
…g with l2cap socket

same story as cmtp

Bug: 33982955
Change-Id: I60ce3e3b5a5a0e41ddaec155a0c6a46307eedeb7
Signed-off-by: Al Viro <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
Signed-off-by: Francisco Franco <[email protected]>
  • Loading branch information
Al Viro authored and franciscofranco committed May 11, 2018
1 parent 73f7063 commit b6a1402
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/bluetooth/bnep/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit b6a1402

Please sign in to comment.