Commit Graph
100 Commits
Author SHA1 Message Date
Zhang Hai Peng 2ba13dabe0 docs(ble/bluedroid): fix markdown formatting in example docs
(cherry picked from commit dba450de6b)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-07-15 15:41:34 +08:00
Zhang Hai Peng 58a777febf 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:04 +08:00
Zhang Hai Peng f6f9236099 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:02 +08:00
Zhang Hai Peng 0b0eaf2db4 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:03 +08:00
Zhang Hai Peng 01066c125b 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:03 +08:00
Zhang Hai Peng 2fe6c39b83 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:02 +08:00
Zhang Hai Peng bc4889662b 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:01 +08:00
zhanghaipeng f582365c84 fix(bt): update ESP32 libbtdm_app.a to 4a0f94d5
- Fix connection failure when using RPA with whitelist filtering
- Fix disconnect with reason 0x08 during full scan
- Fix peer RPA resolution failure when advertising with a local identity address
2026-06-29 10:43:57 +08:00
Zhang Hai Peng 1824570f90 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:46 +08:00
Zhang Hai Peng b416e7f61b 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:24 +08:00
Zhang Hai Peng 1130ad21f8 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:07 +08:00
Zhang Hai Peng 6ac3fd1a18 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:50 +08:00
Zhang Hai Peng 7400a89196 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:28 +08:00
Zhang Hai Peng ee46100f53 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:40 +08:00
Zhang Hai Peng 47d267a365 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:22 +08:00
Zhang Hai Peng fd6a76d00d 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:03 +08:00
Zhang Hai Peng f052415e45 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:03 +08:00
Zhang Hai Peng 2888b48bea 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:02 +08:00
Zhang Hai Peng 96bac63edb 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:45 +08:00
Zhang Hai Peng d9300e1364 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:26 +08:00
Zhang Hai Peng e0e3448f44 feat(ble/bluedroid): Add BLE SMP support for multi-ADV with static random addresses
(cherry picked from commit 7986e2faa8)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-18 10:24:47 +08:00
Zhang Hai Peng 4db65d5f4c refactor(bt): migrate bt_hci_to_btsnoop to esp-pylib
Replace argparse with rich-click and use esp_pylib.logger for
standardized console output and fatal error handling.


(cherry picked from commit 3a7896f2c5)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-16 15:34:02 +08:00
Zhang Hai Peng d801952d8c fix(bt): Suppress gattc drop-notif warning for unregistered gatt_if
GATT stack broadcasts notifications to every client app, so unregistered
gatt_if instances were flooding logs even when another app had registered
the handle. Only warn when no client app registered for the handle.


(cherry picked from commit c18c8dc5e7)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-10 15:24:34 +08:00
Zhang Hai Peng 475844bf0a 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:23:54 +08:00
Zhang Hai Peng 2dd2dd4fae 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:23:53 +08:00
Zhang Hai Peng 1692cf9f72 docs(bt): clarify BLE TX power priority and granularity
(cherry picked from commit 4ab49f267b)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-02 10:23:27 +08:00
Zhang Hai Peng e4bb039f41 docs(bt): clarify GATT client auth_req may trigger SMP
(cherry picked from commit 43734e7d7b)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-02 10:23:26 +08:00
Zhang Hai Peng 8caed9e760 docs(bt/bluedroid): add usage note for esp_ble_get_cur_sendable_packets_num
(cherry picked from commit 27fc241384)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-02 10:23:26 +08:00
Zhang Hai Peng 9d26066c14 feat(ble/bluedroid): add auto-setting for is_aux parameter in esp_ble_gattc_enh_open
(cherry picked from commit 1a9f2af505)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-02 10:23:25 +08:00
Zhang Hai Peng e35f6123fc doc(ble/bluedroid): clarify callback notes to avoid time-consuming ops
(cherry picked from commit 4590b4bb34)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-02 10:23:25 +08:00
Zhang Hai Peng 894c68bf70 fix(ble/bluedroid): Ensure HIGH_DUTY_ADV_INTERVAL config is applied in stack
(cherry picked from commit 82c5c1fef3)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-02 10:23:24 +08:00
Zhang Hai Peng 71fc9347ed fix(bt): Add default BLE controller funcs reset enable
(cherry picked from commit 7c1cb4b296)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-02 10:14:17 +08:00
Zhang Hai Peng 9d3f572a93 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(51d9dfde)
- improve coded PHY performance under Wi-Fi coexistence


(cherry picked from commit 8da824cd0e)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-05-28 11:24:19 +08:00
Zhang Hai Peng 4cec3f28c2 fix(bt/bluedroid): validate handle in esp_ble_gattc_register_for_notify
(cherry picked from commit aa29772cbe1ec0fb1c5c6629dc5bf333a0194198)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-05-15 11:03:51 +08:00
Zhang Hai Peng bab9c7e569 feat(ble): Support BLE critical logs
(cherry picked from commit 0af57d731c)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-05-14 14:23:36 +08:00
Zhang Hai Peng 0b432f5a9f fix(bluedroid): correct format specifier in BLE create CIS debug log
(cherry picked from commit 519131a671)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-05-14 14:23:36 +08:00
Zhang Hai Peng fae52f14e8 feat(ble/blufi): Support setting BLE encryption for blufi
(cherry picked from commit 60a028fb17)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-05-12 15:58:55 +08:00
zhanghaipeng 98312614ba fix(ble): Optimize connection interval minimum parameter check 2026-05-11 11:20:29 +08:00
Zhang Hai Peng f1bb08c6c7 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(2f683593)
- Fixed read remote feature timeout when using coded phy
- Fixed disconnection issue(0x08) when using 125k coded phy
- Fixed disconnection issue(0x08) when updating connection param
- Fixed disconnection issue(0x08) when using multi connection
- Avoid error when adding duplicate device to whitelist
- Support disable channel assessment by vendor hci
- Support smaller connection interval (3.75 ms)
- Support duplicate exception list in EVT ADV


(cherry picked from commit 658ff8730b)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-04-29 14:53:24 +08:00
Zhang Hai Peng 355005a69b fix(bt/bluedroid): fix BLE SMP pairing failure on BLE-only devices when using default param
(cherry picked from commit 74a053bd4e)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-04-21 11:53:57 +08:00
Zhang Hai Peng a5aaeed01a fix(ble): Fixed BLE assert in "emi.c" when low memory
(cherry picked from commit e3aac6f703)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-03-23 17:53:15 +08:00
Zhang Hai Peng e81cca4f2f feat(examples/bluedroid): add BLE ACL latency measurement example
(cherry picked from commit 934970a06f)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-01-06 10:34:53 +08:00
zhanghaipeng ab80b04847 feat(ble/bluedroid): add periodic advertising create sync retry mechanism 2026-01-06 10:34:53 +08:00
zhanghaipeng 05376b61e1 fix(ble/hci): Fix OOB read in ble_adv_scan_combined example 2026-01-06 10:34:53 +08:00
Zhang Hai Peng 83132234ca docs(ble): add flow diagrams to bluedroid BLE examples
(cherry picked from commit 051077835c)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-01-06 10:34:53 +08:00
Zhang Hai Peng 204d383817 refactor(examples/bluedroid): Replace hardcoded ADV type values with macros
(cherry picked from commit fdeb5ad87a)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-01-06 10:34:53 +08:00
Zhang Hai Peng 1bfb20d677 fix(bt/osi): add NULL check in osi_mutex_free and osi_sem_free (IDFGH-16853)
(cherry picked from commit 8630040602)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-01-06 10:34:53 +08:00
Zhang Hai Peng f1c9541975 fix(bt/bluedroid): fix UAF in bta_gattc_enqueue for search service command
(cherry picked from commit 6196298750)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-01-06 10:34:53 +08:00
Zhang Hai Peng e4a3afc445 feat(examples/bluedroid): Add BLE time interval conversion macros for better readability
Add macros to convert time values from milliseconds to BLE interval units:
- ESP_BLE_GAP_ADV_ITVL_MS: Convert advertising interval (0.625ms unit)
- ESP_BLE_GAP_SCAN_ITVL_MS: Convert scan interval (0.625ms unit)
- ESP_BLE_GAP_SCAN_WIN_MS: Convert scan window (0.625ms unit)
- ESP_BLE_GAP_CONN_ITVL_MS: Convert connection interval (1.25ms unit)
- ESP_BLE_GAP_PERIODIC_ADV_ITVL_MS: Convert periodic adv interval (1.25ms unit)
- ESP_BLE_GAP_SUPERVISION_TIMEOUT_MS: Convert supervision timeout (10ms unit)

(cherry picked from commit 7cd2f7b34d)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-01-06 10:34:53 +08:00
Zhang Hai Peng 9ffa95ca00 feat(ble/bluedroid): Increase maximum notify/indication registration count
(cherry picked from commit b6aed7e1c8)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-01-06 10:34:53 +08:00
Zhang Hai Peng 76848b99e0 fix(ble/bluedroid): Fix multiple out-of-bounds read vulnerabilities in GATT PDU handlers
(cherry picked from commit 643d9c2387)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-01-06 10:34:53 +08:00
Zhang Hai Peng d429b3db30 fix(ble/bluedroid): Fix out-of-bounds read in l2cble_process_sig_cmd
(cherry picked from commit 93cfbb8522)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-01-06 10:34:53 +08:00
Zhang Hai Peng 4e2615bead fix(ble/bluedroid): Fix integer underflow in gatt_process_read_by_type_rsp
(cherry picked from commit 597fc6e5c1)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-01-06 10:34:53 +08:00
Zhang Hai Peng 86153bc133 fix(bt): fix BLE security issue in controller and HCI packet parser
(cherry picked from commit a721e94a0f)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-01-06 10:34:53 +08:00
Zhang Hai Peng 4b4e0427f9 fix(ble/bluedroid): Added security check in example Bluedroid_GATT_Server
(cherry picked from commit a36bf7fe14)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-01-06 10:34:53 +08:00
zhanghaipeng 33985967b7 fix(ble/bluedroid): Fix array index in set_periodic_adv_subevt_data 2026-01-05 10:22:24 +08:00
zhanghaipeng 7c505ccfd0 fix(ble/bluedroid): Remove duplicate filter_policy in ext_conn_v2 HCI cmd 2026-01-05 10:22:14 +08:00
zhanghaipeng 2d44222486 fix(ble/bluedroid): Fix heap buffer overflow in BTC_GAP_BLE_SET_PA_SUBEVT_DATA deep copy 2026-01-05 10:22:02 +08:00
zhanghaipeng 4c15d43cff fix(ble/bledroid): fix codespell issues in bluedroid code 2025-12-15 14:21:54 +08:00
Zhang Hai Peng 17174fd729 fix(ble/bluedroid): Add bounds check in ble_ancs example
(cherry picked from commit 7e876249df)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-12-12 20:56:25 +08:00
Zhang Hai Peng 95c2f0a449 fix(ble/bluedroid): Fix security issues in GATT module
(cherry picked from commit f502b2aab1)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-12-03 11:54:05 +08:00
Zhang Hai Peng 6f073edcdd fix(ble/bluedroid): Fix security issues in HCI module
(cherry picked from commit b163685c06)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-12-03 11:54:04 +08:00
Zhang Hai Peng fb46bd220b fix(ble/bluedroid): Fix security issues in GAP module
(cherry picked from commit 1ed5a4465d)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-12-03 11:54:04 +08:00
Zhang Hai Peng f8603177c1 fix(ble/bluedroid): Add length check in prepare write response
(cherry picked from commit b03ff3cf21)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-12-03 11:54:03 +08:00
Zhang Hai Peng a73678a637 fix(ble/bluedroid): Add boundary check for adv_handle in btm_ble_adv_set_terminated_evt
(cherry picked from commit d2baf3b0d4)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-12-03 11:54:03 +08:00
Zhang Hai Peng a19f21b7ba fix(ble/bluedroid): Fix VLA in a2dp_gatts_coex example
(cherry picked from commit e741f09e0f)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-12-03 11:54:02 +08:00
Zhang Hai Peng ac1a56f8a3 fix(ble/bluedroid): Add NULL checks in GATT APIs
(cherry picked from commit a6730c7da6)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-12-03 11:54:02 +08:00
Zhang Hai Peng d9b5fee6d5 fix(ble/bluedroid): Add NULL checks in esp_gap_ble_api
(cherry picked from commit b71c51564a)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-12-03 11:54:01 +08:00
Zhang Hai Peng 1ac87d9dc2 fix(ble/bluedroid): Add NULL check in esp_ble_gap_add_device_to_resolving_list
(cherry picked from commit 4b44d8e814)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-12-03 11:54:01 +08:00
Zhang Hai Peng 70e75d7b63 fix(ble/bt): Add NULL check in esp_hid_device example
(cherry picked from commit 8e0f74a2cc)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-12-03 11:54:00 +08:00
Zhang Hai Peng 667c4769fc fix(ble/bt): Add NULL check in esp_hid_host example
(cherry picked from commit 8b5dd75368)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-12-03 11:54:00 +08:00
Zhang Hai Peng 0406ad7c7d fix(ble/blufi): Add DH param length validation
(cherry picked from commit 773814c087)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-12-03 11:53:59 +08:00
Zhang Hai Peng cee1c04124 fix(ble/bluedroid): Fix memory leak in ble_spp_server example
(cherry picked from commit b6b3b81bf6)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-12-03 11:53:59 +08:00
Zhang Hai Peng 580d49365f fix(ble/bluedroid): Use calloc in gatt_server example
(cherry picked from commit e26b60090d)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-12-03 11:53:56 +08:00
Zhang Hai Peng cb9c6ee858 fix(ble/bluedroid): Use snprintf in ble_eddystone example
(cherry picked from commit 24e023e307)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-12-03 11:53:56 +08:00
Zhang Hai Peng 06f18a9fe0 fix(ble/bluedroid): Fix potential out-of-bounds issue
- add length check in hci_hal_h4_hdl_rx_packet to prevent OOB
- add adv data length check in btm_ble_cache_adv_data
- add indicate data length check in BTA_GATTS_HandleValueIndication
- add report length check in bta_hh_parse_keybd_rpt
- add report length check in BTA_HdSendReport
- add descriptor length check in BTA_HdRegisterApp
- prevent buffer overflow in attribute processing


(cherry picked from commit 71efec78c5)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-12-02 00:04:53 +08:00
Zhang Hai Peng 480b24c170 fix(ble/bluedroid): Fix potential CVE-2024-0039 out-of-bounds write in attp_build_value_cmd
- Reference: https://source.android.com/docs/security/bulletin/2024-03-01?hl=zh-cn


(cherry picked from commit e1d39f630f)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-12-02 00:04:53 +08:00
Zhang Hai Peng c4396ffeaf fix(ble/bluedroid): Fix potential CVE-2020-0022 in reassemble_and_dispatch
- Reference: https://nvd.nist.gov/vuln/detail/CVE-2020-0022


(cherry picked from commit 1f7fd91b5a)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-12-02 00:04:53 +08:00
Zhang Hai Peng 18e06748c3 fix(bt): Update esp32 libbtdm_app.a (15a18b1a)
- fix(ble): fixed BLE enable scan timeout
 - fix(ble): fixed crash in "btdm_controller_task"


(cherry picked from commit c5e50ccd19)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-11-25 11:53:27 +08:00
Zhang Hai Peng cb9dc0dea2 fix(ble/bluedroid): Fixed missing BLE connect and disconnect events
(cherry picked from commit 2dcbd64616)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-11-21 21:53:21 +08:00
Zhang Hai Peng e7ee24cb49 fix(ble/bluedroid): Fixed BLE incorrect device record count issue
(cherry picked from commit 9bfd9c5340)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-11-21 17:53:19 +08:00
zhanghaipeng e346b83332 feat(ble/bluedroid): Added BLE debug LOG for bluedroid 2025-11-14 11:12:40 +08:00
Zhang Hai Peng 83fe5719b4 feat(ble/bluedroid): add API to get local BLE IRK
(cherry picked from commit 3c68650d7e)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-10-21 17:53:18 +08:00
Zhang Hai Peng 2fbfe3b420 fix(ble/bluedroid): fix memory leak during deinit when service table is created but not started
(cherry picked from commit ddd12f2498282e147044d1fe532a51aeb18875f9)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-10-17 16:45:39 +08:00
Zhang Hai Peng bd464da6c6 fix(ble/bluedroid): prevent crash when deinit/disable host during scan
Crash occurs if the BLE host is deinitialized or disabled while scanning is still active.
This usage is not recommended.


(cherry picked from commit ca2c78f53e)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-10-14 21:53:36 +08:00
Zhang Hai Peng 8fe332539a fix(ble/bluedroid): Fixed resolve adv data crash if host deinitialized or disabled
(cherry picked from commit 7ce921ed95)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-10-14 21:53:33 +08:00
Zhang Hai Peng a3289d9a57 feat(blufi): Update BluFi document
(cherry picked from commit 3f4bedd3a5)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-09-09 11:52:21 +08:00
Zhang Hai Peng e3d7042956 fix(bt): Update esp32 libbtdm_app.a (f1dc7d8)
- Improve ESP32 stability and security


(cherry picked from commit 8ec5410236)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-08-26 21:53:26 +08:00
Zhang Hai Peng 971b8c9c34 docs(ble): add advisory for CVE-2025-55297 found in Blufi example
(cherry picked from commit 1952f0333c)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-08-25 17:53:29 +08:00
Zhang Hai PengandCody 57ec0dec15 fix(ble/bluedroid): Update Gatt_Server_Service_Table_Example_Walkthrough.md
(cherry picked from commit 6b360dacf6)

Co-authored-by: Cody <codyhubman4@gmail.com>
2025-08-15 14:53:50 +08:00
Zhang Hai PengandBLKDASH 4aef14cd2d fix(ble/bluedroid): Fixed the problem of macro definition error
(cherry picked from commit 6b212c7d47)

Co-authored-by: BLKDASH <128231495+BLKDASH@users.noreply.github.com>
2025-08-15 14:53:48 +08:00
Zhang Hai Peng 2b19981d29 fix(ble/bluedroid): Fixed potential out-of-bounds memory access when resolve adv data
(cherry picked from commit 12df54e8d1)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-08-15 14:53:45 +08:00
zhanghaipeng 1ee0dbb521 fix(bt/ble): Update esp32 libbtdm_app.a (722c907a)
- Fixed bt hci event was not report to host when hci command was sent
2025-08-05 16:43:49 +08:00
zhanghaipeng 51fbec0a29 fix(bt/ble): Update esp32 libbtdm_app.a (65c26ad)
- Fixed bt hci event was not report to host when hci command was sent
2025-08-01 18:52:55 +08:00
Zhang Hai Peng eceae1c888 fix(ble/bluedroid): set sec_conn only on successful pairing in ble_hid_device_demo
(cherry picked from commit 50fe55ca59)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-07-29 21:53:30 +08:00
zhanghaipeng e61aefeeba fix(bt/ble): Update esp32 libbtdm_app.a (3a27e2e)
- Optimize check Access Address when receive connection request PDU
2025-07-29 15:38:33 +08:00
Zhang Hai Peng 4bb53c1603 fix(ble/bluedroid): Fixed fail to disconnect when device record is cleared
(cherry picked from commit b6dc79af47)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-07-25 21:53:50 +08:00
Zhang Hai Peng f9098f699d fix(ble/bluedroid): fix incorrect resolving_list_avail_size update
(cherry picked from commit ac385530af)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-07-25 21:53:47 +08:00
Zhang Hai Peng 0360931842 fix(ble/bluedroid): ensure resolving list is updated when the oldest device is removed
(cherry picked from commit 61606a6f95)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-07-25 21:53:45 +08:00
Zhang Hai Peng e687812b35 fix(ble/bluedroid): Fix issue causing BTM_GetSecurityFlags failed
(cherry picked from commit 48235c7b25)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-07-25 21:53:42 +08:00