[PATCH 0/3] Bluetooth: btmtk: Harden firmware parsing and improve logging

patchwork-bot+bluetooth at kernel.org patchwork-bot+bluetooth at kernel.org
Wed Sep 9 13:00:08 PDT 2026


Hello:

This series was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz at intel.com>:

On Wed, 9 Sep 2026 20:00:08 +0800 you wrote:
> Three changes to the shared btmtk firmware download path, all in
> preparation for MT7928 support but useful on their own.
> 
> Patch 1 bounds-checks the firmware image before the section map walk in
> btmtk_setup_firmware_79xx(). Today the section count, the section map
> array and each section's offset/length come straight out of the file and
> are never compared against fw->size, so a truncated or corrupted file
> makes the driver read past the end of request_firmware()'s buffer. The
> section count is a __le32 from the file, so on 32-bit builds multiplying
> it by the 64-byte map size wraps a size_t and a bound computed without an
> overflow check would come out small enough to accept the file; both
> helpers order their arithmetic so nothing can wrap. A section count of
> zero is rejected too, since it passes every size check but would leave
> the download loop with nothing to do and still report success.
> 
> [...]

Here is the summary with links:
  - [1/3] Bluetooth: btmtk: Validate the firmware layout before parsing it
    https://git.kernel.org/bluetooth/bluetooth-next/c/71147d59cb23
  - [2/3] Bluetooth: btmtk: Improve BT firmware logging
    https://git.kernel.org/bluetooth/bluetooth-next/c/4a7b93f08d13
  - [3/3] Bluetooth: btmtk: Replace magic numbers with WMT packet flag enum
    https://git.kernel.org/bluetooth/bluetooth-next/c/1b737f2ef168

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html





More information about the Linux-mediatek mailing list