linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: Howard Chung <howardchung@google.com>,
	Bluez mailing list <linux-bluetooth@vger.kernel.org>,
	ChromeOS Bluetooth Upstreaming 
	<chromeos-bluetooth-upstreaming@chromium.org>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [Bluez PATCH v3] bluetooth: secure bluetooth stack from bluedump attack
Date: Wed, 12 Feb 2020 17:37:53 +0200	[thread overview]
Message-ID: <86D0ACD5-BEF7-45B3-B621-BA2E457AB57B@gmail.com> (raw)
In-Reply-To: <89D0B633-381D-4700-AB33-5F803BCB6E94@holtmann.org>

Hi Marcel,

On 12. Feb 2020, at 17.19, Marcel Holtmann <marcel@holtmann.org> wrote:
>> +		key = hci_find_ltk(hcon->hdev, &hcon->dst, hcon->dst_type,
>> +				   hcon->role);
>> +
>> +		/* If there already exists link key in local host, leave the
>> +		 * decision to user space since the remote device could be
>> +		 * legitimate or malicious.
>> +		 */
>> +		if (smp->method == JUST_WORKS && key) {
>> +			err = mgmt_user_confirm_request(hcon->hdev, &hcon->dst,
>> +							hcon->type,
>> +							hcon->dst_type, passkey,
>> +							1);
>> +			if (err)
>> +				return SMP_UNSPECIFIED;
>> +			set_bit(SMP_FLAG_WAIT_USER, &smp->flags);
>> +		}
>> 	}
> 
> while this looks good, I like to optimize this to only look up the LTK when needed.
> 
> 	/* comment here */
> 	if (smp->method != JUST_WORKS)
> 		goto mackey_and_ltk;
> 
> 
> 	/* and command here */
> 	if (hci_find_ltk()) {
> 		mgmt_user_confirm_request()
> 		..
> 	}
> 
> And my preference that we also get an Ack from Johan or Luiz that double checked that this is fine.

Acked-by: Johan Hedberg <johan.hedberg@intel.com>

Johan

  reply	other threads:[~2020-02-12 15:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-12 13:23 [Bluez PATCH v3] bluetooth: secure bluetooth stack from bluedump attack Howard Chung
2020-02-12 15:19 ` Marcel Holtmann
2020-02-12 15:37   ` Johan Hedberg [this message]
2020-02-12 21:29     ` Luiz Augusto von Dentz

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=86D0ACD5-BEF7-45B3-B621-BA2E457AB57B@gmail.com \
    --to=johan.hedberg@gmail.com \
    --cc=chromeos-bluetooth-upstreaming@chromium.org \
    --cc=davem@davemloft.net \
    --cc=howardchung@google.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=netdev@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;
as well as URLs for NNTP newsgroup(s).