build(core): suppress LOAD segment with RWX permissions warning
What changed, and why it matters
This commit changes the build settings for the Trezor firmware's Rust code to silence a linker warning about memory segments that are marked as readable, writable, and executable (RWX). The commit message states that these segment permissions are not actually used to configure the device's Memory Protection Unit (MPU), so the warning is not a real security concern. It does not fix a vulnerability, but it does hide a warning that could otherwise alert developers to a potentially risky memory layout.
No immediate action required. Treat as a build-hygiene change. If auditing supply-chain or build hardening, verify independently that the device's MPU is indeed configured by a separate, trusted mechanism and that no runtime executable writable mappings exist. Consider whether suppressing the warning reduces future visibility into linker-introduced RWX segments.
Security signals we found
RWX segment warning suppression
Linker flag --no-warn-rwx-segments added
Commit message references MPU and segment permissions
No code or memory-layout change in diff
Evidence from the diff
The patch adds -Wl,--no-warn-rwx-segments to the rustflags in core/embed/.cargo/config.toml for both ARM Cortex-M4 and Cortex-M7 build targets. This linker flag suppresses the GNU ld warning warning: ... has a LOAD segment with RWX permissions. The commit message explains the suppression is intentional because the ELF segment permissions are not used to configure the MPU on the device. The change is purely build-time noise reduction and does not alter code generation, memory layout, or runtime behavior.
Changed components
core/embed/.cargo/config.tomlRust linker flags for Cortex-M4 and Cortex-M7 firmware buildsInspect captured patch +6 / −0
### core/embed/.cargo/config.toml
@@ -22,6 +22,10 @@ rustflags = [
"link-arg=-mfloat-abi=hard",
"-C",
"link-arg=-mfpu=fpv4-sp-d16",
+ # Suppress linker warning that built ELF "has a LOAD segment with RWX permissions" since
+ # the segment permissions are not used to actually configure MPU.
+ "-C",
+ "link-arg=-Wl,--no-warn-rwx-segments",
"-D",
"linker-messages",
# Adds an ELF section with Rust functions' stack sizes. See the following links for more details:
@@ -47,6 +51,8 @@ rustflags = [
"link-arg=-mfloat-abi=hard",
"-C",
"link-arg=-mfpu=fpv5-sp-d16",
+ "-C",
+ "link-arg=-Wl,--no-warn-rwx-segments",
"-D",
"linker-messages",
"-Z",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.