Commit Graph
510 Commits
Author SHA1 Message Date
linruihao d783f9f02d fix(bt/bluedroid): check HFP audio status before forwarding SCO data 2026-09-17 09:32:45 +08:00
Island 5ac710ee56 Merge branch 'feat/ble_smp_repairing_hardening_v6.0' into 'release/v6.0'
feat(ble/bluedroid): add Kconfig options for BLE re-pairing hardening (6.0)

See merge request espressif/esp-idf!52421
2026-09-15 14:12:07 +08:00
Island 602c154453 Merge branch 'feat/support_pawr_connect_evt_v6.0' into 'release/v6.0'
feat(ble/bluedroid): Support PAWR connection event (6.0)

See merge request espressif/esp-idf!51442
2026-09-15 14:12:05 +08:00
Jin Cheng b40d860987 fix(bt/bluedroid): fixed OOB read dring mSBC sync word check 2026-09-15 09:34:13 +08:00
hejiaxin f43561e692 fix(bt_hfp): Fix some bugs in hfp
- Fix hfp callback data length
- Fix the solution of unknown AT command
2026-09-11 17:25:51 +08:00
Zhang Hai Peng a7e56b0fac fix(bt/bluedroid): prefer disconnected peers when evicting overflow bonds
When the bond list is full, drop the oldest disconnected device instead
of the oldest NVS entry, and allow a per-bond except flag so selected
devices are never auto-removed.


(cherry picked from commit bf86892eef)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-09-09 14:25:55 +08:00
Wang Meng Yang 70d938445d Merge branch 'fix/aireview_pbap_v6.0' into 'release/v6.0'
fix(bt_pbap): Fix some bugs in bluedroid PBAP (v6.0)

See merge request espressif/esp-idf!51728
2026-09-06 11:26:03 +08:00
hejiaxin 340ce2b338 fix(bt_pbap): Fix some bugs in bluedroid PBAP
- Add sdp_seq to avoid p_ccb being free during sdp
- Changed some BTA_Pba functions to return non-void value
- Improve error catching and report
- Refactor bta_pba_client_response to avoid UAF problem
- Rearrange btc_pba_client init flag to avoid some disturbing bug
2026-09-04 11:55:05 +08:00
Zhi Wei Jian 2bada5b678 feat(ble/bluedroid): reject LE re-pairing that weakens an existing bond
Add smp_repairing_is_allowed() behind BT_BLE_SMP_HARDENED_REPAIRING so a
peer cannot replace an existing bond with one that has less MITM
protection, no Secure Connections, or a shorter key. Compare a preceding
Security Request against the pairing command AuthReq, not the
association-model result, and always allow first pairing.

A refusal keeps the stored bond. Pairing-failure erase is split by link
role: default is erase as Central and keep as Peripheral.

Closes BLERP (NDSS 2026) V3, V4 and V6.


(cherry picked from commit 88ea45be73)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-09-04 11:03:52 +08:00
liqigan 822f1617bf change(bt/bluedroid): Used dynamic osi event to reduce lock cost 2026-09-04 09:41:19 +08:00
liqigan 1dcaf24129 fix(bt/bluedroid): Fixed HID host reconnection bug and enabled load HID devices
Closes https://github.com/espressif/esp-idf/issues/18335
2026-09-04 09:32:58 +08:00
liqigan 20757b7933 change(bt/bluedroid): Refactored HID host datapath 2026-09-04 09:32:58 +08:00
Jiang Jiang Jian 13c5832753 Merge branch 'fix/aireview_critical_v6.0' into 'release/v6.0'
fix: Fix some critical bugs in classic bt (v6.0)

See merge request espressif/esp-idf!51289
2026-09-03 19:50:40 +08:00
yangfeng 991ee96741 fix(bluedroid): Fix the compilation issue of BCM_STRNCPY_S 2026-08-13 19:16:03 +08:00
Zhi Wei Jian 551c40ed07 feat(ble/bluedroid): Support PAWR connection event
(cherry picked from commit 7da7fa42ac)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-08-03 15:26:01 +08:00
hejiaxin 7f42eabb08 fix(bt_stack): Fix some critical bugs in classic_bt stack
related: obex, smp, pbap, sdp, rfcomm, stack_dm

- Deinit function doesn't delete connection when OBEX_DYNAMIC_MEMORY is on
- Union tGOEPC_DATA sometimes is free by osi_free in some cases when it contains mtu_id
- Add correct free and return solution after fail
- Fix symbol mistake in mod calculation
- Fix pointer-related UAF problems and memory free problems
- Fix buffer overflows and out-of-bounds access
- Fix infinite loops triggered by integer overflow wraparound
- Fix double free
- Change layer_specific usage to avoid heap overflow
- Add some NULL check for pointers
- Fix sdp_db free function
- Fix state table mismatch
2026-07-29 17:05:31 +08:00
Jin Cheng fdcb70e608 fix(bt/bluedroid): fixed issues from AI review in GAP, SPP, HID, L2CAP and HCI 2026-07-23 07:42:23 +08:00
Wang Meng Yang e743ff2a10 Merge branch 'bugfix/smp_sec_flags_v6.0' into 'release/v6.0'
fix(bt/bluedroid): fixed several security issues from NVIDIA (v6.0)

See merge request espressif/esp-idf!50566
2026-07-17 20:04:33 +08:00
Zhi Wei Jian 1ade9c6f0e feat(ble/bluedroid): Support bluedroid dual identity
(cherry picked from commit 2358786647)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-07-14 14:17:33 +08:00
Zhi Wei Jian 87d614ba91 feat(ble/bluedroid): Support bluedroid LE COC and EATT features
(cherry picked from commit 83f0831c53)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-07-14 11:56:06 +08:00
Jin Cheng 9f8306be2b fix(bt/bluedroid): fixed OOB read in PBAP app parameter parsing
Closes SEC-713
2026-07-09 16:30:10 +08:00
Jin Cheng 0bbc59738a fix(bt/bluedroid): fixed HID host slot leak on local VUP ACL drop
Closes SEC-1169
2026-07-09 16:30:10 +08:00
Wang Meng Yang b1f7a5b8b8 Merge branch 'bugfix/sdp_null_access_v6.0' into 'release/v6.0'
fix(bt/bluedroid): fixed SDP deinit race with pending callbacks (v6.0)

See merge request espressif/esp-idf!48895
2026-07-08 12:42:23 +08:00
Wang Meng Yang 967825b6e2 Merge branch 'bugfix/bbp_issues_v6.0' into 'release/v6.0'
Bugfix/bbp issues v6.0

See merge request espressif/esp-idf!50189
2026-07-06 11:16:54 +08:00
Wang Meng Yang 5f4062d827 Merge branch 'bugfix/ai_review_btu_common_v6.0' into 'release/v6.0'
fix: Fix the critical issues of btu and bt_common from AI review report (v6.0)

See merge request espressif/esp-idf!50122
2026-06-30 19:25:09 +08:00
Jin Cheng 0d118139ff fix(bt/bluedroid): fixed possible OOB write in btc_a2dp_sink_handle_inc_media 2026-06-30 14:43:00 +08:00
Jiang Jiang Jian d40f9586c5 Merge branch 'bugfix/ai_review_a2dp_v6.0' into 'release/v6.0'
fix(bt): Fix the critical issues related to A2DP from AI review report (v6.0)

See merge request espressif/esp-idf!50128
2026-06-30 12:03:32 +08:00
Jin Cheng f3230cae05 fix(bt/bluedroid): fixed SDP deinit race with pending callbacks
Cancel any active SDP search during disabling and mark the BTA SDP
callbacks inactive so late search completions are not propagated
after deinit. Guard BTC side SDP completion handling after cleanup
to avoid null references.
2026-06-30 11:57:31 +08:00
Zhang Hai Peng 005e8029a9 feat(ble/bluedroid): Optimize Bluedroid memory usage
- Delete unused device records (~356B each)


(cherry picked from commit 7d1c0e9a32)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-29 19:04:29 +08:00
Island 0ced163703 Merge branch 'feat/add_ble_core_6x_feature_for_bluedroid_v6.0' into 'release/v6.0'
Feat/add ble core 6x feature for bluedroid (6.0)

See merge request espressif/esp-idf!50053
2026-06-29 17:59:32 +08:00
Jiang Jiang Jian f02fad8ce1 Merge branch 'bugfix/ai_review_avrcp_v6.0' into 'release/v6.0'
fix(bt): Fix the critical and high issues related to AVRCP from AI review report (v6.0)

See merge request espressif/esp-idf!50020
2026-06-29 15:43:53 +08:00
Jiang Jiang Jian 965ebfce03 Merge branch 'bugfix/ai_review_hfp_v6.0' into 'release/v6.0'
fix(bt): Fix the critical issues related to HFP from AI review report (v6.0)

See merge request espressif/esp-idf!50007
2026-06-29 15:43:38 +08:00
Jiang Jiang Jian c1aeac2888 Merge branch 'bugfix/fix_bluedroid_ai_review_bugs_20260427_v6.0' into 'release/v6.0'
Bugfix/fix bluedroid ai review bugs 20260427 (6.0)

See merge request espressif/esp-idf!49541
2026-06-29 15:39:47 +08:00
yangfeng fe06f59a88 fix(bt): Fix the critical issues related to A2DP from AI review report
AVDT:
- Roll back CCB allocation when cmd/rsp queue creation fails
- Free media packet on invalid handle in AVDT_WriteReqOpt
- Zero-init timeout failure message before GETCAP callback
- Initialize lcid_tbl to 0xFF to avoid mapping to tc_tbl[0]
BTA/AVRCP:
- Use size_t for AVRC message copy buffer allocation
- Allocate before register in BTA_AvEnable
- Guard BTA_AvRegister callback when enable never completed
- Remove invalid free of inline Cover Art image_descriptor
A2DP BTC/API:
- Default g_a2dp_on_deinit to true before profile init
- Reject source audio send when A2DP is deiniting
- Add shutdown state check in btc_a2dp_sink_shutdown
- Guard A2DP source timer against freed dynamic local param
2026-06-29 15:00:49 +08:00
yangfeng 84e210df45 fix: Fix the critical issues of btu and bt_common from AI review report
- advance connect queue on synchronous connect_cb failure
- lock bta_alarm_hash_map in all BTA timer APIs
- free controller params after stack disable; cleanup on init fail
- handle BTE_InitStack failure and signal init future
- validate HCI remote name event length before parse
- drop stale L2CAP quick-timer alarm events
2026-06-29 14:46:01 +08:00
Zhi Wei Jian 4536a24c4c feat(ble/bluedroid): add CS Security Requirements host support (Core 6.3)
(cherry picked from commit 919622c01c)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-06-26 09:08:31 +08:00
Zhi Wei Jian 9fb8579038 feat(ble/bluedroid): add LE UTP host support (Core 6.2)
(cherry picked from commit 3844e24207)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-06-26 09:08:31 +08:00
Zhi Wei JianandCursor ae3f98e78d feat(ble/bluedroid): add Shorter Connection Intervals host support (Core 6.2)
Co-authored-by: Cursor <cursoragent@cursor.com>


(cherry picked from commit 2a8a96d650)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-06-26 09:08:30 +08:00
Zhi Wei Jian 78257b3e96 feat(ble/bluedroid): add LL Extended Feature Set host support (Core 6.0)
(cherry picked from commit d568f2f151)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-06-26 09:08:29 +08:00
Zhi Wei JianandCursor e23d745b76 feat(ble/bluedroid): add Frame Space Update host support (Core 6.0)
Co-authored-by: Cursor <cursoragent@cursor.com>


(cherry picked from commit 5372ce03a3)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-06-26 09:08:29 +08:00
Zhi Wei Jian 0ad5f22cfa feat(ble/bluedroid): add DBAF host support (Core 6.0)
(cherry picked from commit e20d3f0197)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-06-26 09:08:28 +08:00
yangfeng e27d9efe13 fix(bt): Fix the high issues related to AVRCP from AI review report
- SDP/registration: handle SDP record creation and discovery failures safely
- AVRC stack: fix packet checks, fragment leaks, response build, and compile guards
- BTC AVRCP: fix return codes, connection state, metadata parsing, and memory leaks
- AVCTP: fix event passing, L2CAP conflicts, TX queue leaks, and disconnect handling
- Example: remove TG RN capability setup before initialization
2026-06-25 14:48:50 +08:00
yangfeng a3f1ba390e fix(bt): Fix the critical issues related to HFP from AI review report
HFP AG:
- Fix mSBC EV3 second-packet payload length calculation to prevent OOB read and infinite loop
- Add init/deinit guards in HF AG helper functions to avoid NULL deref
- Return bt_status_t from btc_hf_ag_audio_data_send to avoid silent buffer leak on SLC failure
- Break SCO CI data loop when SCO is not open to prevent CPU starvation
- Guard BTM_FreeSCN(0) and reset SCN after free in bta_ag_del_records
- Use OI_UINT32 for mSBC decode frame length to avoid stack corruption
- Bound AT Dial command string copy to BTA_AG_AT_MAX_LEN
HFP Client:
- Check osi_calloc result before use when reassembling split mSBC frames
- Use OI_UINT32 for mSBC decode frame length to avoid stack corruption
- Free SDP db, collision/AT timers and queued AT cmds before scb reset on disable
- Fix mSBC EV3 second-packet payload length calculation (same as AG)
- Reject pcm_resample input smaller than overlap window (96 bytes) on filtered path
- Break SCO CI data loop when SCO is not open to prevent CPU starvation
- Guard BTM_FreeSCN(0) and reset SCN after free in bta_hf_client_del_record
2026-06-25 12:08:06 +08:00
Zhi Wei Jian cebf129df8 fix(ble/bluedroid): fix CTE and ISO API validation
(cherry picked from commit 0c3c894b7d)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-06-10 19:54:00 +08:00
Zhi Wei Jian b60fe364f0 fix(ble/bluedroid): fix GATT server lifecycle and callbacks
(cherry picked from commit 54a1e31916)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-06-10 19:54:00 +08:00
Zhi Wei Jian 349b4cf8a9 fix(ble/bluedroid): fix GATT client cache and service discovery
(cherry picked from commit b3ff15ed31)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-06-10 19:53:59 +08:00
Zhi Wei Jian 638e633e04 fix(ble/bluedroid): fix GAP BLE API parameter validation
(cherry picked from commit e3311c81c4)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-06-10 19:53:59 +08:00
Zhi Wei Jian b464721a8d fix(ble/bluedroid): fix BLE bonding key storage validation
(cherry picked from commit 62cdd4ac38)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-06-10 19:53:58 +08:00
Zhang Hai Peng b15b2547a3 fix(ble/bluedroid): Propagate create_attr_tab BTA failures in inter_cb
(cherry picked from commit 4f8027da11)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-02 10:24:01 +08:00
Zhang Hai Peng 962e6b483c fix(ble/bluedroid): Validate signed-write perm vs AUTH in attr table check
(cherry picked from commit fce3fa337a)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-02 10:24:00 +08:00