main: check MAC address obtained successfully from efuse
What changed, and why it matters
This commit adds a safety check to ensure the device can read its unique hardware identifier (MAC address) from a special chip memory area (efuse) before continuing startup. Previously, the code read the MAC address but ignored whether it succeeded. If that read failed, the device would continue running with an uninitialized/empty MAC address, which could cause operational problems or weaken security features that rely on a unique device identity. The fix makes the device halt with an error if the MAC cannot be read.
Treat as a low-severity hardening improvement. Review whether any other boot-time eFuse or identity reads similarly ignore return codes, and consider adding equivalent assertions. No urgent response required absent evidence of active exploitation.
Security signals we found
Unconditional failure handling added for security-relevant identifier read
Device-unique identity (MAC) now validated before use
Defensive hardening of boot-time initialization
Evidence from the diff
In main/main.c, validate_running_image() now wraps esp_efuse_mac_get_default(macid) with JADE_ASSERT(… == ESP_OK). Previously the return code was discarded. This ensures the device aborts if the default MAC address cannot be retrieved from eFuse, preventing subsequent code from using an uninitialized macid buffer. The change is defensive and improves fail-safe behavior during early boot.
Changed components
main/main.cvalidate_running_image()esp_efuse_mac_get_default()macid bufferInspect captured patch +1 / −1
diff --git a/main/main.c b/main/main.c
index fcdb045..b1ed4d6 100644
--- a/main/main.c
+++ b/main/main.c
@@ -116,7 +116,7 @@ static void validate_running_image(void)
{
// Populate chip info struct and mac-id
esp_chip_info(&chip_info);
- esp_efuse_mac_get_default(macid);
+ JADE_ASSERT(esp_efuse_mac_get_default(macid) == ESP_OK);
// Check running partition/fw image
const esp_partition_t* running = esp_ota_get_running_partition();
Why this scored 33/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.