]> git.ipfire.org Git - thirdparty/elfutils.git/commit
elflint: Do not raise an error when note type is unrecognized
authorAaron Merey <amerey@redhat.com>
Thu, 9 Oct 2025 21:08:30 +0000 (17:08 -0400)
committerAaron Merey <amerey@redhat.com>
Wed, 22 Oct 2025 21:56:27 +0000 (17:56 -0400)
commitb327696955e5e9ae6e26275d9459e9ddcb86229f
tree1c1ab5b646eac9e1941b6a580f75acfcb033f51c
parent3f7055f48f25813b423357c317231d2269909379
elflint: Do not raise an error when note type is unrecognized

check_note_data compares the type of a given ELF note to a list of known
types.  If the type is not recognized then an "unknown note" error is
raised.

Unknown note types do not necessarily indicate a gABI/psABI compliance
issue so an error should not be raised for this reason alone.
Additionally some common note types are missing from the list of known
types (NT_FILE for example).

Fix this by removing the "unknown note" error from check_note_data.

This patch preserves existing type-specific format checks and adds a
check for the presence of the null terminator in the note name, if
applicable.  If one of these checks fails, a "malformed note" or
"missing null terminator" error is raised.

Since there are currently no type-specific checks for any ET_CORE
notes, these checks are only performed when the given binary does not
have e_type ET_CORE.

https://sourceware.org/bugzilla/show_bug.cgi?id=33488

Signed-off-by: Aaron Merey <amerey@redhat.com>
src/elflint.c