refactor(core): step `loop.race()` task without `loop.schedule()`
What changed, and why it matters
This is a one-line internal code cleanup in Trezor's task scheduler. It changes how a background racing task is advanced, switching from a public scheduling function to a direct internal stepping call. There is no visible security problem in the diff itself, and no security context is provided by the vendor.
No immediate action required based on this commit alone. If reviewing for security, verify that `_step` correctly preserves invariants previously guaranteed by `schedule`, such as exception handling, task state transitions, and reentrancy protections.
Security signals we found
No security-relevant keywords in commit title or message
No changelog entry requested by author
Single-line refactor in scheduler internals
No explicit bug fix or vulnerability remediation described
Evidence from the diff
The commit modifies core/src/trezor/loop.py in the race syscall’s completion path. Previously, when a racing task finished, it called schedule(self.callback, result) to enqueue the callback. The patch changes this to _step(self.callback, result), which directly advances the callback task without going through the scheduler queue. This appears to be a refactor to avoid re-scheduling an already-running task context. The diff alone shows no obvious vulnerability such as use-after-free, race condition, or privilege change; it is a minimal behavioral adjustment in an embedded async runtime.
Changed components
core/src/trezor/loop.pyrace syscall / task schedulerInspect captured patch +1 / −1
diff --git a/core/src/trezor/loop.py b/core/src/trezor/loop.py
index 385998fb7..860c02074 100644
--- a/core/src/trezor/loop.py
+++ b/core/src/trezor/loop.py
@@ -333,7 +333,7 @@ class race(Syscall):
if not self.finished:
self.finished = True
self.exit(task)
- schedule(self.callback, result)
+ _step(self.callback, result)
def __iter__(self) -> Task:
try:
Why this scored 11/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.