Skip to content

Commit 71bb99a

Browse files
Al Viroholtmann
Al Viro
authored andcommitted
Bluetooth: bnep: bnep_add_connection() should verify that it's dealing with l2cap socket
same story as cmtp Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
1 parent 96c2665 commit 71bb99a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: net/bluetooth/bnep/core.c

+3
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,9 @@ int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock)
533533

534534
BT_DBG("");
535535

536+
if (!l2cap_is_socket(sock))
537+
return -EBADFD;
538+
536539
baswap((void *) dst, &l2cap_pi(sock->sk)->chan->dst);
537540
baswap((void *) src, &l2cap_pi(sock->sk)->chan->src);
538541

0 commit comments

Comments
 (0)