Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens the multiboot2 header/tag parsing logic (bounds/underflow handling and safer reads) and adds a dedicated unit-test suite to validate common and regression scenarios.
Changes:
- Add a new
unit-multiboottest binary covering multiboot2 header scanning, tag walking, and boot-info construction. - Tighten tag iteration by adding explicit tag-list length bounds and minimum tag-size checks.
- Fix
mb2_find_header()to avoid potentially unaligneduint32_t*reads by switching tomemcpy().
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tools/unit-tests/unit-multiboot.c | New multiboot2 unit tests (header scan, tag scan, boot-info build, basic mem info, mem map). |
| tools/unit-tests/Makefile | Adds unit-multiboot to the unit-test build/run set. |
| src/multiboot.c | Adds tag-list length to mb2_find_tag_by_type, prevents header_length underflow in boot-info build, and uses memcpy() for header magic scanning. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
note that multiboot header is already authenticated so it's trusted.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
note that this is not a problem on x86_64 architecture.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
add fixes for multiboot2 parsing and logic.
Please note that multiboot header is trusted in the common use-case.