提交 51bda2bc 编写于 作者: A Al Viro 提交者: Marcel Holtmann

Bluetooth: hidp_connection_add() unsafe use of l2cap_pi()

it's OK after we'd verified the sockets, but not before that.
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 004fa5ed
......@@ -1314,13 +1314,14 @@ int hidp_connection_add(struct hidp_connadd_req *req,
{
struct hidp_session *session;
struct l2cap_conn *conn;
struct l2cap_chan *chan = l2cap_pi(ctrl_sock->sk)->chan;
struct l2cap_chan *chan;
int ret;
ret = hidp_verify_sockets(ctrl_sock, intr_sock);
if (ret)
return ret;
chan = l2cap_pi(ctrl_sock->sk)->chan;
conn = NULL;
l2cap_chan_lock(chan);
if (chan->conn)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册