Commit 5684f290 authored by Marcel Holtmann's avatar Marcel Holtmann

[Bluetooth] Use type of the parent socket

The SELinux fixes for kernel sockets assume that we always use the type
SOCK_SEQPACKET, but this must not be the truth. Give the sock->type
as argument to sock_create_lite() and everything is correct for the new
child socket.
parent 7cf130fd
......@@ -158,8 +158,7 @@ static int rfcomm_l2sock_create(struct socket **sock)
BT_DBG("");
err = sock_create_kern(PF_BLUETOOTH, SOCK_SEQPACKET,
BTPROTO_L2CAP, sock);
err = sock_create_kern(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP, sock);
if (!err) {
struct sock *sk = (*sock)->sk;
sk->sk_data_ready = rfcomm_l2data_ready;
......@@ -1642,9 +1641,9 @@ static inline void rfcomm_accept_connection(struct rfcomm_session *s)
BT_DBG("session %p", s);
if (sock_create_lite(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP, &nsock))
if (sock_create_lite(PF_BLUETOOTH, sock->type, BTPROTO_L2CAP, &nsock))
return;
nsock->ops = sock->ops;
__module_get(nsock->ops->owner);
......
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