From: Jeremy Dean <deaner92@yahoo.com>
To: linux-bluetooth@vger.kernel.org
Cc: kiran.k@intel.com, Sai Teja Aluvala <aluvala.sai.teja@intel.com>
Subject: Re: [PATCH v1] Bluetooth: btintel: validate DDC record lengths
Date: Tue, 22 Sep 2026 02:40:34 +0000 [thread overview]
Message-ID: <20260922024034.2186-1-deaner92@yahoo.com> (raw)
In-Reply-To: <20260918083838.23676-1-aluvala.sai.teja@intel.com>
Sai,
A couple of things could be worth a second look here.
cmd_plen is still declared as u8:
u8 cmd_plen = fw_ptr[0] + 1U;
The addition itself happens in a wider type due to integer promotion,
but the result is truncated back down the moment it's stored in
cmd_plen.
So if fw_ptr[0] is 0xFF, cmd_plen still wraps to 0, the same
as before this patch. The commit message says this parses the length
"in unsigned storage so 0xFF does not wrap". It will wrap as soon as it
is placed back into the u8 cmd_plen variable.
It happens to get caught afterward by the cmd_plen < 3 check,
since a wrapped value of 0 is less than 3. Is that the intended fix?
The commit message seems to mismatch what is diffed.
Also, the cmd_plen > U8_MAX check can never be true. Since
cmd_plen is a u8, its value is bounded by U8_MAX by definition.
There's no input that will make this branch fire.
Regards,
Jeremy Dean
~
next prev parent reply other threads:[~2026-09-22 3:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 8:38 [PATCH v1] Bluetooth: btintel: validate DDC record lengths Sai Teja Aluvala
2026-09-18 10:32 ` [v1] " bluez.test.bot
2026-09-22 2:40 ` Jeremy Dean [this message]
2026-09-22 12:43 ` [PATCH v1] Bluetooth: " Aluvala Sai Teja
2026-09-25 14:02 ` Jeremy Clifton
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=20260922024034.2186-1-deaner92@yahoo.com \
--to=deaner92@yahoo.com \
--cc=aluvala.sai.teja@intel.com \
--cc=kiran.k@intel.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