Linux bluetooth development
 help / color / mirror / Atom feed
From: Roland Schober <rolandschober1968@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Roland Schober <rolandschober1968@gmail.com>
Subject: [PATCH BlueZ 3/5] monitor: Fix reading beyond a short Mesh Beacon
Date: Fri, 20 Nov 2026 23:26:22 +0100	[thread overview]
Message-ID: <20261120222624.150321-4-rolandschober1968@gmail.com> (raw)
In-Reply-To: <20261120222624.150321-1-rolandschober1968@gmail.com>

The Unprovisioned Device Beacon has the beacon type, 16 octets of
Device UUID and 2 octets of OOB Information, but print_mesh_beacon()
decodes the OOB Information of a beacon with 18 octets, which lacks its
second octet. Require 19 octets, and dump the octets after the OOB
Information, not from its second octet on, if there is no URI Hash.

Fixes: 0ba12681f3e4 ("monitor: Add basic decoding for Mesh Beacon")
Assisted-by: Claude:claude-fable-5-2
---
 monitor/packet.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/monitor/packet.c b/monitor/packet.c
index 4f63cc0fb..6646dc147 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -4205,7 +4205,7 @@ static void print_mesh_beacon(const uint8_t *data, uint8_t len)
 	switch (data[0]) {
 	case 0x00:
 		print_field("  Unprovisioned Device Beacon (0x00)");
-		if (len < 18) {
+		if (len < 19) {
 			packet_hexdump(data + 1, len - 1);
 			break;
 		}
@@ -4218,7 +4218,7 @@ static void print_mesh_beacon(const uint8_t *data, uint8_t len)
 		print_bitfield(4, oob, mesh_oob_table);
 
 		if (len < 23) {
-			packet_hexdump(data + 18, len - 18);
+			packet_hexdump(data + 19, len - 19);
 			break;
 		}
 
-- 
2.47.3


  parent reply	other threads:[~2026-11-20 22:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 22:26 [PATCH BlueZ 0/5] monitor: Fix reads beyond advertising data Roland Schober
2026-11-20 22:26 ` [PATCH BlueZ 1/5] monitor: Fix overflow of the name buffer in print_eir Roland Schober
2026-11-20 22:26 ` [PATCH BlueZ 2/5] monitor: Fix reading Flags beyond empty AD structures Roland Schober
2026-11-20 22:26 ` Roland Schober [this message]
2026-11-20 22:26 ` [PATCH BlueZ 4/5] monitor: Fix reading beyond the Apple manufacturer data Roland Schober
2026-11-20 22:26 ` [PATCH BlueZ 5/5] monitor: Fix decoding of Public Broadcast Announcements Roland Schober

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=20261120222624.150321-4-rolandschober1968@gmail.com \
    --to=rolandschober1968@gmail.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