From: Laxman Acharya Padhya <acharyalaxman8848@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: marcel@holtmann.org, luiz.dentz@gmail.com,
linux-kernel@vger.kernel.org, ali@iusegentoo.com,
kiraank@gmail.com, kiran.k@intel.com,
ravishankar.srivatsa@intel.com, amit.k.bag@intel.com,
Laxman Acharya Padhya <acharyalaxman8848@gmail.com>
Subject: [PATCH v3 3/3] Bluetooth: btintel: propagate version TLV parsing errors
Date: Mon, 31 Aug 2026 15:44:23 +0545 [thread overview]
Message-ID: <20260831095923.18830-4-acharyalaxman8848@gmail.com> (raw)
In-Reply-To: <20260831095923.18830-1-acharyalaxman8848@gmail.com>
btintel_read_version_tlv() ignores the parser return value, so setup
continues with partially initialized version data after a malformed TLV
causes parsing to stop.
Return the parser error to the caller so an invalid response fails setup
instead of being treated as successful. Keep this behavioral change
separate from the bounds checks so it can be reverted independently if
an existing controller sends malformed data.
Signed-off-by: Laxman Acharya Padhya <acharyalaxman8848@gmail.com>
Reviewed-by: Ali Ahmet Memis <ali@iusegentoo.com>
---
drivers/bluetooth/btintel.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index 887170534..964d2de30 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -723,6 +723,7 @@ static int btintel_read_version_tlv(struct hci_dev *hdev,
{
struct sk_buff *skb;
const u8 param[1] = { 0xFF };
+ int err;
if (!version)
return -EINVAL;
@@ -741,10 +742,10 @@ static int btintel_read_version_tlv(struct hci_dev *hdev,
return -EIO;
}
- btintel_parse_version_tlv(hdev, version, skb);
+ err = btintel_parse_version_tlv(hdev, version, skb);
kfree_skb(skb);
- return 0;
+ return err;
}
/* ------- REGMAP IBT SUPPORT ------- */
--
2.51.2
next prev parent reply other threads:[~2026-08-31 9:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-14 17:15 [PATCH v2 0/3] Bluetooth: btintel: harden version TLV parsing Laxman Acharya Padhya
2026-08-14 17:15 ` [PATCH v2 1/3] Bluetooth: btintel: validate version TLV value lengths Laxman Acharya Padhya
2026-08-14 18:29 ` Bluetooth: btintel: harden version TLV parsing bluez.test.bot
2026-08-14 17:15 ` [PATCH v2 2/3] Bluetooth: btintel: bound firmware ID by TLV length Laxman Acharya Padhya
2026-08-14 17:15 ` [PATCH v2 3/3] Bluetooth: btintel: propagate version TLV parsing errors Laxman Acharya Padhya
2026-08-14 18:46 ` Ali Ahmet Memis
2026-08-31 9:59 ` [PATCH v3 0/3] Bluetooth: btintel: harden version TLV parsing Laxman Acharya Padhya
2026-08-31 9:59 ` [PATCH v3 1/3] Bluetooth: btintel: validate version TLV value lengths Laxman Acharya Padhya
2026-08-31 11:05 ` K, Kiran
2026-08-31 12:29 ` Bluetooth: btintel: harden version TLV parsing bluez.test.bot
2026-08-31 9:59 ` [PATCH v3 2/3] Bluetooth: btintel: bound firmware ID by TLV length Laxman Acharya Padhya
2026-08-31 11:05 ` K, Kiran
2026-08-31 9:59 ` Laxman Acharya Padhya [this message]
2026-08-31 11:05 ` [PATCH v3 3/3] Bluetooth: btintel: propagate version TLV parsing errors K, Kiran
2026-08-31 17:20 ` [PATCH v3 0/3] Bluetooth: btintel: harden version TLV parsing patchwork-bot+bluetooth
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=20260831095923.18830-4-acharyalaxman8848@gmail.com \
--to=acharyalaxman8848@gmail.com \
--cc=ali@iusegentoo.com \
--cc=amit.k.bag@intel.com \
--cc=kiraank@gmail.com \
--cc=kiran.k@intel.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
--cc=ravishankar.srivatsa@intel.com \
/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 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.