From: Brandon Williams <turbine.bmw@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Marcel Holtmann <marcel@holtmann.org>,
Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
linux-kernel@vger.kernel.org,
Brandon Williams <turbine.bmw@gmail.com>
Subject: [PATCH 1/2] Bluetooth: SMP: ignore an all-zero IRK
Date: Sat, 24 Oct 2026 07:24:34 -0400 [thread overview]
Message-ID: <20261024112435.247650-2-turbine.bmw@gmail.com> (raw)
In-Reply-To: <20261024112435.247650-1-turbine.bmw@gmail.com>
An all-zero Identity Resolving Key "indicates that a device does not
have a valid resolvable private address" (Core Specification, Vol 3,
Part H, 3.6.4), and a controller given an all-zero peer IRK in its
resolving list accepts only the peer's identity address (Vol 6, Part B,
4.7).
smp_cmd_ident_addr_info() stores such a key like any other, and
hci_find_irk_by_rpa() then resolves addresses against it in the host.
As the key is known to everyone, any device can generate resolvable
private addresses that the host reports as the bonded peer.
Treat an all-zero IRK as if no identity key had been distributed: do
not store it, and keep the peer's other keys under its connection
address.
Assisted-by: LLM
Signed-off-by: Brandon Williams <turbine.bmw@gmail.com>
---
net/bluetooth/smp.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 984b2d0b5e3e..fc75cf568471 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -2624,6 +2624,16 @@ static int smp_cmd_ident_addr_info(struct l2cap_conn *conn,
goto distribute;
}
+ /* An all-zero IRK means the peer has no resolvable private address
+ * (Core Specification, Vol 3, Part H, 3.6.4). The key is known to
+ * everyone, so storing it would let any device pose as this peer
+ * with resolvable private addresses generated from it.
+ */
+ if (!memchr_inv(smp->irk, 0, sizeof(smp->irk))) {
+ bt_dev_dbg(hcon->hdev, "ignoring all-zero IRK");
+ goto distribute;
+ }
+
bacpy(&smp->id_addr, &info->bdaddr);
smp->id_addr_type = info->addr_type;
--
2.56.0
next prev parent reply other threads:[~2026-10-24 11:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-24 11:24 [PATCH 0/2] Bluetooth: SMP: distribute the identity address when bonding Brandon Williams
2026-10-24 11:24 ` Brandon Williams [this message]
2026-10-24 11:24 ` [PATCH 2/2] " Brandon Williams
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=20261024112435.247650-2-turbine.bmw@gmail.com \
--to=turbine.bmw@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.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
all inboxes | Powered by JetHome®