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

Align sections to 512 bytes #26

Merged
merged 1 commit into from
Sep 29, 2022
Merged

Conversation

bobolopolis
Copy link
Contributor

Without specifying an alignment, there are gaps in the section table. When signing fwupdx64.efi for Secure Boot, this results in some firmware rejecting it despite having a valid signature. When inspecting the binary with sbverify, it warns about these gaps:

$ sbverify --list fwupdx64.efi
warning: gap in section table:
    .rela   : 0x0000b400 - 0x0000c400,
    /4      : 0x0000c470 - 0x0000c670,
warning: gap in section table:
    /4      : 0x0000c470 - 0x0000c670,
    .dynsym : 0x0000c800 - 0x0000cc00,
gaps in the section table may result in different checksums
...

After setting the section alignment to 512, the gaps are gone and the signed fwupdx64.efi file passes the Secure Boot check as expected.

Without specifying an alignment, there are gaps in the section table.
When signing fwupdx64.efi for Secure Boot, this results in some firmware
rejecting it despite having a valid signature. When inspecting the
binary with sbverify, it warns about these gaps:

	$ sbverify --list fwupdx64.efi
	warning: gap in section table:
	    .rela   : 0x0000b400 - 0x0000c400,
	    /4      : 0x0000c470 - 0x0000c670,
	warning: gap in section table:
	    /4      : 0x0000c470 - 0x0000c670,
	    .dynsym : 0x0000c800 - 0x0000cc00,
	gaps in the section table may result in different checksums
	...

After setting the section alignment to 512, the gaps are gone and the
signed fwupdx64.efi file passes the Secure Boot check as expected.
@hughsie hughsie merged commit c60c0b8 into fwupd:main Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants