Re: [RFC] Some kernel changes

jaikumar Ganesh
2009-01-21T17:46:09Z

[-- Attachment #1: Type: text/plain, Size: 1766 bytes --]

Hi Marcel,

On Wed, Jan 21, 2009 at 3:19 AM, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Jaikumar,
>
>> >>>>> why do you wanna set AUTH_PENDING again. That is not needed we only
>> >>>>> wanna know once encryption comes back on. If no in time, then we just
>> >>>>> disconnect the link. That simple.
>> >>>>>
>> >>>>>> b) I also see that we are not clearing the timer and hence after
>> >>>>>> RFCOMM_AUTH_TIMEOUT period expires we bring down the RFCOMM connection
>> >>>>>> even though the encryption has been established.
>> >>>>>
>> >>>>> Good catch. Fixed it.
>> >>>>
>> >>>> Cool. Can you upload it to bluetooth-testing git ? I saw a related
>> >>>> problem while looking at the timer issue and wanted to see if the fix
>> >>>> takes care of it.
>> >>>
>> >>> I am in the process in doing so, but there are other important things
>> >>> that need to be done first.
>> >>
>> >> Sorry to push you on this, is this patch been uploaded ?
>> >
>> > since a few days now. Check the bluetooth-testing.git and it is even rebased
>> > against 2.6.29-rc2.
>> >
>> I applied the patches and I see that we actually don't pause the
>> RFCOMM tx traffic because we don't check on
>> the RFCOMM_SEC_PENDING flag when sending the tx packets in rfcomm_process_dlcs.
>> I verified this using the "attest" command - we keep sending RFCOMM
>> traffic even though encryption is off.
>>
>> Please look at the patch attached.
>>
>> Also should we drop the "rx" packets too when the encryption is dropped ?
>
> can you get me a version with a proper commit message. Just the subject
> is not gonna be good enough.
>

Sorry, its attached. Also like mentioned above the patch checks only
while sending tx packets ?
Should we drop "rx" packets also ?

> Regards
>
> Marcel
>
>
>

[-- Attachment #2: 0001-Bluetooth-When-encyption-is-dropped-do-not-send-RF.patch --]
[-- Type: application/octet-stream, Size: 1127 bytes --]

From e2ed1c106da9fe764924d662a9bb8b9ddad4914f Mon Sep 17 00:00:00 2001
From: Jaikumar Ganesh <jaikumar@google.com>
Date: Wed, 21 Jan 2009 09:42:01 -0800
Subject: [PATCH] Bluetooth: When encyption is dropped, do not send RFCOMM tx packets.

When encryption is dropped RFCOMM_SEC_PENDING flag gets set.
Check this flag before sending the tx packets.

Signed-off-by: Jaikumar Ganesh <jaikumar@google.com>
---
net/bluetooth/rfcomm/core.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index ae2ecaa..73ffc0c 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -1,4 +1,4 @@
-/*
+f*
RFCOMM implementation for Linux Bluetooth stack (BlueZ).
Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com>
Copyright (C) 2002 Marcel Holtmann <marcel@holtmann.org>
@@ -1754,6 +1754,9 @@ static inline void rfcomm_process_dlcs(struct rfcomm_session *s)
continue;
}

+ if (test_bit(RFCOMM_SEC_PENDING, &d->flags))
+ continue;
+
if (test_bit(RFCOMM_TX_THROTTLED, &s->flags))
continue;

--
1.5.4.5