You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
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
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.
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
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).
The text was updated successfully, but these errors were encountered: