From: Johan Hedberg <johan.hedberg@gmail.com>
To: Jaganath Kanakkassery <jaganath.k@samsung.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 2/2] Bluetooth: Fix authentication if acl data comes before remote feature evt
Date: Thu, 3 Jan 2013 16:00:26 +0200 [thread overview]
Message-ID: <20130103140026.GB18154@x220.ger.corp.intel.com> (raw)
In-Reply-To: <1357218329-21399-2-git-send-email-jaganath.k@samsung.com>
Hi Jaganath,
On Thu, Jan 03, 2013, Jaganath Kanakkassery wrote:
> If remote device sends l2cap info request before read_remote_ext_feature
> completes then mgmt_connected will be sent in hci_acldata_packet() and
> remote name request wont be sent and eventually authentication wont happen
>
> Hcidump log of the issue
>
> < HCI Command: Create Connection (0x01|0x0005) plen 13
> bdaddr BC:85:1F:74:7F:29 ptype 0xcc18 rswitch 0x01 clkoffset 0x4bf7 (valid)
> Packet type: DM1 DM3 DM5 DH1 DH3 DH5
> > HCI Event: Command Status (0x0f) plen 4
> Create Connection (0x01|0x0005) status 0x00 ncmd 1
> > HCI Event: Connect Complete (0x03) plen 11
> status 0x00 handle 12 bdaddr BC:85:1F:74:7F:29 type ACL encrypt 0x00
> < HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
> handle 12
> > HCI Event: Command Status (0x0f) plen 4
> Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1
> > HCI Event: Read Remote Supported Features (0x0b) plen 11
> status 0x00 handle 12
> Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
> > HCI Event: Max Slots Change (0x1b) plen 3
> handle 12 slots 5
> < HCI Command: Read Remote Extended Features (0x01|0x001c) plen 3
> handle 12 page 1
> > HCI Event: Command Status (0x0f) plen 4
> Read Remote Extended Features (0x01|0x001c) status 0x00 ncmd 1
> > ACL data: handle 12 flags 0x02 dlen 10
> L2CAP(s): Info req: type 2
> < ACL data: handle 12 flags 0x00 dlen 16
> L2CAP(s): Info rsp: type 2 result 0
> Extended feature mask 0x00b8
> Enhanced Retransmission mode
> Streaming mode
> FCS Option
> Fixed Channels
> > HCI Event: Read Remote Extended Features (0x23) plen 13
> status 0x00 handle 12 page 1 max 1
> Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> > ACL data: handle 12 flags 0x02 dlen 10
> L2CAP(s): Info req: type 3
> < ACL data: handle 12 flags 0x00 dlen 20
> L2CAP(s): Info rsp: type 3 result 0
> Fixed channel list 0x00000002
> L2CAP Signalling Channel
> > HCI Event: Number of Completed Packets (0x13) plen 5
> handle 12 packets 2
>
> Signed-off-by: Jaganath Kanakkassery <jaganath.k@samsung.com>
> ---
> net/bluetooth/hci_core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> index 596660d..c14def9 100644
> --- a/net/bluetooth/hci_core.c
> +++ b/net/bluetooth/hci_core.c
> @@ -2812,6 +2812,7 @@ static void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb)
>
> hci_dev_lock(hdev);
> if (test_bit(HCI_MGMT, &hdev->dev_flags) &&
> + !hci_outgoing_auth_needed(hdev, conn) &&
> !test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags))
> mgmt_device_connected(hdev, &conn->dst, conn->type,
> conn->dst_type, 0, NULL, 0,
I'm not completely sure if this is the right way or even the right place
to fix the issue. The reason why this if-clause is here is so that we
don't get a too late mgmt_connected event in case the remote device is
fast in sending an L2CAP Connect Request. Maybe if-clause needs to be
made L2CAP Connect request specific (and moved to an L2CAP specific
location) or then something added to the code path taken for the info
request?
Johan
next prev parent reply other threads:[~2013-01-03 14:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-03 13:05 [PATCH 1/2] Bluetooth: Move hci_outgoing_auth_needed() to hci_conn.c Jaganath Kanakkassery
2013-01-03 13:05 ` [PATCH 2/2] Bluetooth: Fix authentication if acl data comes before remote feature evt Jaganath Kanakkassery
2013-01-03 14:00 ` Johan Hedberg [this message]
2013-01-04 5:57 ` Jaganath Kanakkassery
2013-01-03 13:51 ` [PATCH 1/2] Bluetooth: Move hci_outgoing_auth_needed() to hci_conn.c Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130103140026.GB18154@x220.ger.corp.intel.com \
--to=johan.hedberg@gmail.com \
--cc=jaganath.k@samsung.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox