Bluetooth: btmtk: Add MT7928 support
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 posting 2/21 patch 1 replyApplied 1/1
- v3 posting 2/21 patch 1 replySuperseded
- v2 posting 2/21 patch 1 replySuperseded
Earlier versions · 16
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v16 Latest | 7 patches | 1 reply | In review | |
| v15 | 7 patches | 1 reply | Superseded | |
| v14 | 7 patches | 0 replies | Superseded | |
| v13 | 7 patches | 1 reply | Superseded | |
| v12 | 7 patches | 1 reply | Superseded | |
| v11 | 7 patches | 1 reply | Superseded | |
| v10 | 7 patches | 1 reply | Superseded | |
| v9 | 6 patches | 2 replies | Superseded | |
| v8 | 5 patches | 1 reply | Superseded | |
| v7 | 3 patches | 2 replies | Superseded | |
| v6 | 3 patches | 2 replies | Superseded | |
| v5 | 3 patches | 3 replies | Superseded | |
| v4 posting 1/2 | 2 patches | 4 replies | Superseded | |
| v3 posting 1/2 | 1 patch | 3 replies | Superseded | |
| v2 posting 1/2 | 1 patch | 1 reply | Superseded | |
| v1 | 1 patch | 8 replies | Superseded |
Changes in v16 from the cover letter
- Fix Patch 1 SKB ownership issues reported by Sashiko:
* Use double-pointer (struct sk_buff **pskb) to properly update caller's SKB pointer when skb_unshare() allocates new SKB
* On error paths, do not free SKB - leave it valid for caller to requeue, preventing use-after-free in btmtksdio_txrx_work()
* Prevents memory leak when pskb_expand_head() fails after skb_unshare() succeeds
Patches in v16 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | Bluetooth: btmtksdio: Fix SKB handling issues in TX pathdrivers/ | +55 | 1 reply | |
| 2/7 | Bluetooth: btmtk: Add firmware size validation in btmtk_setup_firmware_79xx()drivers/ | +39 | 0 replies | |
| 3/7 | Bluetooth: btmtksdio: Pass hardware dev_id to mt79xx_setup()drivers/ | +3 | 0 replies | |
| 4/7 | Bluetooth: btmtksdio: Remove redundant firmware filename overridedrivers/ | +0 | 0 replies | |
| 5/7 | Bluetooth: btmtk: Improve BT firmware loggingdrivers/ | +4 | 0 replies | |
| 6/7 | Bluetooth: btmtk: Replace magic numbers with WMT packet flag enumdrivers/ drivers/ | +12 | 0 replies | |
| 7/7 | Bluetooth: btmtk: Add MT7928 supportdrivers/ drivers/ | +372 | 0 replies |
Reviews trailers per patch
2 of 7 patches have a Reviewed-by or Acked-by.
| Patch | Paul Menzel | Sean Wang |
|---|---|---|
| 1/7 | ||
| 2/7 | ||
| 3/7 | ||
| 4/7 | ||
| 5/7 | ||
| 6/7 | R-b | |
| 7/7 | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v16 0/7] Bluetooth: btmtk: Add MT7928 support
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. Use double-pointer to properly update caller's SKB pointer, preventing use-after-free.
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 v16:
- Fix Patch 1 SKB ownership issues reported by Sashiko:
* Use double-pointer (struct sk_buff **pskb) to properly update caller's SKB pointer when skb_unshare() allocates new SKB
* On error paths, do not free SKB - leave it valid for caller to requeue, preventing use-after-free in btmtksdio_txrx_work()
* Prevents memory leak when pskb_expand_head() fails after skb_unshare() succeeds
Changes in v15:
- Rebased onto latest bluetooth-next/HEAD (bd8bee79e1fa)
- No functional changes from v14
- Fixed patch application issues reported by Sashiko
Changes in v14:
- Rebased onto latest bluetooth-next tree
- No functional changes from v13
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 | 74 ++++-- 3 files changed, 485 insertions(+), 25 deletions(-)
Signature · 1 line
2.45.2