Re: [PATCH] Bluetooth: Fix L2CAP security check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, Jun 13, 2011 at 9:24 PM, Ilia, Kolominsky <iliak@xxxxxx> wrote:
>
>> -----Original Message-----
>> From: linux-bluetooth-owner@xxxxxxxxxxxxxxx [mailto:linux-bluetooth-
>> owner@xxxxxxxxxxxxxxx] On Behalf Of Luiz Augusto von Dentz
>> Sent: Friday, June 10, 2011 9:50 AM
>> To: linux-bluetooth@xxxxxxxxxxxxxxx
>> Subject: [PATCH] Bluetooth: Fix L2CAP security check
>>
>> From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
>>
>> With older userspace versions (using hciops) it might not have the
>> key type to check if the key has sufficient security for any security
>> level so it is necessary to check the return of hci_conn_auth to make
>> sure the connection is authenticated
>>
>> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
>> Acked-by: Johan Hedberg <johan.hedberg@xxxxxxxxx>
>> ---
>>  net/bluetooth/hci_conn.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
>> index 3163330..efda44c 100644
>> --- a/net/bluetooth/hci_conn.c
>> +++ b/net/bluetooth/hci_conn.c
>> @@ -611,8 +611,8 @@ auth:
>>       if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend))
>>               return 0;
>>
>> -     hci_conn_auth(conn, sec_level, auth_type);
>> -     return 0;
>> +     if (!(hci_conn_auth(conn, sec_level, auth_type)))
>> +             return 0;
>>
>>  encrypt:
>>       if (conn->link_mode & HCI_LM_ENCRYPT)
>> --
>> 1.7.5.2
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-
>> bluetooth" in
>> the body of a message to majordomo@xxxxxxxxxxxxxxx
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> I have also come upon this bug - the unconditional "return 0"
> broke connection establishment of A2DP streams both in android
> and PTS tests. I think it is better to apply it ASAP.
> Regards.


I will send a v2 removing the extra parenthesis in a moment.

-- 
Luiz Augusto von Dentz
Computer Engineer
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux