Commit Graph
31377 Commits
Author SHA1 Message Date
Zhang Hai Peng ae071465e5 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:48 +08:00
Zhang Hai Peng 6d33df6d6b 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:27 +08:00
Zhang Hai Peng d70c7c117b 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:09 +08:00
Zhang Hai Peng af18806c6a 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:52 +08:00
Zhang Hai Peng e3adb11acf 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:31 +08:00
Zhang Hai Peng 4e8432580a 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:43 +08:00
Zhang Hai Peng 989a673a6f 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:25 +08:00
Zhang Hai Peng 91db334490 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:07 +08:00
Zhang Hai Peng ff8df1d5df 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:06 +08:00
Zhang Hai Peng 3017a78c1a 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:06 +08:00
Zhang Hai Peng 865a25c05a 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:47 +08:00
Zhang Hai Peng debbf336f4 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:28 +08:00
Jiang Jiang Jian 2a082e4815 Merge branch 'bugfix/ai_review_hfp_v5.4' into 'release/v5.4'
fix(bt): Fix the critical issues related to HFP from AI review report (v5.4)

See merge request espressif/esp-idf!50009
2026-06-26 14:08:19 +08:00
Jiang Jiang Jian b9ce92430f Merge branch 'bugfix/ai_review_avrcp_v5.4' into 'release/v5.4'
fix(bt): Fix the critical and high issues related to AVRCP from AI review report (v5.4)

See merge request espressif/esp-idf!50022
2026-06-26 14:07:59 +08:00
Jiang Jiang Jian 1be49e9b05 Merge branch 'bugfix/supp_pmk_cache_v5.4' into 'release/v5.4'
fix(wifi): Fix skipping usage of supp pmk caching for some cases

See merge request espressif/esp-idf!49879
2026-06-26 11:24:25 +08:00
Island 72dfea0762 Merge branch 'fix/reduce_acl_event_gaps_v5.4' into 'release/v5.4'
feat(ble): updated libble to 71d180a4 for esp32h4 and esp32s31 (5.4)

See merge request espressif/esp-idf!49590
2026-06-26 10:47:14 +08:00
yangfeng 2184fae05b 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:58:17 +08:00
yangfeng 6c34f8140d fix(bt): Fix the critical issues related to AVRCP from AI review report
- recalculate len_left per attribute in avrc_bld_app_setting_text_rsp
- abort fragmented message reassembly when reassembly buffer alloc fails
2026-06-25 14:52:36 +08:00
yangfeng 8f4c343386 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
- 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:
- 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 14:25:13 +08:00
Zhang Wen Xu 63329dbeb2 Merge branch 'fix/initialize_s_spi_transaction_to_0_v5.4' into 'release/v5.4'
fix(openthread): replace all malloc calls with calloc to avoid hidden uninitialized memory issues (v5.4)

See merge request espressif/esp-idf!49969
2026-06-25 04:15:07 +00:00
Euripedes Rocha Filho 480d8776b3 change(mqtt): Update submodule to e3ab40c
* Update submodule: git log --oneline cac1552e..e3ab40c8

Detailed description of the changes:
* MR: Backport v5x
  - See merge request espressif/esp-mqtt!314
  - fix(mqtt5): Sanitize propery len/types to harden mqtt5-msg (espressif/esp-mqtt@ccded7e)
  - fix(mqtt5): Fix UB in variable len processing (espressif/esp-mqtt@c3f1ede)
* MR: ci: Simplify gitlab ci for v5.x backport branch
  - See merge request espressif/esp-mqtt!317
  - ci: Simplify gitlab ci for v5.x backport branch (espressif/esp-mqtt@d28a5c8)
2026-06-24 18:14:35 +02:00
Island 8453526489 Merge branch 'feat/spi_log_qa_frame_check_v5.4' into 'release/v5.4'
feat(ble_log): add FINAL_STAT session-end frame and flush hook before controller restart (5.4)

See merge request espressif/esp-idf!49956
2026-06-24 19:51:37 +08:00
Xu Si Yu 8fb74cb87d fix(openthread): replace all malloc calls with calloc to avoid hidden uninitialized memory issues 2026-06-24 16:15:24 +08:00
morris c88902ae28 Merge branch 'ci/move_adc_runner_to_generic_v5.4' into 'release/v5.4'
ci(adc): move all ADC runners to generic (v5.4)

See merge request espressif/esp-idf!49795
2026-06-24 15:55:17 +08:00
Guo Zifan a25fac6c71 feat(ble_log): Add frame check support for restart flow
(cherry picked from commit a81322a2ce)

Co-authored-by: guozifan <guozifan@espressif.com>
2026-06-24 11:25:26 +08:00
Island 9b35fc0e81 Merge branch 'change/ble_update_lib_20260612_v5.4' into 'release/v5.4'
change(ble): [AUTO_MR] 20260612 - Update ESP BLE Controller Lib (5.4)

See merge request espressif/esp-idf!49608
2026-06-24 10:45:17 +08:00
Shreyas Sheth c7715c92a2 fix(wifi): Fix skipping usage of supp pmk caching for some cases 2026-06-23 16:15:56 +05:30
gaoxu 80254568a6 ci(adc): remove ADC runner and move ADC tests to generic 2026-06-23 16:33:55 +08:00
wanckl 7f09cdfa2a fix(ci): twai test close board to fixed ci jobs pullotion 2026-06-23 16:02:09 +08:00
igor.udot b94ebf6d97 ci: twai runner setup 2026-06-23 16:01:50 +08:00
Jiang Jiang Jian d757b5d2b7 Merge branch 'bugfix/fix_some_wifi_bugs_260618_v5.4' into 'release/v5.4'
fix(wifi): fix some wifi bugs 260618 backport v5.4

See merge request espressif/esp-idf!49811
2026-06-23 14:49:03 +08:00
Mahavir Jain dec92ae69a Merge branch 'fix/ecdsa_ecc_hw_input_validation_v5.4' into 'release/v5.4'
Validate ECDSA signature range and harden ECC memory power-down (v5.4)

See merge request espressif/esp-idf!49444
2026-06-23 11:29:49 +05:30
Jiang Jiang Jian f2c35e2a13 Merge branch 'bugfix/mbedtls_rsa_base_reduction_hw_crt_v5.4' into 'release/v5.4'
fix(mbedlts): Enable hardware CRT for RSA-4096 via base reduction (v5.4)

See merge request espressif/esp-idf!49852
2026-06-23 13:57:28 +08:00
Mahavir Jain 8ea0981879 Merge branch 'fix/disable_secure_boot_v2_ecdsa_v5.4' into 'release/v5.4'
Fix/disable secure boot v2 ecdsa (v5.4)

See merge request espressif/esp-idf!49473
2026-06-23 10:49:36 +05:30
Jiang Jiang Jian d90e1fb1ed Merge branch 'fix-malloc_pm_lock_in_internal_mem_v5.4' into 'release/v5.4'
fix(esp_pm): malloc pm_lock in internal mem (v5.4)

See merge request espressif/esp-idf!49687
2026-06-23 11:02:26 +08:00
Island e8270cddc6 Merge branch 'fix/ble_mesh_bug_report_v2_v5.4' into 'release/v5.4'
fix(ble_mesh): Miscellaneous bugfixes according to our internal bug report (v2)

See merge request espressif/esp-idf!49318
2026-06-22 22:29:32 +08:00
Rahul Tank 0a4dbf5d72 Merge branch 'feat/throughput_l2cap_coc_v5.4' into 'release/v5.4'
Added l2cap_coc example for throughput (v5.4)

See merge request espressif/esp-idf!49741
2026-06-22 19:40:58 +05:30
Astha Verma 94863a7628 fix(nimble): Added l2cap_coc throughput examples 2026-06-22 11:41:14 +05:30
harshal.patil 4e4cb4123f fix(esp_common/esp_fault): make ESP_FAULT_ASSERT survive optimization
ESP_FAULT_ASSERT(C) was silently deleted by the optimizer when C is a cached
flag/status already proven by a preceding `if (!C) return/goto`: the compiler
folds C to a constant and drops all three checks, removing the fault-injection
protection with no warning.
2026-06-22 11:17:50 +05:30
harshal.patil 8110949d88 fix(secure_boot): range-check ECDSA r,s in bootloader before ROM verify 2026-06-22 11:17:50 +05:30
harshal.patil ad8d86f725 fix(esp_common): Add esp_fault_internal.h for use by G0 components
In release/v5.x, esp_fault.h resides in the esp_hw_support (G1)
component, so the G0 components (hal, esp_rom) must not depend on it.
Copy its contents to esp_common as esp_fault_internal.h, keep
esp_fault.h as a compatibility wrapper around it, and switch the hal
and esp_rom ECDSA/ECC code to the internal header.
2026-06-22 11:17:50 +05:30
harshal.patil 551fad393d test(mbedtls): Add out-of-bounds test for the ECDSA hardware driver 2026-06-22 11:17:50 +05:30
harshal.patil d9a3c1f866 fix(esp_rom): Patch ets_ecdsa_verify() to include signature bounds check 2026-06-22 11:17:50 +05:30
harshal.patilandAshish Sharma abcbe87e2d fix(mbedtls): validate ECDSA signature range and harden ECC memory power-down
Co-Authored-By: Ashish Sharma <ashish.sharma@espressif.com>
2026-06-22 11:17:50 +05:30
Kapil Gupta 9ce6228b0f fix(mbedtls): Fix cached Rinv size mismatch under private exponent blinding
Prevent signature verification failures on targets that do not round hardware words
to 16-word boundaries (e.g. ESP32-S3, ESP32-C6, and ESP32-P4), where exponent blinding
can cause `num_words` to vary between calls, leading to reuse of an incorrectly sized
cached `Rinv`.
2026-06-22 09:01:18 +05:30
Kapil Gupta e9586fa03a fix(mbedtls): Enable hardware CRT for RSA-4096 via base reduction
Perform modulo reduction on the base before size checks to allow RSA-4096
CRT (2048-bit exponentiations) to use the hardware accelerator instead of
falling back to software. Fix input validation, negative zero sign issues,
and early memory cleanup paths in esp_mpi_exp_mod()
2026-06-22 09:01:18 +05:30
xiongweichao bc3456c66b fix(bt): skip unknown codecs when parsing AT+BAC
Peers may report custom or non-standard codec UUIDs in AT+BAC alongside
CVSD/mSBC. Returning BTA_AG_CODEC_NONE on the first unknown entry
discarded already-parsed standard codecs. Log unknown UUIDs and continue
parsing so negotiated capabilities still reflect supported codecs.
2026-06-22 11:13:42 +08:00
Island aa222369e7 Merge branch 'feat/ble-smp-multi-adv-static-random-address_v5.4' into 'release/v5.4'
feat(ble/bluedroid): Add BLE SMP support for multi-ADV with static random addresses (5.4)

See merge request espressif/esp-idf!49787
2026-06-22 10:35:26 +08:00
Aditya Patwardhan ef0b3dd4f9 change(secure_boot): mark ECDSA based Secure Boot V2 as insecure on affected SoCs
ECDSA based Secure Boot V2 is not functional for certain input vectors on
ESP32-C5/C61/H2/P4 and on the preview targets ESP32-H4/H21. RSA based Secure
Boot V2 is the recommended scheme where the SoC supports it. This issue will be
fixed in a future hardware ECO revision; more details will be shared through the
hardware errata document.

A new hidden Kconfig option SECURE_BOOT_V2_ECDSA_INSECURE marks the affected
mass-production SoCs (ESP32-C5/C61/H2/P4). On these SoCs, when hardware Secure
Boot V2 is enabled, the ECDSA (V2) signing scheme is no longer offered by
default; it must be turned on explicitly via SECURE_BOOT_V2_FORCE_ENABLE_ECDSA
under "Allow potentially insecure options" (CONFIG_SECURE_BOOT_INSECURE). App
signing without hardware Secure Boot is not affected. Note that ESP32-C61 has no
RSA based Secure Boot V2, so it has no Secure Boot scheme enabled by default.

The preview targets ESP32-H4 and ESP32-H21 mark ECDSA Secure Boot V2 as not
supported in their SoC capabilities instead of using the option above. As
ESP32-H4 has no other Secure Boot V2 scheme, Secure Boot is disabled entirely on
it; ESP32-H21 retains RSA based Secure Boot V2.

The security documentation keeps the ECDSA Secure Boot V2 content visible and
adds a warning describing the limitation (including that ECDSA Secure Boot V2 on
ESP32-C61 is not recommended for production). CI apps that exercise ECDSA Secure
Boot V2 on the affected SoCs set CONFIG_SECURE_BOOT_V2_FORCE_ENABLE_ECDSA
accordingly.
2026-06-19 15:26:43 +05:30
Rahul Tank 9f27743eba Merge branch 'bugfix/fix_log_performance_v5.4' into 'release/v5.4'
fix(nimble): Guard ble_hs_log_mbuf/flat_buf against non-DEBUG log level (v5.4)

See merge request espressif/esp-idf!49730
2026-06-18 21:39:42 +05:30