All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] shared/gatt-db: Fix munmap_chunk invalid pointer
@ 2024-01-03  9:28 Frédéric Danis
  2024-01-03 10:30 ` [BlueZ] " bluez.test.bot
  2024-01-03 15:50 ` [PATCH BlueZ] " Luiz Augusto von Dentz
  0 siblings, 2 replies; 4+ messages in thread
From: Frédéric Danis @ 2024-01-03  9:28 UTC (permalink / raw)
  To: linux-bluetooth

PTS test GATT/CL/GAD/BV-03-C published a service starting at handle 0xfffd
and ending at 0xffff.
This resets the next_handle to 0 in gatt_db_insert_service() instead of
setting it to 0x10000. Other services are added later.
This could end-up by a crash in db_hash_update() if not enough space has
been allocated for hash.iov and some entries are overwritten.
---
 src/shared/gatt-db.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/shared/gatt-db.c b/src/shared/gatt-db.c
index 676f963ec..d32c9a70f 100644
--- a/src/shared/gatt-db.c
+++ b/src/shared/gatt-db.c
@@ -58,7 +58,7 @@ struct gatt_db {
 	struct bt_crypto *crypto;
 	uint8_t hash[16];
 	unsigned int hash_id;
-	uint16_t next_handle;
+	uint32_t next_handle;
 	struct queue *services;
 
 	struct queue *notify_list;
-- 
2.34.1


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

end of thread, other threads:[~2024-01-04 14:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-03  9:28 [PATCH BlueZ] shared/gatt-db: Fix munmap_chunk invalid pointer Frédéric Danis
2024-01-03 10:30 ` [BlueZ] " bluez.test.bot
2024-01-03 15:50 ` [PATCH BlueZ] " Luiz Augusto von Dentz
2024-01-04 14:11   ` Frédéric Danis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.