Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect out-of-spec size requirement for some FFS sections #178

Open
1 task
NikolajSchlej opened this issue Aug 19, 2019 · 1 comment
Open
1 task

Detect out-of-spec size requirement for some FFS sections #178

NikolajSchlej opened this issue Aug 19, 2019 · 1 comment

Comments

@NikolajSchlej
Copy link
Collaborator

NikolajSchlej commented Aug 19, 2019

There is a small number of EFI images that treat UEFI specification incorrectly and instead of only ensuring that offsetof(FFS_section) % 4 == 0 ("FFS sections must be aligned to 4-byte boundary") they additionally ensure that sizeof(FFS_section) % 4 == 0 ("FFS section size is a multiple of 4").

This is fairly easy to detect (by checking for additional 1-3 bytes that are stored after the FFS section not having a size that's multiple of 4), and it needs to be preserved during rebuild (or the resulting image will crash in PeiCore/DxeCore because of buffer overflow).

  • Detect out-of-spec size req. for FFS sections
@NikolajSchlej NikolajSchlej changed the title [FFS Parser] Detect out-of-spec size requirement for FFS sections [Engine] Detect out-of-spec size requirement for FFS sections Jan 25, 2020
@NikolajSchlej NikolajSchlej changed the title [Engine] Detect out-of-spec size requirement for FFS sections Detect out-of-spec size requirement for FFS sections Jan 25, 2020
@NikolajSchlej
Copy link
Collaborator Author

Found an image that has the issue, but it only has it for Tiano-compressed sections, so needs further investigation. I can implement a warning about such a case for non-compressed sections and see if anybody will ever catch it on a live image.

990K31_1.30.zip

@NikolajSchlej NikolajSchlej changed the title Detect out-of-spec size requirement for FFS sections Detect out-of-spec size requirement for some FFS sections Aug 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant