Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ v6 00/18] Channel Sounding and RAP fixes
@ 2026-11-24 15:38 Luiz Augusto von Dentz
  2026-11-24 15:38 ` [PATCH BlueZ v6 01/18] gatt-database: Drop stale device state for removed bonds Luiz Augusto von Dentz
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: Luiz Augusto von Dentz @ 2026-11-24 15:38 UTC (permalink / raw)
  To: linux-bluetooth

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

This series fixes the Ranging Profile Requester and Reflector setup
and RAS server issues found while running the RAP and RAS PTS tests
(Channel Sounding with a Reflector, peer-created configurations,
Ranging Data subscriptions, per-connection Ranging Counters), plus a
GATT database CCC state leak and a use-after-free in bluetoothctl.

v6:
- profiles/ranging: process the report of a disable sent before a restart
  before the state guard of Procedure Enable Complete, so it is not left
  to swallow the next session's.
- profiles/ranging: keep a deferred procedure setup across
  StartMeasurement() instead of discarding it.
- shared/rap: remember an explicit mode selection only once it took
  effect.
- shared/rap: make only the missing On-demand registrations when
  subscribing again, so a retry does not register the others twice.
- unit/test-rap: tests for both.

v5:
- profiles/ranging: do not keep the STARTED state of a session whose
  disable is still outstanding when StartMeasurement() is called, so the
  new setup creates its configuration.
- shared/rap: subscribe a selected, non-disabled mode again on the next
  start when its subscription ended or was rejected.
- unit/test-rap: add a test for re-subscribing the selected mode.

v4:
- profiles/ranging: filter Procedure Enable Complete by connection and
  decode event handles before the lookup (also big-endian hosts).
- profiles/ranging: use the config ID chosen by the peer and clear the
  role, pending Security Enable and procedure when it is removed.
- profiles/ranging: serialize restarts with a session generation and by
  recognizing the report of a disable sent before the restart.
- profiles/ranging: honor the stopped session for Config Complete and
  Procedure Enable Complete, and defer procedure setup until both
  capability reads are in.
- profiles/ranging: stop a running Reflector procedure by removing the
  configuration, decide Reflector sessions from the negotiated role,
  ignore duration for Reflector and clean up on every way a session ends.
- shared/rap: wait for the RAS Features read before picking a mode, keep
  an explicit Disabled mode, retry rejected CCCD writes and arm the
  Real-time timeout when it is enabled mid-procedure.
- unit/test-rap: tests for the shared/rap changes.

v3:
- gatt-database: ignore device removal when the adapter has no GATT
  database (non-LE controllers).
- profiles/ranging: end an armed Reflector session when the remote
  procedure stops, so bluetoothctl and the daemon agree on the session.
- profiles/ranging: ignore Remote FAE completions of other links.
- profiles/ranging: also handle Encryption Change v2 and v3 events when
  deferring CS Security Enable.
- profiles/ranging: keep the setup state of a configuration the peer
  created before StartMeasurement() instead of resetting it to INIT.

v2:
- gatt-database: clear the cached state of both bearers of a dual-mode
  device when it is removed.
- shared/rap: keep the Ranging Data Ready and Overwritten counters per
  connection instead of resetting the adapter-wide state on detach.
- profiles/ranging: exclude armed Reflector sessions from the Active
  property.
- profiles/ranging: ignore Remote Supported Capabilities of unmapped
  handles, so one link cannot overwrite another's antenna limits.
- profiles/ranging: enter CS_STATE_INIT before the asynchronous
  capability reads, so a peer-created configuration is not rewound.
- unit/test-rap: add tests for the Requester Ranging Data subscriptions,
  the Real-time timeout and the per-connection counters.

Cheng Jiang (15):
  gatt-database: Drop stale device state for removed bonds
  shared/rap: Reset the readable Ranging Counters per connection
  shared/rap: Subscribe on-demand data with the requested transport
  shared/rap: Subscribe to Ranging Data when a measurement starts
  client/cs: Fix use-after-free in stop_measurement_reply
  shared/hci: Look up the connection handle on the right link
  profiles/ranging: Let the Reflector run the CS setup phase
  profiles/ranging: Let StartMeasurement() pick the Initiator for Both
  profiles/ranging: Take the CS role from Config Complete
  profiles/ranging: Act on a CS configuration created by the peer
  profiles/ranging: Keep a peer-driven setup from being rewound
  profiles/ranging: Defer CS Security Enable until the link is encrypted
  profiles/ranging: Choose the CS antenna configuration from both ends
  profiles/ranging: Do not start a procedure after StopMeasurement()
  shared/rap: Start the Real-time timeout when the procedure starts

Luiz Augusto von Dentz (3):
  profiles/ranging: Keep CS sessions apart from stale and unrelated
    events
  unit/test-rap: Add tests for Ranging Data subscription and counters
  shared/rap: Defer Ranging Data mode selection until Features is read

 client/cs.c                        |  40 +-
 doc/org.bluez.ChannelSounding1.rst |  25 +-
 lib/bluetooth/hci.h                |   1 +
 profiles/ranging/rap.c             |  90 +++-
 profiles/ranging/rap_hci.c         | 733 +++++++++++++++++++++++------
 src/device.c                       |   3 +
 src/gatt-database.c                |  34 ++
 src/gatt-database.h                |   2 +
 src/shared/hci.c                   |  12 +-
 src/shared/hci.h                   |   2 +-
 src/shared/rap.c                   | 243 ++++++++--
 src/shared/rap.h                   |  11 +-
 tools/hcitool.c                    |   3 -
 unit/test-rap.c                    | 676 ++++++++++++++++++++++++--
 14 files changed, 1606 insertions(+), 269 deletions(-)

-- 
2.56.0


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2026-11-24 15:39 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 15:38 [PATCH BlueZ v6 00/18] Channel Sounding and RAP fixes Luiz Augusto von Dentz
2026-11-24 15:38 ` [PATCH BlueZ v6 01/18] gatt-database: Drop stale device state for removed bonds Luiz Augusto von Dentz
2026-11-24 15:38 ` [PATCH BlueZ v6 02/18] shared/rap: Reset the readable Ranging Counters per connection Luiz Augusto von Dentz
2026-11-24 15:38 ` [PATCH BlueZ v6 03/18] shared/rap: Subscribe on-demand data with the requested transport Luiz Augusto von Dentz
2026-11-24 15:38 ` [PATCH BlueZ v6 04/18] shared/rap: Subscribe to Ranging Data when a measurement starts Luiz Augusto von Dentz
2026-11-24 15:38 ` [PATCH BlueZ v6 05/18] client/cs: Fix use-after-free in stop_measurement_reply Luiz Augusto von Dentz
2026-11-24 15:38 ` [PATCH BlueZ v6 06/18] shared/hci: Look up the connection handle on the right link Luiz Augusto von Dentz
2026-11-24 15:38 ` [PATCH BlueZ v6 07/18] profiles/ranging: Let the Reflector run the CS setup phase Luiz Augusto von Dentz
2026-11-24 15:38 ` [PATCH BlueZ v6 08/18] profiles/ranging: Let StartMeasurement() pick the Initiator for Both Luiz Augusto von Dentz
2026-11-24 15:38 ` [PATCH BlueZ v6 09/18] profiles/ranging: Take the CS role from Config Complete Luiz Augusto von Dentz
2026-11-24 15:38 ` [PATCH BlueZ v6 10/18] profiles/ranging: Act on a CS configuration created by the peer Luiz Augusto von Dentz
2026-11-24 15:38 ` [PATCH BlueZ v6 11/18] profiles/ranging: Keep a peer-driven setup from being rewound Luiz Augusto von Dentz
2026-11-24 15:38 ` [PATCH BlueZ v6 12/18] profiles/ranging: Defer CS Security Enable until the link is encrypted Luiz Augusto von Dentz
2026-11-24 15:38 ` [PATCH BlueZ v6 13/18] profiles/ranging: Choose the CS antenna configuration from both ends Luiz Augusto von Dentz
2026-11-24 15:38 ` [PATCH BlueZ v6 14/18] profiles/ranging: Do not start a procedure after StopMeasurement() Luiz Augusto von Dentz
2026-11-24 15:38 ` [PATCH BlueZ v6 15/18] profiles/ranging: Keep CS sessions apart from stale and unrelated events Luiz Augusto von Dentz
2026-11-24 15:38 ` [PATCH BlueZ v6 16/18] shared/rap: Start the Real-time timeout when the procedure starts Luiz Augusto von Dentz
2026-11-24 15:38 ` [PATCH BlueZ v6 17/18] unit/test-rap: Add tests for Ranging Data subscription and counters Luiz Augusto von Dentz
2026-11-24 15:38 ` [PATCH BlueZ v6 18/18] shared/rap: Defer Ranging Data mode selection until Features is read Luiz Augusto von Dentz

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