Commit Graph
671 Commits
Author SHA1 Message Date
Zhi Wei Jian e97d59c545 docs(ble/bluedroid): note ISO BIG HCI alloc failure not checked
(cherry picked from commit 34b59d30ae)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-07-21 10:28:15 +08:00
Zhi Wei Jian 932da59cb4 fix(ble/bluedroid): fix direct-connect cleanup and adv bounds
(cherry picked from commit 82e71c1767)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-07-21 10:28:07 +08:00
Zhi Wei Jian f006758550 fix(ble/bluedroid): validate BLE confirm/OOB and sec-check device
(cherry picked from commit 93ab11d564)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-07-21 10:28:00 +08:00
Zhi Wei Jian 0314335eb6 fix(ble/bluedroid): validate SMP pair-fail reason and OOB device
(cherry picked from commit 98efe02385)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-07-21 10:27:52 +08:00
Zhi Wei Jian 91b305b663 fix(ble/bluedroid): route ATT indication-conf timeout separately
(cherry picked from commit 6c3267ee84)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-07-21 10:27:44 +08:00
Zhi Wei Jian 111c68776d fix(ble/bluedroid): validate ATT PDU sizes
(cherry picked from commit bb00b9817d)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-07-21 10:27:33 +08:00
Zhi Wei Jian 8eb01128f8 fix(ble/bluedroid): re-lookup GATT TCB after enc-complete callback
(cherry picked from commit 37562af0ea)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-07-21 10:27:25 +08:00
Zhi Wei Jian 30a8c37942 fix(ble/bluedroid): fix GATT long read and Service Changed CCC
(cherry picked from commit 4ce692ac0c)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-07-21 10:27:17 +08:00
Zhi Wei Jian e35311d351 fix(ble/bluedroid): validate GATT client discovery handles
(cherry picked from commit ac35ae6f2d)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-07-21 10:27:05 +08:00
Zhi Wei Jian 7c850b6031 fix(ble/bluedroid): cap Read By Type length and free failed service decl
(cherry picked from commit 27ff0cf8c7)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-07-21 10:26:56 +08:00
Zhi Wei Jian ff3f650a10 fix(ble/bluedroid): guard GATT database hash and serialization
(cherry picked from commit 995c1508e8)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-07-21 10:26:44 +08:00
Zhi Wei Jian 6db42b6334 fix(ble/bluedroid): fix GATT server busy errors and sr_cmd handling
(cherry picked from commit f86739b03d)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-07-21 10:26:35 +08:00
Zhi Wei Jian 4779dec633 fix(ble/bluedroid): fix GATT teardown and service-change flow
(cherry picked from commit 0645ba469d)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-07-21 10:26:27 +08:00
Zhi Wei Jian b1b015187f fix(ble/bluedroid): fix GATT service lifecycle leaks
(cherry picked from commit ac93d94958)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-07-21 10:26:19 +08:00
Zhi Wei Jian 0eccb599fe fix(ble/bluedroid): add GATT resource-cleanup helpers
(cherry picked from commit b83327f3ca)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-07-21 10:26:11 +08:00
Zhi Wei Jian c055e45c8f feat(ble/bluedroid): Support bluedroid LE COC and EATT features
(cherry picked from commit 83f0831c53)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-07-21 10:25:58 +08:00
Island 0196f65f01 Merge branch 'bugfix/fix_bluedroid_static_random_conn_rpa_v5.5' into 'release/v5.5'
fix(ble/bluedroid): skip identity conversion for static random direct connect (5.5)

See merge request espressif/esp-idf!50084
2026-07-20 21:39:24 +08:00
Island 12ac2416be Merge branch 'feat/add_ble_core_6x_feature_for_bluedroid_v5.5' into 'release/v5.5'
Feat/add ble core 6x feature for bluedroid (5.5)

See merge request espressif/esp-idf!50052
2026-07-20 15:05:36 +08:00
Wang Meng Yang ee9e08ddd9 Merge branch 'bugfix/bug_bounty_av_v5.5' into 'release/v5.5'
fix(bt/bluedroid): Fix bug bounty issues about A/V from NVIDIA (v5.5)

See merge request espressif/esp-idf!50478
2026-07-20 14:56:39 +08:00
Wang Meng Yang 839df7e697 Merge branch 'bugfix/avrc_ca_attr_id_check_v5.5' into 'release/v5.5'
fix(bt): Fix the validation of AVRCP metadata attr_id in handle_rc_attributes_rsp (v5.5)

See merge request espressif/esp-idf!50551
2026-07-20 14:56:06 +08:00
Wang Meng Yang 31e6b62389 Merge branch 'bugfix/ai_review_avrcp_v5.5' into 'release/v5.5'
fix(bt): Fix the critical and high issues related to AVRCP from AI review report (v5.5)

See merge request espressif/esp-idf!50021
2026-07-20 09:06:53 +08:00
Wang Meng Yang eae640068e Merge branch 'bugfix/ai_review_btu_common_v5.5' into 'release/v5.5'
fix: Fix the critical issues of btu and bt_common from AI review report (v5.5)

See merge request espressif/esp-idf!50123
2026-07-20 09:05:33 +08:00
Wang Meng Yang 071970e478 Merge branch 'bugfix/smp_sec_flags_v5.5' into 'release/v5.5'
fix(bt/bluedroid): fixed several security issues from NVIDIA (v5.5)

See merge request espressif/esp-idf!50567
2026-07-19 13:16:19 +08:00
Wang Meng Yang df95e83bfa Merge branch 'bugfix/bbp_issues_v5.5' into 'release/v5.5'
Bugfix/bbp issues v5.5

See merge request espressif/esp-idf!50190
2026-07-19 12:46:06 +08:00
yangfeng b7d0ef96a7 fix(bt/bluedroid): Fix unchecked p_ctrl_cback and p_msg_cback in AVRC
Closes SEC-1186
2026-07-19 10:10:59 +08:00
yangfeng 31d51adf4f fix(bt/bluedroid): Fix missing NULL check on p_cfg in AVDT_ReconfigReq
Closes SEC-1187
2026-07-19 10:10:59 +08:00
yangfeng b195d90679 fix(bt): Fix the validation of AVRCP metadata attr_id in handle_rc_attributes_rsp 2026-07-19 10:08:59 +08:00
linruihao 817d132ed0 fix(bt/bluedroid): fix crash during bredr inquiry when zero-addr device is found 2026-07-17 10:39:24 +08:00
zhanghaipeng 7f60576477 fix(ble/bluedroid): match read-multiple responses by handle
Read Multiple may mix stack auto-responses with app async responses,
so multi_rsp_q order can differ from the request handle order. Look up
each response by handle (with occurrence for duplicates) instead of
walking the queue by index, and treat opcode-only buffers as empty.
2026-07-15 15:48:46 +08:00
zhanghaipeng e76bd7359c fix(ble/bluedroid): match read-multiple-var responses by handle 2026-07-15 15:48:46 +08:00
zhanghaipeng 11bdcf8294 fix(ble/bluedroid): use sr_cmd status for GATT server error rsp
When sending an ATT error response after a failed server operation,
use p_tcb->sr_cmd.status instead of the last app callback status so
invalid error code 0x00 is not sent to the peer.
2026-07-15 15:48:46 +08:00
zhanghaipeng 0e6508a8fc fix(ble/bluedroid): reject invalid ATT error code 0x00 on client
Map received error reason 0x00 to GATT_UNKNOWN_ERROR so the client
does not report GATT_SUCCESS with zero-length data on malformed errors.
2026-07-15 15:48:46 +08:00
zhanghaipeng f6f289689a fix(ble/bluedroid): preserve ext adv state when set params fails
Only update extend_adv_cb after HCI Set Extended Advertising
Parameters succeeds, so a failed update does not corrupt cached
legacy_pdu and related fields used by adv data validation.
2026-07-15 15:48:46 +08:00
zhanghaipeng 1dffcb5560 fix(ble/bluedroid): downgrade numeric comparison log to warning 2026-07-15 15:48:46 +08:00
Zhang Hai Peng 01d1dd63bf fix(ble/bluedroid): preserve HCI status on BLE 4.2 GAP failures
Return BTM_HCI_ERROR | hci_status from legacy BLE 4.2 GAP HCI command
paths instead of mapping failures to BTM_ILLEGAL_VALUE or
BTM_NO_RESOURCES. Add btm_ble_status_from_hci() helper and propagate
real status through scan start/stop completion callbacks.


(cherry picked from commit 47dd785a18)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-07-15 15:48:46 +08:00
Zhang Hai Peng f81903c050 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-07-15 15:48:46 +08:00
Zhang Hai Peng ff703331ef fix(ble/bluedroid): cap Read By Type response length at ATT maximum
Read By Type Response Length is one octet (max 255). When MTU was
large enough to return a long characteristic value in one pair, the
server wrote (UINT8)(value_len + 2) and overflowed (e.g. 513 -> 1),
so the client rejected the PDU as GATT_INVALID_PDU (0x04).

Cap server value to 253 bytes per pair, clamp the length byte, and
continue long reads via Read Blob when the capped size is returned.


(cherry picked from commit 97905afccc)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-07-15 15:48:46 +08:00
Zhang Hai Peng 9da5a3a312 fix(ble/bluedroid): Fixed potential double Execute Write Response
(cherry picked from commit 0a93ccd3b3)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-07-15 15:48:46 +08:00
Zhang Hai Peng bf03277906 fix(ble/bluedroid): unblock sync HCI cmd on Command Status error
Release the BLE sync semaphore and record HCI status when a
synchronous command is rejected via Command Status, since no
Command Complete event follows.


(cherry picked from commit 29ae92f4ef)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-07-15 15:48:46 +08:00
Zhang Hai Peng f789848cc5 fix(ble/bluedroid): report conn param update failure for unknown BD_ADDR
Route unknown BD_ADDR and other immediate failures through the existing
need_cb path so ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT is always delivered.


(cherry picked from commit f9eaeb5e84)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-07-15 15:48:46 +08:00
Zhang Hai Peng 6cc2ca2660 fix(ble/bluedroid): reject adv data on legacy directed ext adv
(cherry picked from commit c339cec380)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-07-15 15:48:46 +08:00
Zhang Hai Peng 81af206881 fix(ble/bluedroid): skip identity conversion for static random direct connect
Do not rewrite static or non-resolvable random peer addresses to
identity type 0x03 when CONFIG_BT_BLE_RPA_SUPPORTED is enabled.


(cherry picked from commit 2ef10ef488)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-07-15 15:48:46 +08:00
Jin Cheng ff580a167f fix(bt/bluedroid): fixed stuck sec_state on authention HCI command send failure
Closes SEC-1164
2026-07-09 17:10:51 +08:00
Jin Cheng 1ef83cc8db fix(bt/bluedroid): fixed NULL dereference in remote legacy authentication handler
Closes SEC-1143
2026-07-09 17:10:51 +08:00
Jin Cheng 649c45b02d fix(bt/bluedroid): fixed wrong link key flag cleared on legacy BR/EDR authentication failure
Stale bond trust state cound remain after authenticaion failure, causing
incorrect bond status and link key auto-reply behavior.

Closes SEC-1153
2026-07-09 17:10:51 +08:00
Jin Cheng 99aee96317 fix(bt/bluedroid): fixed possible OOB read/write in process_l2cap_cmd 2026-06-30 15:07:02 +08:00
yangfeng be3696cf1c 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:49:08 +08:00
Zhi Wei Jian b02a682ff5 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:26 +08:00
Zhi Wei Jian c7fc14a076 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:26 +08:00
Zhi Wei JianandCursor 28c67947f4 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:25 +08:00