From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ v2 5/5] device: Elevate bt_att security if bonding is in progress
Date: Wed, 26 Mar 2025 15:31:33 -0400 [thread overview]
Message-ID: <20250326193133.2718934-5-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20250326193133.2718934-1-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
When bonding is in progress it means Device.Pair has been called thus
the user indicated the intend to pair/bond from the start so the
security of bt_att shall be set in order for it to wait until pairing
process complete before attempting to proceed with GATT discovery and
any other traffic.
Fixes: https://github.com/bluez/bluez/issues/1125
---
src/device.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/device.c b/src/device.c
index 034491b59d30..057d116be6fc 100644
--- a/src/device.c
+++ b/src/device.c
@@ -5797,6 +5797,11 @@ static void gatt_client_init(struct btd_device *device)
if (btd_opts.gatt_channels > 1)
features |= BT_GATT_CHRC_CLI_FEAT_EATT;
+ if (device->bonding) {
+ DBG("Elevating security level since bonding is in progress");
+ bt_att_set_security(device->att, BT_ATT_SECURITY_MEDIUM);
+ }
+
device->client = bt_gatt_client_new(device->db, device->att,
device->att_mtu, features);
if (!device->client) {
--
2.48.1
next prev parent reply other threads:[~2025-03-26 19:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-26 19:31 [PATCH BlueZ v2 1/5] device: Attempt to elevate security on Pair while connected Luiz Augusto von Dentz
2025-03-26 19:31 ` [PATCH BlueZ v2 2/5] device: Make Connect and Pair mutually exclusive Luiz Augusto von Dentz
2025-03-26 19:31 ` [PATCH BlueZ v2 3/5] device: Use btd_device_is_initiator instead of Connect message Luiz Augusto von Dentz
2025-03-26 19:31 ` [PATCH BlueZ v2 4/5] shared/att: Make bt_att_set_security never downgrade security level Luiz Augusto von Dentz
2025-03-26 19:31 ` Luiz Augusto von Dentz [this message]
2025-03-26 20:31 ` [BlueZ,v2,1/5] device: Attempt to elevate security on Pair while connected bluez.test.bot
2025-03-27 16:10 ` [PATCH BlueZ v2 1/5] " patchwork-bot+bluetooth
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=20250326193133.2718934-5-luiz.dentz@gmail.com \
--to=luiz.dentz@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.