fix(nordic/ble): fix connection parameters update while connected
What changed, and why it matters
This commit fixes how the Trezor Bluetooth Low Energy (BLE) connection updates its speed settings. Previously, changing speed mode while already connected did not actually apply the new connection parameters to the live connection. The change centralizes the update logic and ensures that switching between high and low speed modes immediately requests the new parameters from the connected peer. There is no direct evidence in the commit that this is a security vulnerability, but an incorrect or stale BLE connection interval could affect responsiveness, power usage, or potentially create a small window of unexpected behavior.
Treat as a routine functional/robustness fix. Review whether stale connection parameters could have caused any denial-of-service or pairing/encryption edge cases in the BLE stack, but no immediate security response is indicated by the diff alone.
Security signals we found
Bluetooth LE connection parameter update logic changed
State flag change now propagated to active connection
No explicit security framing in commit message or diff
No input validation or bounds-checking changes visible
Evidence from the diff
The patch refactors connection.c in the Nordic BLE stack for Trezor. It introduces a helper connection_update_params() that retrieves the current bt_conn, selects the correct PPCP_HIGH_SPEED or PPCP_LOW_SPEED parameter based on high_speed_requested, and calls bt_conn_le_param_update(). This helper is now used in connected(), connection_resume(), and newly in connection_set_high_speed() and connection_set_low_speed(). Before this change, connection_set_high_speed() and connection_set_low_speed() only toggled the flag without applying the new parameters to an active connection. The commit message frames this as a functional bug fix (‘fix connection parameters update while connected’) and includes ‘[no changelog]’.
Changed components
nordic/trezor/trezor-ble/src/ble/connection.cTrezor BLE connection managementNordic Zephyr bt_conn_le_param_update usageInspect captured patch +21 / −14
diff --git a/nordic/trezor/trezor-ble/src/ble/connection.c b/nordic/trezor/trezor-ble/src/ble/connection.c
index 6f8683efb..7121aa4fc 100644
--- a/nordic/trezor/trezor-ble/src/ble/connection.c
+++ b/nordic/trezor/trezor-ble/src/ble/connection.c
@@ -62,6 +62,15 @@ static void le_param_updated(struct bt_conn *conn, uint16_t interval,
interval_ms, (interval * 125) % 100, latency, timeout_ms);
}
+static void connection_update_params(void) {
+ struct bt_conn *conn = connection_get_current();
+ if (conn != NULL) {
+ const struct bt_le_conn_param *param =
+ high_speed_requested ? PPCP_HIGH_SPEED : PPCP_LOW_SPEED;
+ bt_conn_le_param_update(conn, param);
+ }
+}
+
void connected(struct bt_conn *conn, uint8_t err) {
char addr[BT_ADDR_LE_STR_LEN];
@@ -72,9 +81,7 @@ void connected(struct bt_conn *conn, uint8_t err) {
show_params(conn);
- const struct bt_le_conn_param *param =
- high_speed_requested ? PPCP_HIGH_SPEED : PPCP_LOW_SPEED;
- bt_conn_le_param_update(conn, param);
+ connection_update_params();
// Prefer 2M both directions; 0 options = no specific constraints
// const struct bt_conn_le_phy_param phy_2m = {
@@ -182,20 +189,20 @@ void connection_suspend(void) {
}
}
-void connection_resume(void) {
- struct bt_conn *conn = connection_get_current();
-
- if (conn != NULL) {
- const struct bt_le_conn_param *param =
- high_speed_requested ? PPCP_HIGH_SPEED : PPCP_LOW_SPEED;
- bt_conn_le_param_update(conn, param);
- }
-}
+void connection_resume(void) { connection_update_params(); }
bool connection_is_bonded(void) { return bonded_connection; }
bool connection_is_high_speed(void) { return high_speed_requested; }
-void connection_set_high_speed(void) { high_speed_requested = true; }
+void connection_set_high_speed(void) {
+ high_speed_requested = true;
+
+ connection_update_params();
+}
-void connection_set_low_speed(void) { high_speed_requested = false; }
+void connection_set_low_speed(void) {
+ high_speed_requested = false;
+
+ connection_update_params();
+}
Why this scored 27/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.