Commit Graph

45585 Commits

Author SHA1 Message Date
sonika.rathi
eaa6c262aa fix(wear_levelling): fix codespell issue in host test 2026-07-16 09:43:03 +02:00
yi chen
becf7bd766 fix(wear_levelling): guard WL_Flash::write()/read() against size==0 underflow
WL_Flash::write() and WL_Flash::read() computed:

    uint32_t count = (size - 1) / this->cfg.wl_page_size;

`size` is `size_t` (unsigned). Neither the public wl_write()/wl_read() API
(wear_levelling.cpp), nor the newer wl_bdl_write()/wl_bdl_read() block-device
path (wl_blockdev.cpp), reject size == 0 before calling into WL_Flash, and
wear_levelling.h does not document size == 0 as invalid (a 0-byte
write/read is a reasonable no-op, mirroring POSIX write()/read() with
count == 0).

When size == 0, `size - 1` wraps around to SIZE_MAX, so `count` becomes an
enormous page count instead of 0. The functions then loop that many times,
reading (write()) or writing (read()) `wl_page_size` bytes per iteration
through the flash partition, immediately walking past the caller-supplied
buffer on the very first iteration:

  - write(): out-of-bounds *read* from the caller's `src` buffer.
  - read():  out-of-bounds *write* into the caller's `dest` buffer -- the
             more severe case, since it corrupts caller memory with flash
             content instead of merely over-reading.

Verified with a standalone reproduction that compiles the unmodified
WL_Flash.cpp against a mock Flash_Access partition: calling
`wl.write(0, an_8_byte_buffer, 0)` with no other change immediately
segfaults (confirmed count == 0xFFFFFFFF for wl_page_size == 4096); with
this fix applied the same call returns ESP_OK without touching memory
outside the buffer, and normal non-zero-size read/write is unaffected.

Add an early `size == 0` return (mirroring the existing `!initialized`
guard) to both functions, and a host_test regression case exercising
wl_write()/wl_read() with size == 0 through the public API.

Disclosure: this fix was prepared with AI assistance (Claude) and reviewed
by me before submission.

Signed-off-by: yi chen <94xhn1@gmail.com>
2026-07-14 12:23:40 +02:00
Rahul Tank
3f99c8cbf2 Merge branch 'bugfix/fix_bond_store_overflow_v5.4' into 'release/v5.4'
fix(nimble): Fix bond-store overflow when IRK is enabled (v5.4)

See merge request espressif/esp-idf!50626
2026-07-14 11:17:57 +05:30
Island
58361a6b08 Merge branch 'ble-log-console-migration-notice_v5.4' into 'release/v5.4'
Ble log console repository migration (5.4)

See merge request espressif/esp-idf!50605
2026-07-14 10:20:34 +08:00
Island
785419057e Merge branch 'fix/ble_mesh_fixed_issues_v5.4' into 'release/v5.4'
Resolve reported BLE mesh stack issues (5.4)

See merge request espressif/esp-idf!50405
2026-07-14 10:16:47 +08:00
Euripedes Rocha
34f1b78b42 Merge branch 'fix/sec-347-hostname-null-check_v5.4' into 'release/v5.4'
fix(esp_netif): reject NULL hostname in esp_netif_set_hostname_api (SEC_347) (v5.4)

See merge request espressif/esp-idf!50592
2026-07-13 15:43:56 +02:00
Rahul Tank
0f6119a107 fix(nimble): Fix bond-store overflow when IRK is enabled 2026-07-10 13:29:18 +05:30
guozifan
b8bd171c9e remove(ble): migrate BLE Log Console out of ESP-IDF 2026-07-10 15:42:20 +08:00
Jiang Jiang Jian
be916bf9e7 Merge branch 'bugfix/drop_broadcast_frag_frame_v5.4' into 'release/v5.4'
fix(esp_wifi): Drop broadcast fragmented frames (v5.4)

See merge request espressif/esp-idf!50461
2026-07-10 12:31:01 +08:00
morris
b3e387f7e3 Merge branch 'fix/uhci_rx_fsm_v5.4' into 'release/v5.4'
fix(uhci): rx fsm race condition (v5.4)

See merge request espressif/esp-idf!50580
2026-07-10 11:23:11 +08:00
Jiang Jiang Jian
f77911e82e Merge branch 'change/change_regdma_malloc_caps_v5.4' into 'release/v5.4'
change(esp_hw_support): change regdma malloc caps to allow getting memory in the DMA pool (v5.4)

See merge request espressif/esp-idf!50259
2026-07-10 10:28:57 +08:00
Euripedes Rocha Filho
36635ed643 fix(esp_netif): reject NULL hostname in esp_netif_set_hostname_api
esp_netif_set_hostname_api() dereferenced hostname via strlen() without
checking it for NULL first, causing a NULL pointer dereference.
2026-07-09 16:07:51 +02:00
Hu Rui
f681d8976e fix(uhci): rx fsm race condition
Closes https://github.com/espressif/esp-idf/issues/18746
2026-07-09 18:58:12 +08:00
Zhang Wen Xu
4068c4e7d0 Merge branch 'feat/update_openthread_submodule_and_br_lib_20260624_v5.4' into 'release/v5.4'
feat(openthread): update openthread submodule (v5.4)

See merge request espressif/esp-idf!50520
2026-07-09 10:17:03 +00:00
Mahavir Jain
4393e8496b Merge branch 'change/sbom_exclude_fixed_cves_v5.4' into 'release/v5.4'
change(sbom): exclude ESP-IDF CVEs already fixed on release/v5.4 (v5.4)

See merge request espressif/esp-idf!50572
2026-07-09 15:29:12 +05:30
Frantisek Hrbata
6e2f4b2c89 change(sbom): exclude ESP-IDF CVEs already fixed on release/v5.4
esp-idf-sbom reports four ESP-IDF CVEs against this branch because NVD
pins them to 5.4.4 -- the version release/v5.4 still reports until 5.4.5
is released -- even though the fixes are already merged here:

  - CVE-2026-45160  DHCP server OOB read (2bf4dd1200)
  - CVE-2026-45541  esp_http_server WebSocket NULL dereference (37508ab911)
  - CVE-2026-45542  protocomm SRP6a heap overflow (f5d24a7e91)
  - CVE-2026-46532  BlueDroid AVRCP vendor-command parser OOB read (56053c4d1f)

esp-idf-sbom merges this repository-local excluded_cves.yaml into its
exclusion list when scanning the tree, so these CVEs are reported as
excluded for this branch while the released v5.4.4 tag, which predates
this file, is still reported. Once version.cmake is bumped to 5.4.5 the
entries become no-ops (NVD does not list 5.4.5) and can be removed.

Compared to the release/v5.5 file this backport was adapted from, the
two ESP-TEE CVEs do not apply (NVD pins them to 5.5.4 and 6.0 only) and
CVE-2026-46532 is added (fixed in the released v5.5.4, but only after
v5.4.4 on this branch).

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-07-09 11:51:33 +02:00
wuzhenghui
265e9d2a54 change(heap): reserve DMA pool with low priority MALLOC_CAP_DEFAULT caps 2026-07-09 17:34:32 +08:00
morris
853990fb6e Merge branch 'fix/dac_continuous_flag_v5.4' into 'release/v5.4'
fix(dac): dac_continuous set is_cyclic flag in async mode (v5.4)

See merge request espressif/esp-idf!50541
2026-07-09 16:25:15 +08:00
Hu Rui
58af065f82 fix(dac): dac_continuous set is_cyclic flag in async mode 2026-07-09 11:21:03 +08:00
Xu Si Yu
d425d0df06 feat(openthread): update thread-lib for upstream b678a4f6
* esp-openthread: thread_zigbee/esp-openthread@47428f1e8
* openthread: espressif/openthread@b678a4f63
* esp-idf: espressif/esp-idf@7ef0e515d
2026-07-08 12:51:12 +00:00
Xu Si Yu
7ef0e515d2 feat(openthread): update openthread submodule 2026-07-08 20:40:26 +08:00
Xu Si Yu
fe223d0fa3 fix(openthread): fix TREL peer discovery by selecting IPv6 from mDNS address list 2026-07-08 20:39:23 +08:00
Rahul Tank
28b43f2e8d Merge branch 'bugfix/ai_reviewer_nimble_1.6_v5.4' into 'release/v5.4'
fix(nimble): Fixes for AI reported issues (v5.4)

See merge request espressif/esp-idf!50016
2026-07-08 13:58:46 +05:30
Zhang Wen Xu
3ddfa464ba Merge branch 'fix/reverse-extended-address-byte-order-in-esp-radio-spiel_v5.4' into 'release/v5.4'
fix(openthread): add APIs to clear a single src match short and extended entry in esp radio spinel (v5.4)

See merge request espressif/esp-idf!50455
2026-07-08 02:35:01 +00:00
Rahul Tank
a3aeccbed4 fix(nimble): Fixes for AI reported issues 2026-07-07 16:28:48 +05:30
Xu Si Yu
073473ccf0 feat(openthread): add APIs to clear a single src match short and extended entry in esp radio spinel 2026-07-07 17:39:56 +08:00
Kapil Gupta
50b0d1aeff fix(esp_wifi): Drop broadcast fragmented frames 2026-07-07 14:17:25 +05:30
Marius Vikhammer
581bc0c5ce Merge branch 'fix/vfs_fatfs_test_stale_partition_v5.4' into 'release/v5.4'
test(vfs): reformat WL FATFS in setup to avoid stale-partition flakes (v5.4)

See merge request espressif/esp-idf!50434
2026-07-07 14:43:08 +08:00
Jiang Jiang Jian
a089512c33 Merge branch 'fix/use_unilock_for_sleep_process_v5.4' into 'release/v5.4'
fix(esp_hw_support): use same lock for lightsleep/deepsleep process (v5.4)

See merge request espressif/esp-idf!49846
2026-07-07 11:10:41 +08:00
morris
98bbceecfe Merge branch 'feature/dma2d_ppa_sleep_retention_support_v5.4' into 'release/v5.4'
feat(ppa): add sleep retention support for DMA2D and PPA (v5.4)

See merge request espressif/esp-idf!50356
2026-07-07 10:34:39 +08:00
Jiang Jiang Jian
a04e46e6dc Merge branch 'bugfix/fix_some_wifi_bugs_260706_v5.4' into 'release/v5.4'
fix(wifi): fix some wifi bugs 260706 v5.4(Backport v5.4)

See merge request espressif/esp-idf!50409
2026-07-07 10:32:30 +08:00
Martin Vychodil
abc1b742f8 test(vfs): reformat WL FATFS in setup to avoid stale-partition flakes
Reformat the test partition before each mount so those tests always start from
a known-empty filesystem.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 16:59:37 +02:00
muhaidong
d44e869233 fix(wifi): fix some wifi bugs 260706 v5.4
1. support weak func for wifi lmac assert
2. post disconnect event after disassociation tx callback
2026-07-06 17:53:05 +08:00
muhaidong
f2f3dfa947 fix(wifi): support weak func for wifi lmac assert 2026-07-06 17:49:38 +08:00
muhaidong
81de7b1c23 fix(coex): remove unsupported external coex soc caps 2026-07-06 17:48:01 +08:00
Luo Xu
7e3e04402a fix(ble_mesh): re-check scan dev-found cb before scan-rsp invocation
(cherry picked from commit 9a3a767824)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-06 17:44:02 +08:00
Luo Xu
4a8f62c175 fix(ble_mesh): comment out logs containing sensitive keys
(cherry picked from commit 781d6b2314)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-06 17:44:00 +08:00
Luo Xu
a5cfdef4ed fix(ble_mesh): validate PB-ADV start segment length
(cherry picked from commit 912ec8dc62)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-06 17:43:59 +08:00
Luo Xu
eb8962ae8a fix(ble_mesh): Reset reassembly buffer at start of each transaction
The reassembly buffer must be reset to its origin at the beginning of every
transaction. prov_msg_recv() pulls the PDU type byte (advancing buf->data by
one) and nothing restores it between transactions. Without this reset,
buf->data drifts forward by one byte per received PDU, causing the segment-0
memcpy to write past the end of the statically allocated rx buffer
(PROV_RX_BUF_SIZE), and the XACT_SEG_DATA() offsets used for continuation
segments to be skewed by the accumulated drift.


(cherry picked from commit 2c4acaa2aa)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-06 17:43:59 +08:00
Luo Xu
4a3d4756e5 fix(ble_mesh): fix DFD client message parsing and encoding bugs
Fix multiple wire-format and robustness issues in the DFD client
(dfd_cli.c):

- handle_capabilities: read oob_retrieval_supported as u8 instead of
  le32. The server encodes a single byte; le32 over-consumed 3 bytes
  of the URL scheme list and could over-read the buffer.
- handle_upload_status: extract upload_progress from bits 0-6 (& 0x7F)
  and upload_type from bit 7 (>> 7), matching the server encoding
  (progress | BIT(7)). The previous >>1 / &0x01 returned wrong values,
  mis-classified in-band vs OOB, and falsely rejected valid OOB
  messages with high progress.
- handle_dfd_status: correct the transfer-mode byte layout to
  trans_mode bits 0-1, update_policy bit 2, RFU bits 3-7 (previously
  read bits 6-7 / 5), and fix the RFU mask to 0xF8. Now matches the
  struct bitfield definition and the DFD server.
- handle_dfd_status: report status+phase and return early when
  buf->len == 0 (IDLE phase) instead of pulling 10 absent bytes.
- bt_mesh_dfd_cli_distribution_start: encode trans_mode/update_policy
  into bits 0-2 so the server decodes them correctly.
- handle_receiver_list: validate buf->len >= entries_cnt * 5 before
  the loop, and handle entries_cnt == 0 without relying on calloc(0).
- handle_receiver_status: pass the status value (not the whole union)
  to the %d log format, fixing undefined behavior.
- dfd_client_recv_status: drop the dead BLE_MESH_DFD_OP_CAPABILITIES_GET
  case (a client-send opcode) from the receive switch.
- bt_mesh_dfd_cli_receivers_add: widen msg_length to uint32_t to avoid
  uint16_t overflow that bypassed the PDU size guard; add a NULL check
  for the receivers array.
- bt_mesh_dfd_cli_distribution_upload_oob_start: return -EINVAL
  instead of -1 for consistency with the rest of the file.


(cherry picked from commit 43137475e1)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-06 17:43:58 +08:00
Luo Xu
65f798fc3f fix(ble_mesh): added max dfd srv count limit
(cherry picked from commit 781218cb62)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-06 17:43:57 +08:00
Luo Xu
e59dc7cc2f fix(ble_mesh): reject invalid chunk size
(cherry picked from commit 35cd10fbdf)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-06 17:43:56 +08:00
Luo Xu
e58ee15e68 fix(ble_mesh): fixed invalid disconnect handler wrote
(cherry picked from commit 52cfff707f)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-06 17:43:55 +08:00
Luo Xu
6723edeb5c fix(ble_mesh): fixed BLE-Mesh NimBLE extended-adv reassembly buffer overflow on COMPLETE fragment
(cherry picked from commit 1b22467f63)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-06 17:43:54 +08:00
Luo Xu
2fed52c729 fix(ble_mesh): fixed BLE-Mesh GATTS read-callback error
(cherry picked from commit 00adfb3cbc)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-06 17:43:54 +08:00
Jiang Jiang Jian
5fb8206bd6 Merge branch 'fix/ble_mesh_disable_adv_pkt_discard_log_v5.4' into 'release/v5.4'
fix(ble_mesh): Disable warning logging when advertising packets are discarded (5.4)

See merge request espressif/esp-idf!50165
2026-07-06 15:13:23 +08:00
Island
f14e94bb83 Merge branch 'fix/ble-log-64-bit-io-setup-support_v5.4' into 'release/v5.4'
fix(ble_log): use BIT64 over BIT to support 64-bit IO setup (5.4)

See merge request espressif/esp-idf!50329
2026-07-06 12:21:09 +08:00
Wang Meng Yang
36e78269b8 Merge branch 'bugfix/bbp_issues_v5.4' into 'release/v5.4'
Bugfix/bbp issues v5.4

See merge request espressif/esp-idf!50191
2026-07-06 11:16:44 +08:00
Wang Meng Yang
499b237bcf Merge branch 'bugfix/hfp_example_ci_v5.4' into 'release/v5.4'
fix: Fix the HFP example fails to discovery target device (v5.4)

See merge request espressif/esp-idf!50291
2026-07-06 10:41:13 +08:00
Song Ruo Jing
de7b3abfe0 feat(ppa): add sleep retention support for DMA2D and PPA 2026-07-03 21:37:45 +08:00