public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Johan Hedberg <johan.hedberg@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: Security mode 3 pairing acceptor broken with current bluetooth-testing
Date: Fri, 08 May 2009 17:08:03 -0700	[thread overview]
Message-ID: <1241827683.4903.78.camel@localhost.localdomain> (raw)
In-Reply-To: <20090508234902.GA6615@jh-x301>

Hi Johan,

> I'm getting the following with latest bluetooth-testing kernel when
> accepting a connection when either device is in security mode 3:
> 
> $ hcidump -V -r secmode3-acp.dump
> HCI sniffer - Bluetooth packet analyzer ver 1.42
> btsnoop version: 1 datalink type: 1002
> > HCI Event: Connect Request (0x04) plen 10
>     bdaddr 00:24:7D:XX:XX:XX class 0x5a020c type ACL
> < HCI Command: Accept Connection Request (0x01|0x0009) plen 7
>     bdaddr 00:24:7D:XX:XX:XX role 0x00
>     Role: Master
> > HCI Event: Command Status (0x0f) plen 4
>     Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
> > HCI Event: Role Change (0x12) plen 8
>     status 0x00 bdaddr 00:24:7D:XX:XX:XX role 0x00
>     Role: Master
> > HCI Event: Link Key Request (0x17) plen 6
>     bdaddr 00:24:7D:XX:XX:XX
> < HCI Command: Link Key Request Negative Reply (0x01|0x000c) plen 6
>     bdaddr 00:24:7D:XX:XX:XX
> > HCI Event: Command Complete (0x0e) plen 10
>     Link Key Request Negative Reply (0x01|0x000c) ncmd 1
>     status 0x00 bdaddr 00:24:7D:XX:XX:XX
> > HCI Event: PIN Code Request (0x16) plen 6
>     bdaddr 00:24:7D:XX:XX:XX
> < HCI Command: Create Connection Cancel (0x01|0x0008) plen 6
>     bdaddr 00:24:7D:XX:XX:XX

what is the time between the PIN code request and the cancel command?

--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -171,7 +171,7 @@ static void hci_conn_timeout(unsigned long arg)
        switch (conn->state) {
        case BT_CONNECT:
        case BT_CONNECT2:
-               if (conn->type == ACL_LINK)
+               if (conn->type == ACL_LINK && conn->out)
                        hci_acl_connect_cancel(conn);
                else
                        hci_acl_disconn(conn, 0x13);

The above patch might fixes it. However without the timing between the
commands, I don't know what triggers it.

Regards

Marcel



  reply	other threads:[~2009-05-09  0:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-08 23:49 Security mode 3 pairing acceptor broken with current bluetooth-testing Johan Hedberg
2009-05-09  0:08 ` Marcel Holtmann [this message]
2009-05-09  8:59   ` Johan Hedberg
2009-05-09 16:53     ` Marcel Holtmann

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=1241827683.4903.78.camel@localhost.localdomain \
    --to=marcel@holtmann.org \
    --cc=johan.hedberg@gmail.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