Skip to content

Commit

Permalink
Bluetooth: Don't check encryption for L2CAP raw sockets
Browse files Browse the repository at this point in the history
For L2CAP sockets with medium and high security requirement a missing
encryption will enforce the closing of the link. For the L2CAP raw
sockets this is not needed, so skip that check.

This fixes a crash when pairing Bluetooth 2.0 (and earlier) devices
since the L2CAP state machine got confused and then locked up the whole
system.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Marcel Holtmann committed Feb 27, 2009
1 parent 43c2e57 commit 255c760
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/bluetooth/l2cap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2420,6 +2420,9 @@ static int l2cap_disconn_ind(struct hci_conn *hcon, u8 reason)

static inline void l2cap_check_encryption(struct sock *sk, u8 encrypt)
{
if (sk->sk_type != SOCK_SEQPACKET)
return;

if (encrypt == 0x00) {
if (l2cap_pi(sk)->sec_level == BT_SECURITY_MEDIUM) {
l2cap_sock_clear_timer(sk);
Expand Down

0 comments on commit 255c760

Please sign in to comment.