Commit Graph
2101 Commits
Author SHA1 Message Date
linruihao 9d4cf4d70c fix(bt/bluedroid): fix crash during bredr inquiry when zero-addr device is found 2026-07-17 10:39:13 +08:00
Jiang Jiang Jian 2dd51a0e75 Merge branch 'bugfix/avrc_ca_attr_id_check_v6.1' into 'release/v6.1'
fix(bt): Fix the validation of AVRCP metadata attr_id in handle_rc_attributes_rsp (v6.1)

See merge request espressif/esp-idf!50549
2026-07-17 10:31:02 +08:00
Jiang Jiang Jian 4fe6db39ca Merge branch 'bugfix/bug_bounty_av_v6.1' into 'release/v6.1'
fix(bt/bluedroid): Fix bug bounty issues about A/V from NVIDIA (v6.1)

See merge request espressif/esp-idf!50476
2026-07-16 18:57:38 +08:00
yangfeng 5af3a74a45 fix(bt): Fix the validation of AVRCP metadata attr_id in handle_rc_attributes_rsp 2026-07-16 14:27:53 +08:00
Jiang Jiang Jian 6cb467a433 Merge branch 'bugfix/fix_bluedroid_read_multi_v6.1' into 'release/v6.1'
fix(ble/bluedroid): fix GATT Read Multiple response handling (6.1)

See merge request espressif/esp-idf!50710
2026-07-16 11:59:11 +08:00
yangfeng 24369a6f81 fix(bt/bluedroid): Fix unchecked p_ctrl_cback and p_msg_cback in AVRC
Closes SEC-1186
2026-07-16 11:30:38 +08:00
yangfeng e8108fefe1 fix(bt/bluedroid): Fix missing NULL check on p_cfg in AVDT_ReconfigReq
Closes SEC-1187
2026-07-16 11:30:38 +08:00
Zhang Hai Peng a6404dcf8d fix(ble/bluedroid): downgrade numeric comparison log to warning
(cherry picked from commit 72a49ed53b)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-07-14 10:37:22 +08:00
Zhang Hai Peng f4c2b75897 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.


(cherry picked from commit 31bd80fee8)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-07-14 10:37:21 +08:00
Zhang Hai Peng 169bf6975b 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.


(cherry picked from commit 1b6f9380f4)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-07-14 10:36:38 +08:00
Zhang Hai Peng be95975fee 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.


(cherry picked from commit 4c0488d92a)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-07-14 10:36:36 +08:00
Zhang Hai Peng 96b27367a1 fix(ble/bluedroid): match read-multiple-var responses by handle
(cherry picked from commit 979c7dc567)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-07-14 10:36:34 +08:00
Zhang Hai Peng 2bb2f01dd3 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.


(cherry picked from commit f91a41510c)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-07-14 10:36:33 +08:00
Jin Cheng e4c999e891 fix(bt/bluedroid): fixed OOB read in PBAP app parameter parsing
Closes SEC-713
2026-07-09 15:44:57 +08:00
Jin Cheng b6a8e896e7 fix(bt/bluedroid): fixed stuck sec_state on authention HCI command send failure
Closes SEC-1164
2026-07-09 15:44:57 +08:00
Jin Cheng 02841cdf50 fix(bt/bluedroid): fixed HID host slot leak on local VUP ACL drop
Closes SEC-1169
2026-07-09 15:44:57 +08:00
Jin Cheng 81c8d1b999 fix(bt/bluedroid): fixed NULL dereference in remote legacy authentication handler
Closes SEC-1143
2026-07-09 15:44:57 +08:00
Jin Cheng a0ba14e55d 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 15:44:57 +08:00
Rahul Tank e44969a390 fix(nimble): Fix ble_chan_sound_reflector compilation issue 2026-07-06 07:52:43 +05:30
Jiang Jiang Jian 25c546c1a8 Merge branch 'bugfix/bbp_issues_v6.1' into 'release/v6.1'
Bugfix/bbp issues v6.1

See merge request espressif/esp-idf!50188
2026-07-03 20:29:55 +08:00
Jiang Jiang Jian f71890ccec Merge branch 'bugfix/ai_review_btu_common_v6.1' into 'release/v6.1'
fix: Fix the critical issues of btu and bt_common from AI review report (v6.1)

See merge request espressif/esp-idf!50121
2026-06-30 17:37:34 +08:00
Jin Cheng 85d56bcd26 fix(bt/bluedroid): fixed possible OOB write in btc_a2dp_sink_handle_inc_media 2026-06-30 14:42:00 +08:00
Jin Cheng 1f3f53d226 fix(bt/bluedroid): fixed possible OOB read/write in process_l2cap_cmd 2026-06-30 14:41:52 +08:00
Jiang Jiang Jian 24d35f4c04 Merge branch 'bugfix/ai_review_a2dp_v6.1' into 'release/v6.1'
fix(bt): Fix the critical issues related to A2DP from AI review report (v6.1)

See merge request espressif/esp-idf!50127
2026-06-30 14:24:19 +08:00
Jiang Jiang Jian b0cd9819ee Merge branch 'bugfix/fix_bluedroid_static_random_conn_rpa_v6.1' into 'release/v6.1'
fix(ble/bluedroid): skip identity conversion for static random direct connect (6.1)

See merge request espressif/esp-idf!50086
2026-06-30 14:23:18 +08:00
Jiang Jiang Jian 6e1ac00adb Merge branch 'feat/add_ble_core_6x_feature_for_bluedroid_v6.1' into 'release/v6.1'
Feat/add ble core 6x feature for bluedroid (6.1)

See merge request espressif/esp-idf!50054
2026-06-30 14:21:41 +08:00
Jiang Jiang Jian 7219860f52 Merge branch 'bugfix/ai_review_avrcp_v6.1' into 'release/v6.1'
fix(bt): Fix the critical and high issues related to AVRCP from AI review report (v6.1)

See merge request espressif/esp-idf!50019
2026-06-30 14:20:16 +08:00
Jiang Jiang Jian e2a7c8b36c Merge branch 'bugfix/ai_review_hfp_v6.1' into 'release/v6.1'
fix(bt): Fix the critical issues related to HFP from AI review report (v6.1)

See merge request espressif/esp-idf!50006
2026-06-30 14:19:53 +08:00
Jiang Jiang Jian 6d69cde133 Merge branch 'bugfix/ag_unknown_codec_v6.1' into 'release/v6.1'
fix(bt): skip unknown codecs when parsing AT+BAC(v6.1)

See merge request espressif/esp-idf!49839
2026-06-30 14:16:32 +08:00
Jiang Jiang Jian 9d36edbe30 Merge branch 'feat/ble-smp-multi-adv-static-random-address_v6.1' into 'release/v6.1'
feat(ble/bluedroid): Add BLE SMP support for multi-ADV with static random addresses (6.1)

See merge request espressif/esp-idf!49790
2026-06-30 14:15:32 +08:00
Jiang Jiang Jian f1a8184bfa Merge branch 'bugfix/bbp_isses_v6.1' into 'release/v6.1'
Bugfix/bbp isses v6.1

See merge request espressif/esp-idf!49623
2026-06-30 14:11:03 +08:00
Jiang Jiang Jian 2841ad761e Merge branch 'fix/add_remaining_vars_to_heap_v6.1' into 'release/v6.1'
fix(nimble): Change remaining vars from Static to Dynamic (v6.1)

See merge request espressif/esp-idf!49279
2026-06-30 14:02:41 +08:00
yangfeng 9517a7b93b 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 14:57:22 +08:00
yangfeng 57f28af482 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:45:46 +08:00
Zhang Hai Peng 59a740ca12 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-06-26 20:24:54 +08:00
Zhang Hai Peng e9fce74445 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-26 20:24:34 +08:00
Zhang Hai Peng 7b2b31bb0d 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-06-26 20:24:16 +08:00
Zhang Hai Peng 54e7b74cc1 fix(ble/bluedroid): Fixed potential double Execute Write Response
(cherry picked from commit 0a93ccd3b3)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-26 20:23:59 +08:00
Zhang Hai Peng f00c216ce2 fix(ble/bluedroid): preserve ATT error on prepare write completion
Skip prepare-write echo validation when the GATT stack reports a
non-success status. ATT Error Response carries no prepare-write echo
body (rsp_len=0), so the check incorrectly overwrote errors such as
GATT_INSUF_AUTHENTICATION (0x05) with GATT_INVALID_PDU (0x04).


(cherry picked from commit d5b9350d0f)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-26 20:23:38 +08:00
Zhang Hai Peng 4bf3d52183 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-06-26 20:16:49 +08:00
Zhang Hai Peng fab51c7925 fix(ble/bluedroid): set REQ_WAITING before GATTC service-change rediscovery
When service change cancels in-progress discovery, bta_gattc_disc_cmpl()
re-triggers discovery without marking auto_update as REQ_WAITING. If a
client command is queued in p_q_cmd, bta_gattc_start_discover() refuses
to restart and the command is never dispatched.


(cherry picked from commit 13926bb9bc)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-26 20:16:32 +08:00
Zhang Hai Peng 50c719356c 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-06-26 20:16:14 +08:00
Zhang Hai Peng 95c5099ed9 fix(ble/bluedroid): add context to GATTC reg-notify cache warning
Include client_if, handle, bd_addr, and server cache state in the
warning logged when notification registration skips handle validation.


(cherry picked from commit 1085a32be8)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-26 20:16:14 +08:00
Zhang Hai Peng feb1da9239 fix(ble/bluedroid): return ESP_ERR_INVALID_ARG for invalid conn params
Return ESP_ERR_INVALID_ARG instead of ESP_FAIL when connection
parameter validation fails


(cherry picked from commit 6c53838e66)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-26 20:16:13 +08:00
Zhang Hai Peng 003a4007e5 fix(ble/bluedroid): reject adv data on legacy directed ext adv
(cherry picked from commit c339cec380)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-26 20:15:54 +08:00
Zhang Hai Peng 2f8c3b6c1a 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-06-26 20:15:35 +08:00
Zhi Wei Jian 85d364da14 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:36 +08:00
Zhi Wei Jian 9a6f769a45 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:35 +08:00
Zhi Wei JianandCursor ecc48e1450 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:35 +08:00
Zhi Wei Jian 8a8727cfba 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:34 +08:00