[PATCH] readelf: Check alignment of note section
Nick Clifton
nickc@redhat.com
Mon Nov 27 09:40:00 GMT 2017
Hi H.J.
> gABI specifies that PT_NOTE alignment should be aligned to 4 bytes
> for 32-bit objects and to 8 bytes for 64-bit objects. But on Linux,
> .note.ABI-tag and .note.gnu.build-id notes are always aligned to 4
> bytes. We allow either 4 byte or 8 byte alignments.
Approved - with one small change:
> + /* gABI specifies that PT_NOTE alignment should be aligned to 4
> + bytes for 32-bit objects and to 8 bytes for 64-bit objects.
> + But on Linux, .note.ABI-tag and .note.gnu.build-id notes are
> + always aligned to 4 bytes. We allow either 4 byte or 8 byte
> + alignments. */
> + align = section->sh_addralign;
> + if (align != 4 || align != 8)
> + return FALSE;
Please could you add an error message here so that the user is informed
as to why the note is corrupt.
Cheers
Nick
More information about the Binutils
mailing list