From: Simon Mikuda <simon.mikuda@streamunlimited.com>
To: linux-bluetooth@vger.kernel.org
Cc: Simon Mikuda <simon.mikuda@streamunlimited.com>
Subject: [PATCH BlueZ v3 02/10] avrcp: Fix listing media players up to item 0xffffffff
Date: Tue, 24 Nov 2026 10:28:25 +0100 [thread overview]
Message-ID: <20261124092833.1191053-2-simon.mikuda@streamunlimited.com> (raw)
In-Reply-To: <20261124092833.1191053-1-simon.mikuda@streamunlimited.com>
GetFolderItems for the media player list stops once it has
end_item - start_item + 1 items, which overflows to 0 for a request
from 0 to 0xffffffff, so the list stops before the first player and is
answered with Range Out of Bounds. That is the request the BlueZ
controller sends, so it never learns the target's players.
To reproduce, register a media player on the target and connect AVRCP
from a BlueZ controller, whose player never gets a Name:
btmon: AVRCP: GetFolderItems: len 0x000a
btmon: Scope: 0x00 (Media Player List)
btmon: StartItem: 0x00000000 (0)
btmon: EndItem: 0xffffffff (4294967295)
avrcp_handle_get_folder_items() scope 0x00 start_item 0x00000000
end_item 0xffffffff
btmon: AVRCP: GetFolderItems: len 0x0001
btmon: Status: 0x0b (Range Out of Bounds)
Fixes: d6bb0111b569 ("audio/avrcp: Add GetFolderItems support")
Assisted-by: Claude:claude-opus-5-5
---
profiles/audio/avrcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 95b1d8c47..3ab7b6d7c 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -1997,7 +1997,7 @@ static void avrcp_handle_media_player_list(struct avrcp *session,
struct player_item *item;
uint16_t namelen;
- if (rsp->num_items == (end_item - start_item) + 1)
+ if (rsp->num_items > end_item - start_item)
break;
folder = (void *)&pdu->params[pdu->param_len];
--
2.43.0
next prev parent reply other threads:[~2026-11-24 9:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 9:28 [PATCH BlueZ v3 01/10] avrcp: Fix not checking browsing PDU parameter length Simon Mikuda
2026-11-24 9:28 ` Simon Mikuda [this message]
2026-11-24 9:28 ` [PATCH BlueZ v3 03/10] avrcp: Fix byte order of ADDRESSED_PLAYER_CHANGED notification Simon Mikuda
2026-11-24 9:28 ` [PATCH BlueZ v3 04/10] avrcp: Fix byte order of TRACK_CHANGED identifier Simon Mikuda
2026-11-24 9:28 ` [PATCH BlueZ v3 05/10] avrcp: Fix not browsing a player addressed before it was listed Simon Mikuda
2026-11-24 9:28 ` [PATCH BlueZ v3 06/10] player: Fix crash on Search in a folder with a space in its name Simon Mikuda
2026-11-24 9:28 ` [PATCH BlueZ v3 07/10] player: Fix missing Name of listed Now Playing items Simon Mikuda
2026-11-24 9:28 ` [PATCH BlueZ v3 08/10] avrcp: Fix NumberOfItems set from a reply for another folder Simon Mikuda
2026-11-24 9:28 ` [PATCH BlueZ v3 09/10] unit/test-media-player: Add test for a stale NumberOfItems reply Simon Mikuda
2026-11-24 9:28 ` [PATCH BlueZ v3 10/10] player: Fix Now Playing NumberOfItems when its content changes Simon Mikuda
2026-11-24 11:24 ` [BlueZ,v3,01/10] avrcp: Fix not checking browsing PDU parameter length bluez.test.bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261124092833.1191053-2-simon.mikuda@streamunlimited.com \
--to=simon.mikuda@streamunlimited.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox