What changed, and why it matters
This commit changes how the project's automated unit tests are run. It disables Address Space Layout Randomization (ASLR) only during testing, when available, by wrapping the test command with setarch -R. ASLR randomizes where programs are loaded in memory; turning it off for tests is often done to make memory-related test failures reproducible or to support debugging tools. This change affects only the developer/test build process, not the firmware that ships to users.
No security action required. This is a test-harness change. If reviewers are concerned, confirm that ASLR remains enabled for release firmware builds and that disabling ASLR during unit tests is intentional for reproducibility or tooling compatibility.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The Makefile’s run-unit-tests target now checks for setarch availability and, if present, runs CTest under setarch $(uname -m) -R, which disables ASLR for that process. If setarch is unavailable, it falls back to the previous behavior. This is a test-infrastructure change with no modification to firmware code, cryptography, or runtime behavior of the device.
Changed components
Makefile run-unit-tests targetDeveloper/test build toolingInspect captured patch +5 / −1
diff --git a/Makefile b/Makefile
index 252e778..5b6524a 100644
--- a/Makefile
+++ b/Makefile
@@ -111,7 +111,11 @@ unit-test: | build-build
$(MAKE) -C build-build
# Must compile C tests before running them
run-unit-tests: | build-build
- CTEST_OUTPUT_ON_FAILURE=1 $(MAKE) -C build-build test
+ if command -v setarch >/dev/null 2>&1 && setarch "$$(uname -m)" -R true >/dev/null 2>&1; then \
+ CTEST_OUTPUT_ON_FAILURE=1 setarch "$$(uname -m)" -R $(MAKE) -C build-build test; \
+ else \
+ CTEST_OUTPUT_ON_FAILURE=1 $(MAKE) -C build-build test; \
+ fi
# Only one test thread because of unsafe concurrent access to `SafeData`,
# `mock_sd()` and `mock_memory()`. Using mutexes instead leads to mutex
# poisoning and very messy output in case of a unit test failure.
Why this scored 15/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.