Skip to content

microatf: ensure that struct atf_tc_s is large enough#50

Open
arichardson wants to merge 1 commit intojiixyj:masterfrom
arichardson:microatf-fix
Open

microatf: ensure that struct atf_tc_s is large enough#50
arichardson wants to merge 1 commit intojiixyj:masterfrom
arichardson:microatf-fix

Conversation

@arichardson
Copy link
Contributor

When running the tests on a CheriBSD system on Arm Morello, pointers are 16 bytes, so the implicit size of 8192 bytes is not large enough to hold all of struct atf_tc_impl_s_ and running the tests fails with a bounds violation. To fix this issue, this commit explicitly sizes the array instead of relying on the alignment and adds a static assertion to the source file to ensure this invariant holds. I've also reordered struct atf_tc_impl_s_ to avoid padding on CHERI systems.

When running the tests on a CheriBSD system on Arm Morello, pointers are
16 bytes, so the implicit size of 8192 bytes is not large enough to hold
all of struct atf_tc_impl_s_ and running the tests fails with a bounds
violation. To fix this issue, this commit explicitly sizes the array
instead of relying on the alignment and adds a static assertion to the
source file to ensure this invariant holds. I've also reordered
struct atf_tc_impl_s_ to avoid padding on CHERI systems.
@arichardson
Copy link
Contributor Author

Split out from #36 to make things easier to review and merge.

@arichardson
Copy link
Contributor Author

ping @jiixyj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant