public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] audio/player: Ensure metadata string is valid UTF-8
@ 2026-04-13  7:12 Frédéric Danis
  2026-04-13  9:15 ` [BlueZ] " bluez.test.bot
  2026-04-13 19:00 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Frédéric Danis @ 2026-04-13  7:12 UTC (permalink / raw)
  To: linux-bluetooth

bluetoothd crashes on reception of GetItemAttributes reply if it contains
an invalid UTF-8 string:

> BR-ACL: Handle 11 [B8:3C:28:E8:07:69 (Apple, Inc.)] flags 0x02 dlen 680
      Channel: 71 len 676 ctrl 0x0304 [PSM 27 mode Enhanced Retransmission
               (0x03)] {chan 7}
      I-frame: Unsegmented TxSeq 2 ReqSeq 3
      AVCTP Browsing: Response: type 0x00 label 2 PID 0x110e
        AVRCP: GetItemAttributes: len 0x029a
          Status: 0x04 (Success)
          AttributeCount: 0x01 (1)
          AttributeID: 0x00000001 (Title)
          CharsetID: 0x006a (UTF-8)
          AttributeLength: 0x0290 (656)
          AttributeValue: ................................................
..........................................................................
.........................................................................2
009.......................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
................
= bluetoothd: profiles/audio/player.c:media_player_set_playlist_item() 0
= bluetoothd: profiles/audio/player.c:media_player_set_metadata() Title:
  奥巴马表示:美国之所以没有搞定中国,不是因为中国的军事实力以及经济强大
  ,而是因为中国从始至终都没有掉进我们安排的“陷阱”。时间倒回2009年,北京
  钓鱼台国宾馆。奥巴马的随行团队一进门,连句客套话都没顾得上说,反手就把
  随身带的电子设备挨个拔了电源、卸了电池。这阵仗看着像是在防监听,实则是
  心虚。那群在长桌对面坐下的人,心里正翻腾着一种从未有过的无力感。因为眼
  前的谈判对象,压根没打算照着他们兜里的剧本念台词。多年以后,退下来的奥
  巴马在回忆录《应�
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.
---
 profiles/audio/player.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/profiles/audio/player.c b/profiles/audio/player.c
index 86e59bc8e..3af9a1824 100644
--- a/profiles/audio/player.c
+++ b/profiles/audio/player.c
@@ -30,6 +30,7 @@
 #include "src/log.h"
 #include "src/dbus-common.h"
 #include "src/error.h"
+#include "src/shared/util.h"
 
 #include "player.h"
 
@@ -1442,6 +1443,8 @@ void media_player_set_metadata(struct media_player *mp,
 	GHashTable *metadata = item ? item->metadata : mp->track;
 
 	value = g_strndup(data, len);
+	/* Ensure this is a valid UTF-8 string */
+	strtoutf8(value, len);
 
 	DBG("%s: %s", key, value);
 
-- 
2.43.0


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

* RE: [BlueZ] audio/player: Ensure metadata string is valid UTF-8
  2026-04-13  7:12 [PATCH BlueZ] audio/player: Ensure metadata string is valid UTF-8 Frédéric Danis
@ 2026-04-13  9:15 ` bluez.test.bot
  2026-04-13 19:00 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2026-04-13  9:15 UTC (permalink / raw)
  To: linux-bluetooth, frederic.danis

[-- Attachment #1: Type: text/plain, Size: 1304 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1080516

---Test result---

Test Summary:
CheckPatch                    PENDING   0.36 seconds
GitLint                       PENDING   0.37 seconds
BuildEll                      PASS      20.64 seconds
BluezMake                     PASS      637.53 seconds
MakeCheck                     PASS      18.61 seconds
MakeDistcheck                 PASS      244.94 seconds
CheckValgrind                 PASS      292.36 seconds
CheckSmatch                   PASS      347.80 seconds
bluezmakeextell               PASS      182.56 seconds
IncrementalBuild              PENDING   0.40 seconds
ScanBuild                     PASS      1029.92 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



https://github.com/bluez/bluez/pull/2030

---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ] audio/player: Ensure metadata string is valid UTF-8
  2026-04-13  7:12 [PATCH BlueZ] audio/player: Ensure metadata string is valid UTF-8 Frédéric Danis
  2026-04-13  9:15 ` [BlueZ] " bluez.test.bot
@ 2026-04-13 19:00 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2026-04-13 19:00 UTC (permalink / raw)
  To: =?utf-8?b?RnLDqWTDqXJpYyBEYW5pcyA8ZnJlZGVyaWMuZGFuaXNAY29sbGFib3JhLmNvbT4=?=
  Cc: linux-bluetooth

Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Mon, 13 Apr 2026 09:12:46 +0200 you wrote:
> bluetoothd crashes on reception of GetItemAttributes reply if it contains
> an invalid UTF-8 string:
> 
> > BR-ACL: Handle 11 [B8:3C:28:E8:07:69 (Apple, Inc.)] flags 0x02 dlen 680
>       Channel: 71 len 676 ctrl 0x0304 [PSM 27 mode Enhanced Retransmission
>                (0x03)] {chan 7}
>       I-frame: Unsegmented TxSeq 2 ReqSeq 3
>       AVCTP Browsing: Response: type 0x00 label 2 PID 0x110e
>         AVRCP: GetItemAttributes: len 0x029a
>           Status: 0x04 (Success)
>           AttributeCount: 0x01 (1)
>           AttributeID: 0x00000001 (Title)
>           CharsetID: 0x006a (UTF-8)
>           AttributeLength: 0x0290 (656)
>           AttributeValue: ................................................
> ..........................................................................
> .........................................................................2
> 009.......................................................................
> ..........................................................................
> ..........................................................................
> ..........................................................................
> ..........................................................................
> ..........................................................................
> ................
> = bluetoothd: profiles/audio/player.c:media_player_set_playlist_item() 0
> = bluetoothd: profiles/audio/player.c:media_player_set_metadata() Title:
>   奥巴马表示:美国之所以没有搞定中国,不是因为中国的军事实力以及经济强大
>   ,而是因为中国从始至终都没有掉进我们安排的“陷阱”。时间倒回2009年,北京
>   钓鱼台国宾馆。奥巴马的随行团队一进门,连句客套话都没顾得上说,反手就把
>   随身带的电子设备挨个拔了电源、卸了电池。这阵仗看着像是在防监听,实则是
>   心虚。那群在长桌对面坐下的人,心里正翻腾着一种从未有过的无力感。因为眼
>   前的谈判对象,压根没打算照着他们兜里的剧本念台词。多年以后,退下来的奥
>   巴马在回忆录《应�
> 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.
> 
> [...]

Here is the summary with links:
  - [BlueZ] audio/player: Ensure metadata string is valid UTF-8
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=fb0f8f495ace

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2026-04-13 19:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-13  7:12 [PATCH BlueZ] audio/player: Ensure metadata string is valid UTF-8 Frédéric Danis
2026-04-13  9:15 ` [BlueZ] " bluez.test.bot
2026-04-13 19:00 ` [PATCH BlueZ] " 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