All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: btintel: validate the BRDS domain packages
@ 2026-11-03 11:41 Kang Chen
  2026-11-03 16:48 ` bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Kang Chen @ 2026-11-03 11:41 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Luiz Augusto von Dentz, Kiran K, Vijay Satija, linux-bluetooth,
	linux-kernel

btintel_acpi_get_bt_pkg() treats every element after the revision as a
package and reads its first element without checking the element type
or count.  An integer element makes package.elements alias the integer
value and dereferences a firmware-chosen pointer; a short string or
buffer element reads past its allocation.  The function is called for
BRDS during Intel SAR setup.

Skip elements that are not non-empty packages.

Fixes: e036afb1fe44 ("Bluetooth: btintel: Add support to configure TX power")
Signed-off-by: Kang Chen <k.chen@smail.nju.edu.cn>
---
 drivers/bluetooth/btintel.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index 0709fb3212f9..16745b58bde4 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -3042,6 +3042,10 @@ static union acpi_object *btintel_acpi_get_bt_pkg(union acpi_object *buffer)
 
 	for (i = 1; i < buffer->package.count; i++) {
 		bt_pkg = &buffer->package.elements[i];
+		if (bt_pkg->type != ACPI_TYPE_PACKAGE ||
+		    bt_pkg->package.count < 1)
+			continue;
+
 		domain = &bt_pkg->package.elements[0];
 		if (domain->type == ACPI_TYPE_INTEGER &&
 		    domain->integer.value == BTINTEL_BT_DOMAIN)
-- 
2.34.1


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

end of thread, other threads:[~2026-11-03 16:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-03 11:41 [PATCH] Bluetooth: btintel: validate the BRDS domain packages Kang Chen
2026-11-03 16:48 ` bluez.test.bot

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.