public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v3 0/7] audio/avrcp: Fix crash with invalid UTF-8 item name
@ 2025-07-08 15:43 Frédéric Danis
  2025-07-08 15:43 ` [PATCH BlueZ v3 1/7] shared/util: Add strtoutf8 function Frédéric Danis
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Frédéric Danis @ 2025-07-08 15:43 UTC (permalink / raw)
  To: linux-bluetooth

As stated in AVRCP 1.6.2 chapter 6.10.2.3 Media element item, for the
Displayable Name Length property, the target device may truncate the
item name:

  Length of Displayable Name in octets. The name shall be limited such
  that a response to a GetFolderItems containing one media player item
  fits within the maximum size of PDU which can be received by the CT.

This truncatation may occur in the middle of a multi-byte character,
at least with Samsung Music app, which triggers a DBus assertion and
crashes bluetoothd:

  profiles/audio/player.c:media_folder_create_item() Din Dhal Jaye
      Haye with lyrics | "दिन ढल जाए
      हाय" गाने के बो� type audio uid 1
  profiles/audio/player.c:media_folder_create_item()
      /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item1
  profiles/audio/player.c:media_player_set_metadata() Title: Din Dhal
      Jaye Haye with lyrics | "दिन ढल जाए हाय"
      गाने के बोल | Guide | Dev Anand, Waheeda Rehman
  …
  arguments to dbus_message_iter_append_basic() were incorrect,
      assertion "_dbus_check_is_valid_utf8 (*string_p)" failed in
      file dbus-message.c line 2775.
  This is normally a bug in some application using the D-Bus library.

v1->v2:
  - Introduce new strtoutf8() util function to truncate a string before
    the first non UTF-8 character.
  - Use strtoutf8() for AVRCP media element name
  - Use strtoutf8() for MCP player name and track title
  - Use strtoutf8() for Audio GAP device name
  - Use strtoutf8() for EIR device names
v2->v3:
  - Use strtoutf8() for AD device names
  - Add name encoding tests to unit/test-eir

Frédéric Danis (7):
  shared/util: Add strtoutf8 function
  audio/avrcp: Fix crash with invalid UTF-8 item name
  audio/mcp: Use strtoutf8 for player name and track title
  audio/gap: Use strtoutf8 for GAP device name
  eir: Use strtoutf8 for device names
  shared/ad: Use strtoutf8 for name
  unit/test-eir: Add name encoding tests

 profiles/audio/avrcp.c |  4 +++-
 profiles/audio/mcp.c   | 11 +---------
 profiles/gap/gas.c     | 11 +---------
 src/eir.c              | 11 +---------
 src/shared/ad.c        |  7 +-----
 src/shared/util.c      | 42 +++++++++++++++++++++++++++++++++++
 src/shared/util.h      |  1 +
 unit/test-eir.c        | 50 ++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 100 insertions(+), 37 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2025-07-08 17:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-08 15:43 [PATCH BlueZ v3 0/7] audio/avrcp: Fix crash with invalid UTF-8 item name Frédéric Danis
2025-07-08 15:43 ` [PATCH BlueZ v3 1/7] shared/util: Add strtoutf8 function Frédéric Danis
2025-07-08 17:06   ` audio/avrcp: Fix crash with invalid UTF-8 item name bluez.test.bot
2025-07-08 15:43 ` [PATCH BlueZ v3 2/7] " Frédéric Danis
2025-07-08 15:43 ` [PATCH BlueZ v3 3/7] audio/mcp: Use strtoutf8 for player name and track title Frédéric Danis
2025-07-08 15:43 ` [PATCH BlueZ v3 4/7] audio/gap: Use strtoutf8 for GAP device name Frédéric Danis
2025-07-08 15:43 ` [PATCH BlueZ v3 5/7] eir: Use strtoutf8 for device names Frédéric Danis
2025-07-08 15:43 ` [PATCH BlueZ v3 6/7] shared/ad: Use strtoutf8 for name Frédéric Danis
2025-07-08 17:12   ` Pauli Virtanen
2025-07-08 17:16     ` Pauli Virtanen
2025-07-08 17:19     ` Luiz Augusto von Dentz
2025-07-08 15:43 ` [PATCH BlueZ v3 7/7] unit/test-eir: Add name encoding tests Frédéric Danis
2025-07-08 16:30 ` [PATCH BlueZ v3 0/7] audio/avrcp: Fix crash with invalid UTF-8 item name patchwork-bot+bluetooth

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