Commit Graph

39089 Commits

Author SHA1 Message Date
wuzhenghui
9dc97e2faf change(heap): reserve DMA pool with low priority MALLOC_CAP_DEFAULT caps 2026-07-09 17:39:04 +08:00
Jiang Jiang Jian
3abe86a894 Merge branch 'bugfix/drop_broadcast_frag_frame_v5.2' into 'release/v5.2'
fix(esp_wifi): Drop broadcast fragmented frames (v5.2)

See merge request espressif/esp-idf!50462
2026-07-08 14:15:52 +08:00
Zhang Wen Xu
11bd5d13dd Merge branch 'fix/reverse-extended-address-byte-order-in-esp-radio-spiel_v5.2' into 'release/v5.2'
fix(openthread): add APIs to clear a single src match short and extended entry in esp radio spinel (v5.2)

See merge request espressif/esp-idf!50457
2026-07-08 02:34:36 +00:00
Xu Si Yu
0a20cea9d1 feat(openthread): add APIs to clear a single src match short and extended entry in esp radio spinel 2026-07-07 17:40:12 +08:00
Kapil Gupta
a42a897f63 fix(esp_wifi): Drop broadcast fragmented frames 2026-07-07 14:29:37 +05:30
Marius Vikhammer
b3a00b6594 Merge branch 'fix/vfs_fatfs_test_stale_partition_v5.2' into 'release/v5.2'
test(vfs): reformat WL FATFS in setup to avoid stale-partition flakes (v5.2)

See merge request espressif/esp-idf!50436
2026-07-07 14:42:42 +08:00
Jiang Jiang Jian
87ee1a6317 Merge branch 'bugfix/fix_some_wifi_bugs_260706_v5.2' into 'release/v5.2'
Bugfix/fix some wifi bugs 260706 v5.2(Backport v5.2)

See merge request espressif/esp-idf!50421
2026-07-07 10:42:24 +08:00
Martin Vychodil
c4812042a3 Merge branch 'fix/fatfs_vulnerabilities_v5.2' into 'release/v5.2'
fix(fatfs): harden against runZero 2026 FatFs bugs (v5.2)

See merge request espressif/esp-idf!50429
2026-07-06 23:10:44 +08:00
Martin Vychodil
e277e745a3 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 17:00:09 +02:00
Tomáš Rohlínek
a6213ff881 fix(storage/fatfs): record non-applicable runZero 2026 CVEs in SBOM
Document the three runZero "Seven FatFs bugs" CVEs that require no source change
in this component, so vulnerability scanners have their disposition:

  - CVE-2026-6684: GPT partition-scan loop DoS. Already fixed upstream in R0.16,
    where test_gpt_header() caps the partition-entry count at 128.
  - CVE-2026-6686: read of uninitialized clusters after f_lseek() past EOF.
    Longstanding, behavioral; not a memory-safety defect and zero-filling every
    extended cluster is prohibitively costly on flash.
  - CVE-2026-6688: long-filename overflow in downstream callers. Not exposed in
    ESP-IDF; vfs_fat.c uses bounded copies and fname is bounded by FF_MAX_LFN.

Reference: https://www.runzero.com/blog/fatfs-bugs/
2026-07-06 16:19:33 +02:00
Tomáš Rohlínek
53ddebc326 fix(storage/fatfs): clamp exFAT volume-label length in f_getlabel() (CVE-2026-6687)
f_getlabel() extracts the exFAT volume label with a loop bounded by the on-disk
byte dj.dir[XDIR_NumLabel] (0-255):

    for (si = di = hs = 0; si < dj.dir[XDIR_NumLabel]; si++)
        wc = ld_16(dj.dir + XDIR_Label + si * 2);

The exFAT label field holds at most 11 UTF-16 units (22 bytes). A crafted
directory entry with a larger count both reads past the 22-byte label field and,
through put_utf(... &label[di], 4), writes past the end of the caller-provided
label buffer (the canonical API examples use small fixed stack buffers) -> stack
buffer overflow.

Clamp the character count to the exFAT maximum of 11 before the extraction loop.
Record the CVE in the component SBOM.

Note: f_getlabel() takes no destination-buffer size, so under UTF-8 output
(FF_LFN_UNICODE == 2) 11 units can still expand to up to 34 bytes; the clamp
downgrades this from attacker-unbounded to spec-bounded. ESP-IDF's VFS layer
does not call f_getlabel(); direct callers on untrusted media should size their
buffer accordingly. A complete fix requires an upstream size-aware API change.

Reference: https://www.runzero.com/blog/fatfs-bugs/
2026-07-06 14:53:12 +02:00
Tomáš Rohlínek
7824abe649 fix(storage/fatfs): guard dirty-cache refill against unsigned LBA wrap (CVE-2026-6685)
After a direct multi-sector disk_read()/disk_write(), FatFs decides whether the
cached sector overlaps the direct-I/O range with:

    fp->sect - sect < cc          (and the FF_FS_TINY variant fs->winsect - sect < cc)

`sect`, `fp->sect` and `fs->winsect` are unsigned LBA_t. On 32-bit LBA_t builds,
if the cached sector is below `sect`, the subtraction wraps to a huge value that
can still compare `< cc`, so the code computes a bogus large offset:

  - in f_write() it mis-copies from the direct write buffer (data corruption);
  - in f_read() it is worse: memcpy(rbuff + (wrapped_offset * SS), ...) is an
    out-of-bounds WRITE into the caller-supplied read buffer.

Add an explicit lower-bound check (fp->sect >= sect, resp. fs->winsect >= sect)
before the range test on both the read and write paths and both the FF_FS_TINY
and normal variants, so the condition is exactly "cached sector lies within
[sect, sect + cc)". Record the CVE in the component SBOM.

Reference: https://www.runzero.com/blog/fatfs-bugs/
2026-07-06 14:53:12 +02:00
Tomáš Rohlínek
b439d9c0e7 fix(storage/fatfs): reject empty exFAT cluster heap (CVE-2026-6683)
CVE-2026-6683 is an exFAT divide-by-zero: with NumClusters == 0 the filesystem
object has fs->n_fatent == 2, and the exFAT "percent in use" update in sync_fs()
computes ... * 100 / (fs->n_fatent - 2) -> division by zero.

That vulnerable exFAT PercInUse sync path was introduced in FatFs R0.16 and is
NOT present in this R0.15 release, so the divide-by-zero itself is not reachable
here. As defense-in-depth (and to keep parity with newer releases) reject an
empty exFAT cluster heap at mount time, which is a malformed volume regardless.

Record the CVE disposition in the component SBOM.

Reference: https://www.runzero.com/blog/fatfs-bugs/
2026-07-06 14:53:12 +02:00
Tomáš Rohlínek
31d131f85d fix(storage/fatfs): fix exFAT mount integer overflow (CVE-2026-6682)
The exFAT mount path validates that the media is large enough to hold the
declared cluster heap with:

    if (maxlba < (QWORD)fs->database + ncl * fs->csize) ...

`ncl` (DWORD, up to MAX_EXFAT) and `fs->csize` (WORD) are both promoted to
`unsigned int`, so `ncl * fs->csize` is evaluated in 32-bit arithmetic and can
wrap before the QWORD promotion of the sum. A crafted image with a large
NumClusters/SecPerClus can therefore make an undersized volume pass the "size
is large enough" check; subsequent cluster->sector math then addresses media
outside the actual device.

Promote the multiply to 64-bit ((QWORD)ncl * fs->csize). Apply the same
promotion to the bitmap-base computation ((LBA_t)fs->csize * (bcl - 2)), which
has the identical overflow shape. Record the CVE in the component SBOM.

Reference: https://www.runzero.com/blog/fatfs-bugs/
2026-07-06 14:53:12 +02:00
muhaidong
4de5919590 fix(wifi): post disconnect event after disassociation tx callback 2026-07-06 19:58:12 +08:00
muhaidong
5be423c892 fix(coex): remove unsupported external coex soc caps 2026-07-06 19:54:53 +08:00
Jiang Jiang Jian
078f53ee57 Merge branch 'backport/backport_some_wifi_changes_260630_v5.2' into 'release/v5.2'
backport/backport_some_wifi_changes_260630_v5.2(backport v5.2)

See merge request espressif/esp-idf!50230
2026-07-06 15:02:37 +08:00
Wang Meng Yang
a303dc0786 Merge branch 'bugfix/bbp_issues_v5.2' into 'release/v5.2'
Bugfix/bbp issues v5.2

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

See merge request espressif/esp-idf!50293
2026-07-06 10:41:21 +08:00
yangfeng
83a970fa4c fix: Fix the HFP example fails to discovery target device 2026-07-02 15:08:22 +08:00
yinqingzhao
14d4262650 fix(wifi): comment out functions from ld files 2026-07-01 19:36:55 +08:00
Jin Cheng
52b4ea836f fix(bt/bluedroid): fixed possible OOB read/write in process_l2cap_cmd 2026-07-01 16:33:20 +08:00
yinqingzhao
650ea3b0a3 fix(wifi): optimizations of csa procedure and keep alive mechanism 2026-07-01 12:22:36 +08:00
Rahul Tank
c069a486dc Merge branch 'contrib/github_pr_18761_v5.2' into 'release/v5.2'
fix(nimble): initialize return value in LED characteristic access cal… (GitHub PR) (v5.2)

See merge request espressif/esp-idf!50155
2026-07-01 09:27:22 +05:30
morris
25105a189a Merge branch 'ci/move_adc_runner_to_generic_v5.2' into 'release/v5.2'
ci(adc): move all ADC runners to generic (v5.2)

See merge request espressif/esp-idf!50058
2026-07-01 10:30:07 +08:00
yinqingzhao
59abe7518e fix(itwt): fix flow id 0 cannot suspend in itwt example 2026-06-30 19:58:42 +08:00
yinqingzhao
0e020e2955 fix(wifi): fix scheduling issue when tasks have the same priority as the Wi-Fi task 2026-06-30 19:58:12 +08:00
yinqingzhao
8df18fdc9c fix(wifi): fix cache access error in wifi interrupt with psram enabled 2026-06-30 19:47:24 +08:00
yinqingzhao
29c31b14de fix(phy): fix still put multiple phy init date bin into flash when CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED is enabled 2026-06-30 19:43:30 +08:00
yinqingzhao
175831b0f7 feat(phy): support change multiple phy init bin path 2026-06-30 19:35:19 +08:00
Wang Meng Yang
a5bea83f88 Merge branch 'bugfix/ai_review_a2dp_v5.2' into 'release/v5.2'
fix(bt): Fix the critical issues related to A2DP from AI review report (v5.2)

See merge request espressif/esp-idf!50132
2026-06-30 19:22:24 +08:00
Jiang Jiang Jian
2a981289a8 Merge branch 'bugfix/ai_review_btu_common_v5.2' into 'release/v5.2'
fix: Fix the critical issues of btu and bt_common from AI review report (v5.2)

See merge request espressif/esp-idf!50126
2026-06-30 12:27:24 +08:00
Island
f0f8e1cf0a Merge branch 'bugfix/fix_bluedroid_static_random_conn_rpa_v5.2' into 'release/v5.2'
fix(ble/bluedroid): skip identity conversion for static random direct connect (5.2)

See merge request espressif/esp-idf!50081
2026-06-30 10:24:40 +08:00
Island
be6f6afa4f Merge branch 'bugfix/fix_bluedroid_rpa_whitelist_conn_v5.2' into 'release/v5.2'
Fix connection failure when using RPA with whitelist filtering(ESP32) (5.2)

See merge request espressif/esp-idf!50087
2026-06-30 10:24:03 +08:00
Shuai Wang
02648abd4a fix(nimble): initialize return value in LED characteristic access callback
When the NimBLE stack called this callback for a GATT Write Request, the
uninitialized stack value was interpreted as a non-zero GATT error code,
causing the stack to send BLE_ATT_ERR_UNLIKELY (0x0E) back to the client.
2026-06-29 17:30:44 +05:30
Island
e8f973bbfa Merge branch 'bugfix/always_init_dft_queue_in_nimble_host_v5.2' into 'release/v5.2'
fix(nimble): always init the default os queue for all of controllers (5.2)

See merge request espressif/esp-idf!48069
2026-06-29 17:58:58 +08:00
Jiang Jiang Jian
0f1364f29c Merge branch 'docs/add_semihosting_chapter_v5.2' into 'release/v5.2'
docs(jtag-debugging): add semihosting chapter (v5.2)

See merge request espressif/esp-idf!49892
2026-06-29 15:27:00 +08:00
yangfeng
fc2b420742 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
A2DP BTC/API:
- Default g_a2dp_on_deinit to true before profile init
- Add shutdown state check in btc_a2dp_sink_shutdown
- Guard A2DP source timer against freed dynamic local param
2026-06-29 15:17:40 +08:00
Jiang Jiang Jian
336e042db4 Merge branch 'feat/optimize_154_debug_v5.2' into 'release/v5.2'
feat(802.15.4): avoid missing abort reason for multievents in 154 debug (v5.2)

See merge request espressif/esp-idf!50115
2026-06-29 15:08:21 +08:00
Jiang Jiang Jian
eb71b3435d Merge branch 'fix/freertos_vtaskdeletewithcaps_5_2_bug' into 'release/v5.2'
fix(freertos): remove extra vTaskDelete call in prvTaskDeleteWithCaps (v5.2)

See merge request espressif/esp-idf!49819
2026-06-29 15:07:40 +08:00
Jiang Jiang Jian
3157e5ee9a Merge branch 'fix/adc_monitor_error_on_ch8_9_on_s3_v5.2' into 'release/v5.2'
Fix ADC Continuous Monitor Callback Failure for ADC1 Channels 8/9 on ESP32-S3 (v5.2)

See merge request espressif/esp-idf!49509
2026-06-29 15:06:42 +08:00
Jiang Jiang Jian
bbfaac51cc Merge branch 'feat/remove_led_from_ble_mesh_examples_v5.2' into 'release/v5.2'
refactor(ble_mesh): remove LED hardware dependency from examples (5.2)

See merge request espressif/esp-idf!47435
2026-06-29 15:04:20 +08:00
yangfeng
6e48173373 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:41 +08:00
zhuanghang
1460eacf8a feat(802.15.4): avoid missing abort reason for multievents in 154 debug 2026-06-29 10:54:26 +08:00
zhanghaipeng
f6e1787e6a 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:44:42 +08:00
Jin Cheng
3e1f6dea3c fix(bt/controller): fixed several BR/EDR controller bugs found by WVT regression tests on ESP32 2026-06-29 10:44:38 +08:00
Island
52d2ddcbd9 Merge branch 'feat/add_ble_core_6x_feature_for_bluedroid_v5.2' into 'release/v5.2'
Feat/add ble core 6x feature for bluedroid (5.2)

See merge request espressif/esp-idf!50049
2026-06-29 10:31:43 +08:00
Zhang Hai Peng
7be8f34b15 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:43 +08:00
Zhang Hai Peng
43820cfb3a 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:21 +08:00
Zhang Hai Peng
e78123abd6 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:05 +08:00