Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH v4 1/2] Bluetooth: btintel: Zero version data before parsing TLVs
@ 2026-10-08 14:06 Kiran K
  2026-10-08 14:06 ` [PATCH v4 2/2] Bluetooth: btintel: load unlocker.sfi to allow unsigned firmware Kiran K
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Kiran K @ 2026-10-08 14:06 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: chethan.tumkur.narayan, chandrashekar.devegowda, Kiran K

Firmware may omit optional TLVs, leaving their corresponding fields
unset in the caller-supplied struct intel_version_tlv. Since the
structure is typically stack-allocated and not cleared beforehand,
fields for which no TLV is received retain uninitialized stack
memory. This stale data can be logged via btintel_version_info_tlv()
and copied back to the caller, leaking kernel stack contents.

Clear the structure in btintel_read_version_tlv() before parsing so
that fields with no corresponding TLV are deterministically zero
instead of containing garbage.

Fixes: 57375beef71a ("Bluetooth: btintel: Add infrastructure to read controller information")
Signed-off-by: Kiran K <kiran.k@intel.com>
---
 drivers/bluetooth/btintel.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index f298c91f4f4e..c4a6b5ea64f1 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -752,6 +752,7 @@ static int btintel_read_version_tlv(struct hci_dev *hdev,
 		return -EIO;
 	}
 
+	memset(version, 0, sizeof(*version));
 	err = btintel_parse_version_tlv(hdev, version, skb);
 
 	kfree_skb(skb);
-- 
2.54.0


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

end of thread, other threads:[~2026-10-09 20:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-08 14:06 [PATCH v4 1/2] Bluetooth: btintel: Zero version data before parsing TLVs Kiran K
2026-10-08 14:06 ` [PATCH v4 2/2] Bluetooth: btintel: load unlocker.sfi to allow unsigned firmware Kiran K
2026-10-08 15:26 ` [v4,1/2] Bluetooth: btintel: Zero version data before parsing TLVs bluez.test.bot
2026-10-09 14:00   ` Luiz Augusto von Dentz
2026-10-09 19:50 ` [PATCH v4 1/2] " patchwork-bot+bluetooth
2026-10-09 20:00 ` 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