diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2009-02-04 15:07:19 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-02-27 00:14:36 -0500 |
commit | 255c76014af74165428e7aa16414b857e2bdccf2 (patch) | |
tree | 6c13e5413ce88e80780b02c80be00341db68cb78 /net/bluetooth | |
parent | 43c2e57f94c15744495fee564610aa24602b3824 (diff) |
Bluetooth: Don't check encryption for L2CAP raw sockets
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>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/l2cap.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 71a064fa0285..b677af671f31 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -2420,6 +2420,9 @@ static int l2cap_disconn_ind(struct hci_conn *hcon, u8 reason) | |||
2420 | 2420 | ||
2421 | static inline void l2cap_check_encryption(struct sock *sk, u8 encrypt) | 2421 | static inline void l2cap_check_encryption(struct sock *sk, u8 encrypt) |
2422 | { | 2422 | { |
2423 | if (sk->sk_type != SOCK_SEQPACKET) | ||
2424 | return; | ||
2425 | |||
2423 | if (encrypt == 0x00) { | 2426 | if (encrypt == 0x00) { |
2424 | if (l2cap_pi(sk)->sec_level == BT_SECURITY_MEDIUM) { | 2427 | if (l2cap_pi(sk)->sec_level == BT_SECURITY_MEDIUM) { |
2425 | l2cap_sock_clear_timer(sk); | 2428 | l2cap_sock_clear_timer(sk); |