Skip to content

shared: Use util_iov helpers in gatt-db, hog, asha and micp

Luiz Augusto von Dentz linux-bluetooth 2 versions – Applied

Status from this message: This series was applied to bluetooth/bluez.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 1 replyApplied
  2. v15 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- gatt-db: don't update the database hash from incomplete input when allocating a hash entry fails, keep the current hash and retry the update later (review feedback on v1).

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/5shared/gatt-db: Use util_iov helpers to build and parse valuessrc/shared/gatt-db.c+129 -861 reply
2/5shared/hog: Use util_iov helpers to parse characteristic valuessrc/shared/hog.c+35 -270 replies
3/5shared/asha: Use util_iov helpers to parse characteristic valuessrc/shared/asha.c+36 -160 replies
4/5shared/micp: Fix reading Mute State from an empty notificationsrc/shared/micp.c+8 -10 replies
5/5shared/micp: Use util_iov_pull_mem instead of a local helpersrc/shared/micp.c+3 -160 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH BlueZ v2 0/5] shared: Use util_iov helpers in gatt-db, hog, asha and micp

From: Luiz Augusto von Dentz <[email protected]>

This continues the conversion of the GATT code in src/shared to the util_iov_pull_* and util_iov_push_* helpers, so that the bounds check is part of the access, now for gatt-db and the HoG, ASHA and MICP profiles.

The conversions are meant to be behavior preserving and are covered by the existing unit tests (test-gatt, test-hog, test-micp). The existing code already checked the lengths in the HoG and ASHA readers, so no new tests were added for them.

The one bug found is in micp: a Mute State notification with no value made micp_mute_state_notify read a byte past the value. It is fixed, but there is no test for it since the scripted test-micp client flow does not deliver a notification to that handler, so it could not be reproduced.

bap, rap and the remaining profiles will follow in separate series.

v2:
- gatt-db: don't update the database hash from incomplete input when allocating a hash entry fails, keep the current hash and retry the update later (review feedback on v1).

Luiz Augusto von Dentz (5):
shared/gatt-db: Use util_iov helpers to build and parse values shared/hog: Use util_iov helpers to parse characteristic values shared/asha: Use util_iov helpers to parse characteristic values shared/micp: Fix reading Mute State from an empty notification shared/micp: Use util_iov_pull_mem instead of a local helper

 src/shared/asha.c    |  52 +++++++----
 src/shared/gatt-db.c | 215 ++++++++++++++++++++++++++-----------------
 src/shared/hog.c     |  62 +++++++------
 src/shared/micp.c    |  28 +++---
 4 files changed, 211 insertions(+), 146 deletions(-)
Signature · 1 line
2.56.0