Commit f6237750 authored by Al Viro's avatar Al Viro Committed by Greg Kroah-Hartman

Bluetooth: bnep: bnep_add_connection() should verify that it's dealing with l2cap socket

commit 71bb99a0 upstream.

same story as cmtp
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 354ff804
...@@ -533,6 +533,9 @@ int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock) ...@@ -533,6 +533,9 @@ int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock)
BT_DBG(""); BT_DBG("");
if (!l2cap_is_socket(sock))
return -EBADFD;
baswap((void *) dst, &l2cap_pi(sock->sk)->chan->dst); baswap((void *) dst, &l2cap_pi(sock->sk)->chan->dst);
baswap((void *) src, &l2cap_pi(sock->sk)->chan->src); baswap((void *) src, &l2cap_pi(sock->sk)->chan->src);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment