Repository navigation
usbboot: Add host-build ASAN tests for bootfiles and DUID parsing - #413
Merged
Merged
Conversation
The directory next to the executable could fill PATH_MAX, which would truncate bootfiles.bin when it is appended to form bootfiles_path. Size exe_msg_dir so that the full path always fits. get_exe_msg_dir already rejects a directory that is too long. This also fixes a gcc -Wformat-truncation warning at -O1 and above.
Add a make check target which builds host tests against main.c, bootfiles.c and decode_duid.c without needing a USB device. The tests cover bootfiles.bin extraction from valid and corrupt archives, the order in which the file server searches bootfiles.bin, the chip and port directories and the embedded msd files, path traversal, FACTORY_UUID decoding, and that each shipped bootfiles.bin contains the files that BCM2711 and BCM2712 load.
timg236
force-pushed
the
host-build-test
branch
from
October 28, 2026 07:57
50038da to
7d607c6
Compare
Build and run make check with clang and the address and undefined behaviour sanitisers so that memory errors in the bootfiles.bin and file lookup code fail the pull request.
timg236
force-pushed
the
host-build-test
branch
from
October 28, 2026 08:00
7d607c6 to
4f439e6
Compare
timg236
marked this pull request as ready for review
October 28, 2026 08:01
Collaborator
Author
|
The exe_msg_dir means -01 is no longer required in the ASAN build so I think this is good now. |
Contributor
|
Looks good to me |
martamomotko
approved these changes
Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.