ui: increase gui stack size for builds with stack protection enabled
What changed, and why it matters
This commit slightly increases the memory stack reserved for the device's on-screen user-interface task. The change is specifically for builds that have 'stack protection' enabled, a compiler hardening feature. The one-line patch suggests that when stack protection is turned on, the GUI task was running out of stack space, which could cause crashes or instability. There is no direct evidence in the commit that this fixes an exploitable security vulnerability; it reads more like a hardening/stability fix.
Treat as a low-severity hardening/stability improvement. If stack protection is enabled in production builds, verify through runtime stack-high-water monitoring (uxTaskGetStackHighWaterMark) that 3,200 bytes is sufficient across all GUI screens and languages. Consider documenting the stack-protection requirement in build notes. No immediate incident response is warranted absent evidence of exploitation.
Security signals we found
Stack-size increase for a hardened build configuration
Implicit reference to stack-overflow risk when stack protection is enabled
Single-byte-boundary adjustment rather than a structural fix
Evidence from the diff
In main/gui.c, the stack size passed to xTaskCreatePinnedToCore() for the gui_task is raised from 3,072 bytes to 3,200 bytes (an extra 128 bytes). The commit message ties this to builds with stack protection enabled. Stack protection (e.g., GCC’s -fstack-protector) places canary values on the stack and can increase per-function stack usage; a task with a tight stack may then overflow. A stack overflow in a privileged GUI task could, in principle, corrupt adjacent memory or crash the firmware, but the diff itself only shows a small size bump and does not demonstrate an exploit path.
Changed components
Blockstream Jade firmware GUI task (main/gui.c)FreeRTOS task creation for the GUI coreInspect captured patch +1 / −1
diff --git a/main/gui.c b/main/gui.c
index dab375d..2b217cc 100644
--- a/main/gui.c
+++ b/main/gui.c
@@ -288,7 +288,7 @@ void gui_init(TaskHandle_t* gui_h)
#ifndef CONFIG_LIBJADE
// Create (high priority) gui task
BaseType_t retval
- = xTaskCreatePinnedToCore(gui_task, "gui", 3 * 1024, NULL, JADE_TASK_PRIO_GUI, gui_h, JADE_CORE_GUI);
+ = xTaskCreatePinnedToCore(gui_task, "gui", 3 * 1024 + 128, NULL, JADE_TASK_PRIO_GUI, gui_h, JADE_CORE_GUI);
gui_task_handle = gui_h;
JADE_ASSERT_MSG(retval == pdPASS, "Failed to create GUI task, xTaskCreatePinnedToCore() returned %d", retval);
#endif // CONFIG_LIBJADE
Why this scored 29/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.