From: Andrey Smirnov <noreply@github.com>
To: linux-bluetooth@vger.kernel.org
Subject: [bluez/bluez] b4e372: device: Limit the number of retries on auth failures
Date: Fri, 05 Dec 2025 23:56:31 +0000 (UTC) [thread overview]
Message-ID: <bluez/bluez/push/refs/heads/1031011/000000-b4e372@github.com> (raw)
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
reply other threads:[~2025-12-05 23:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=bluez/bluez/push/refs/heads/1031011/000000-b4e372@github.com \
--to=noreply@github.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