Skip to content

Commit d00ef24

Browse files
Johan HedbergGustavo F. Padovan
authored andcommitted
Bluetooth: Fix authentication request for L2CAP raw sockets
When there is an existing connection l2cap_check_security needs to be called to ensure that the security level of the new socket is fulfilled. Normally l2cap_do_start takes care of this, but that function doesn't get called for SOCK_RAW type sockets. This patch adds the necessary l2cap_check_security call to the appropriate branch in l2cap_do_connect. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
1 parent 8556edd commit d00ef24

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/bluetooth/l2cap.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,8 @@ static int l2cap_do_connect(struct sock *sk)
11061106
if (sk->sk_type != SOCK_SEQPACKET &&
11071107
sk->sk_type != SOCK_STREAM) {
11081108
l2cap_sock_clear_timer(sk);
1109-
sk->sk_state = BT_CONNECTED;
1109+
if (l2cap_check_security(sk))
1110+
sk->sk_state = BT_CONNECTED;
11101111
} else
11111112
l2cap_do_start(sk);
11121113
}

0 commit comments

Comments
 (0)