You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(This feature request relates to bug reports #14835 and #14836)
Most default ESP-IDF configurations no longer support executable heap:
ESP_SYSTEM_MEMPROT_FEATURE is enabled by default on supported ESP32-S2,S3, probably others.
ESP_SYSTEM_PMP_IDRAM_SPLIT is enabled by default on ESP32-C6, maybe others.
In both cases heap_caps_malloc(n, MALLOC_CAP_EXEC) is not expected to succeed.
This is fine and good, Writable XOR Executable memory access is a very sensible default for security.
Describe the solution you'd like.
From my perspective as a programmer trying to get executable memory[^], it'd be nice to get this failure at compile time instead of runtime, i.e. If config does not allow executable heap then don't define the MALLOC_CAP_EXEC flag.
[^] For MicroPython native code modules.
Describe alternatives you've considered.
Alternative is the current behaviour: get back a NULL pointer at runtime (unless there's a bug), and then realise you need to change the config yourself.
Additional context.
I guess this is probably a breaking API change, so maybe one for IDF 6?
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
Could non-executable heap be a compile time error?
Could non-executable heap be a compile time error? (IDFGH-14014)
Nov 6, 2024
Is your feature request related to a problem?
(This feature request relates to bug reports #14835 and #14836)
Most default ESP-IDF configurations no longer support executable heap:
ESP_SYSTEM_MEMPROT_FEATURE
is enabled by default on supported ESP32-S2,S3, probably others.ESP_SYSTEM_PMP_IDRAM_SPLIT
is enabled by default on ESP32-C6, maybe others.In both cases
heap_caps_malloc(n, MALLOC_CAP_EXEC)
is not expected to succeed.This is fine and good,
Writable XOR Executable
memory access is a very sensible default for security.Describe the solution you'd like.
From my perspective as a programmer trying to get executable memory[^], it'd be nice to get this failure at compile time instead of runtime, i.e. If config does not allow executable heap then don't define the
MALLOC_CAP_EXEC
flag.[^] For MicroPython native code modules.
Describe alternatives you've considered.
Alternative is the current behaviour: get back a NULL pointer at runtime (unless there's a bug), and then realise you need to change the config yourself.
Additional context.
I guess this is probably a breaking API change, so maybe one for IDF 6?
The text was updated successfully, but these errors were encountered: