Skip to contentSkip to conversation

Bluetooth: Fix initial RFCOMM DLC security level

PATCH In review [email protected] 3 participants 3 messages Dec 6, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: Fix initial RFCOMM DLC security level

From: Johan Hedberg <[email protected]>

Due to commit 63ce0900 connections initiated through TTYs created with "rfcomm bind ..." would have security level BT_SECURITY_SDP instead of BT_SECURITY_LOW. This would cause instant connection failure between any two SSP capable devices due to the L2CAP connect request to RFCOMM being sent before authentication has been performed. This patch fixes the regression by always initializing the DLC security level to BT_SECURITY_LOW.

---
 net/bluetooth/rfcomm/core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
net/bluetooth/rfcomm/core.c +1 -0
index fa642aa..432a9a6 100644
@@ -311,6 +311,7 @@ static void rfcomm_dlc_clear_state(struct rfcomm_dlc *d)
 	d->state      = BT_OPEN;
 	d->flags      = 0;
 	d->mscex      = 0;
+	d->sec_level  = BT_SECURITY_LOW;
 	d->mtu        = RFCOMM_DEFAULT_MTU;
 	d->v24_sig    = RFCOMM_V24_RTC | RFCOMM_V24_RTR | RFCOMM_V24_DV;
 
Signature · 1 line
1.7.1
maintainer Acked-by on v1 1/1
#1 lore raw

Hi,

Quoted 20 lines · On Mon, Dec 6, 2010 at 3:56 PM, <[email protected]> wrote:

From: Johan Hedberg <[email protected]>

Due to commit 63ce0900 connections initiated through TTYs created with "rfcomm bind ..." would have security level BT_SECURITY_SDP instead of BT_SECURITY_LOW. This would cause instant connection failure between any two SSP capable devices due to the L2CAP connect request to RFCOMM being sent before authentication has been performed. This patch fixes the regression by always initializing the DLC security level to BT_SECURITY_LOW.

---
 net/bluetooth/rfcomm/core.c |    1 +

 1 files changed, 1 insertions(+), 0 deletions(-)
net/bluetooth/rfcomm/core.c +0 -0
index fa642aa..432a9a6 100644

net/bluetooth/rfcomm/core.c static void rfcomm_dlc_clear_state(struct rfcomm_dlc *d) · line 317

Quoted 7 lines
net/bluetooth/rfcomm/core.c +1 -0
@@ -311,6 +311,7 @@ static void rfcomm_dlc_clear_state(struct rfcomm_dlc *d)
        d->state      = BT_OPEN;
        d->flags      = 0;
        d->mscex      = 0;
+       d->sec_level  = BT_SECURITY_LOW;
        d->mtu        = RFCOMM_DEFAULT_MTU;
        d->v24_sig    = RFCOMM_V24_RTC | RFCOMM_V24_RTR | RFCOMM_V24_DV;
 

Nice catch, I completely forgot to check if tty initialize sec_level with anything.

Signature · 2 lines
Luiz Augusto von Dentz
Computer Engineer
#2 lore raw
In reply to [email protected]

Hi Johan,

Quoted 11 lines · * [email protected] <[email protected]> [2010-12-06 15:56:17 +0200]:

From: Johan Hedberg <[email protected]>

Due to commit 63ce0900 connections initiated through TTYs created with "rfcomm bind ..." would have security level BT_SECURITY_SDP instead of BT_SECURITY_LOW. This would cause instant connection failure between any two SSP capable devices due to the L2CAP connect request to RFCOMM being sent before authentication has been performed. This patch fixes the regression by always initializing the DLC security level to BT_SECURITY_LOW.

Patch has been applied to bluetooth-2.6, thanks.

Signature · 2 lines
Gustavo F. Padovan
http://profusion.mobi