From: Chris Lu <chris.lu@mediatek.com>
To: Marcel Holtmann <marcel@holtmann.org>,
Johan Hedberg <johan.hedberg@gmail.com>,
Luiz Von Dentz <luiz.dentz@gmail.com>
Cc: Sean Wang <sean.wang@mediatek.com>,
Will Lee <will-cy.Lee@mediatek.com>, SS Wu <ss.wu@mediatek.com>,
Steve Lee <steve.lee@mediatek.com>,
Paul Menzel <pmenzel@molgen.mpg.de>,
linux-bluetooth <linux-bluetooth@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-mediatek <linux-mediatek@lists.infradead.org>,
Chris Lu <chris.lu@mediatek.com>
Subject: [PATCH v13 0/7] Bluetooth: btmtk: Add MT7928 support
Date: Thu, 16 Jul 2026 19:23:45 +0800 [thread overview]
Message-ID: <20260716112353.2192865-1-chris.lu@mediatek.com> (raw)
This patch series adds support for MT7928 (device ID 0x7935) to the
btmtk driver, which requires a new two-stage firmware loading process
with CBMCU firmware.
Patch 1 fixes SKB handling issues: DMA out-of-bounds read and cloned
SKB corruption. Fix by calling skb_unshare() and expanding skb tailroom
with zero-padding.
Patch 2 adds firmware size validation with integer overflow protection
to prevent out-of-bounds access with malicious firmware files.
Patch 3 passes hardware dev_id to mt79xx_setup() to fix incorrect chip
ID logging (was hardcoded to 0).
Patch 4 removes redundant snprintf() that overrides btmtk_fw_get_filename()
result, causing newer chips to request incorrect firmware filenames.
Patch 5 improves firmware logging: adds filename log, uses chip ID as
HW version, and uses %.16s format specifier for datetime field.
Patch 6 replaces magic numbers with BTMTK_WMT_PKT_* enum for better
code readability.
Patch 7 implements MT7928 CBMCU firmware download with two-phase loading
sequence and cert_len overflow protection.
Tested on MT7928 hardware with successful firmware loading and
Bluetooth functionality verification.
Changes in v13:
- Fix cloned SKB corruption (HIGH severity) by adding skb_unshare() (Patch 1)
- Fix cert_len integer overflow (CRITICAL severity) in CBMCU firmware loading (Patch 7)
Pre-existing issues fixed in subsequent patches:
- Patch 2 introduces format string issue (%s on non-null-terminated field)
-> Fixed in Patch 5 using %.16s format specifier
- Patch 3 context has pre-existing snprintf() override (identified in v12 review)
-> Fixed in Patch 4, resolving firmware load failures on MT6639/MT7925/MT7928
This gradual improvement approach allows independent backporting of each fix.
v12 -> v13:
- Added skb_unshare() to prevent cloned SKB corruption
- Added overflow checks for cert_len calculation
- Split SDIO firmware loading fixes into two patches
Changes in v12:
- Reordered patches to fix dependency: move "Pass dev_id" before
"Improve logging" so dev_id is available when logging
Changes in v11:
- Fixed use-after-free: reassign sdio_hdr after pskb_expand_head()
- Reordered patches for bisectability
Changes in v10:
- Added Patch 1 to fix DMA out-of-bounds access
Changes in v9:
- Reordered patches to group SDIO fixes together
Changes in v8:
- Split firmware validation from dev_id pass-through into separate patches
Changes in v7:
- Added Fixes tag per feedback
Changes in v6:
- Added Fixes tag and restructured parameter comment
Changes in v5:
- Moved documentation to function-level comment
Changes in v4:
- Fixed commit message and expanded description
Changes in v3:
- Changed dev_id type from u16 to u32
Changes in v2:
- Combined MT7928 functionality into single patch
Chris Lu (7):
Bluetooth: btmtksdio: Fix SKB handling issues in TX path
Bluetooth: btmtk: Add firmware size validation in
btmtk_setup_firmware_79xx()
Bluetooth: btmtksdio: Pass hardware dev_id to mt79xx_setup()
Bluetooth: btmtksdio: Remove redundant firmware filename override
Bluetooth: btmtk: Improve BT firmware logging
Bluetooth: btmtk: Replace magic numbers with WMT packet flag enum
Bluetooth: btmtk: Add MT7928 support
drivers/bluetooth/btmtk.c | 427 +++++++++++++++++++++++++++++++++-
drivers/bluetooth/btmtk.h | 9 +
drivers/bluetooth/btmtksdio.c | 42 +++-
3 files changed, 459 insertions(+), 19 deletions(-)
--
2.45.2
next reply other threads:[~2026-07-16 11:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 11:23 Chris Lu [this message]
2026-07-16 11:23 ` [PATCH v13 1/7] Bluetooth: btmtksdio: Fix SKB handling issues in TX path Chris Lu
2026-07-16 12:02 ` Bluetooth: btmtk: Add MT7928 support bluez.test.bot
2026-07-16 11:23 ` [PATCH v13 2/7] Bluetooth: btmtk: Add firmware size validation in btmtk_setup_firmware_79xx() Chris Lu
2026-07-16 11:23 ` [PATCH v13 3/7] Bluetooth: btmtksdio: Pass hardware dev_id to mt79xx_setup() Chris Lu
2026-07-16 11:23 ` [PATCH v13 4/7] Bluetooth: btmtksdio: Remove redundant firmware filename override Chris Lu
2026-07-16 11:23 ` [PATCH v13 5/7] Bluetooth: btmtk: Improve BT firmware logging Chris Lu
2026-07-16 11:23 ` [PATCH v13 6/7] Bluetooth: btmtk: Replace magic numbers with WMT packet flag enum Chris Lu
2026-07-16 11:23 ` [PATCH v13 7/7] Bluetooth: btmtk: Add MT7928 support Chris Lu
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=20260716112353.2192865-1-chris.lu@mediatek.com \
--to=chris.lu@mediatek.com \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
--cc=pmenzel@molgen.mpg.de \
--cc=sean.wang@mediatek.com \
--cc=ss.wu@mediatek.com \
--cc=steve.lee@mediatek.com \
--cc=will-cy.Lee@mediatek.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.