public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [bluez/bluez] b4e372: device: Limit the number of retries on auth failures
@ 2025-12-05 23:56 Andrey Smirnov
  0 siblings, 0 replies; only message in thread
From: Andrey Smirnov @ 2025-12-05 23:56 UTC (permalink / raw)
  To: linux-bluetooth

  Branch: refs/heads/1031011
  Home:   https://github.com/bluez/bluez
  Commit: b4e3727aa6f53a993cbd0191372ac89e0307d49e
      https://github.com/bluez/bluez/commit/b4e3727aa6f53a993cbd0191372ac89e0307d49e
  Author: Andrey Smirnov <andrew.smirnov@gmail.com>
  Date:   2025-12-05 (Fri, 05 Dec 2025)

  Changed paths:
    M src/device.c

  Log Message:
  -----------
  device: Limit the number of retries on auth failures

Currently BlueZ has no retry limit on reconnection attempts in case of
authentication failures. This leads to a very unpleasant user
experince with, for example, XBox controller. The scenario is as
follows:

1. Host A is running BlueZ and XBox controller is paired and connected
   to it.
2. Host A shuts down (for example)
3. XBox controller is put into pairing mode and is paired to a Host B
4. Host B is powered down
5. Host A is powered on
6. XBox controller is powered on
7. Host A/BlueZ will start spamming XBox controller with connection
   attempts in an endless loop

What happens under the hood is:

1. BlueZ starts up, sees that there's LTK saved for XBox controller,
   so it adds it to kernels autoconnect list
2. Once XBox controller is on and advertising, kernel connects to it
3. BlueZ tries to elevate the security level, but is rejected by the
   controller with "Key or PIN missing" because the controller is already
   paired to another host.
4. Controller disconnects, controller goes back to advertising, goto 2

To avoid this, let's add a simple auth failure counter and disable
autoconnect for the device once we go past the failure
threshold. Let's also implement an expoenential backoff in our retry
logic to avoid blasting our retires in a single burst.

Cc: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>



To unsubscribe from these emails, change your notification settings at https://github.com/bluez/bluez/settings/notifications

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-12-05 23:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-05 23:56 [bluez/bluez] b4e372: device: Limit the number of retries on auth failures Andrey Smirnov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox