mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
The offset table and the per-cert length fields of the certificate bundle were read through uint16_t*/uint32_t* casts, which compile to halfword/word loads at addresses with no alignment guarantee: bundles supplied via esp_crt_bundle_set() can start anywhere, and cert entries are byte-packed, so their 16-bit fields land at arbitrary offsets. On chips with SOC_CPU_MISALIGNED_ACCESS_ON_PMP_MISMATCH_ISSUE (DIG-694: ESP32-C6/H2/H21) a misaligned load from memory-mapped flash can take a spurious "Load access fault" when it sits within two instructions of an access to a differently-permissioned region, observed as a crash in esp_crt_check_bundle()/CA callback during TLS handshakes with a bundle that happened to be placed at an odd address.