AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 17 Bitcoin

refactor(core/embed): reorganize error handling

Public commit record

What the developer wrote

Authored by matejcik

90/100 · Strong
refactor(core/embed): reorganize error handling

in rtl:
* provide headers for error_shutdown and __fatal_error (and variants)
* implement all except error_shutdown_ex_n and __fatal_error_n
* if feature error_shims is activated (dependency of test), also
error_shutdown_ex_n and __fatal_error_n are implemented via unix calls

in crypto:
* implement tc_fault_handler by delegating to error_shutdown

in sys:
* add error_handling.c, which provides global implementations of
error_shutdown_ex_n and __fatal_error_n by delegating to
system_exit_error/fatal

in conclusion: the error failure functions are forward-declared
in rtl, and waiting for _someone_ to provide an implementation at link
time
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit is a code cleanup that moves how Trezor firmware handles fatal errors and shutdowns between its internal software layers. It does not add new user-facing features or change security protections. The main risk is that reorganizing low-level error paths could accidentally introduce a bug, but the diff itself does not show a vulnerability being fixed or introduced.

Recommended action

Treat as a normal refactor. Run the existing unit and integration tests, especially crypto and rtl test suites, to confirm that error shutdown paths still behave correctly on both emulator and device builds. No urgent security response is warranted based on this commit alone.

Security signals we found

01

Refactor of fatal-error and shutdown code paths

02

New noreturn annotations on systask_exit, systask_exit_error, systask_exit_fatal, systask_kill

03

Removal of duplicated test-only system_exit_error/system_exit_fatal implementations

04

Introduction of Rust unwrap!/ensure!/fatal_error! macros in rtl crate

05

Use of bindgen-generated FFI for system exit functions

Risk score

Why this scored 17/100

Our methodology →
Potential impact 2/30
Exploitability 1/25
Stealth signal 1/15
Affected reach 2/15
Confidence 8/10
Evidence quality 3/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.