Skip to content

elf_load_note validate the minimum note size as well, provided by the caller - #687

Merged
dinosaure merged 2 commits into
Solo5:mainfrom
hannesm:min_note_size
Oct 15, 2026
Merged

dinosaure merged 2 commits into
Solo5:mainfrom
hannesm:min_note_size

Conversation

@hannesm

@hannesm hannesm commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Found by scrutineer run by @avsm

@reynir reynir left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me other than a minor nit. This could also be checked at call sites with the out_note_size, but I think this is fine.

Comment thread tenders/common/elf.c Outdated
if (note_size <= 0 || note_size > nhdr.h.n_descsz) {
if (note_size < min_note_size || note_size > nhdr.h.n_descsz) {
warnx("%s: INV_EXE: phdr[%u] note does not fall within valid size"
" (%zu <= 0 || %zu > %u)",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message should be updated - we no longer compare against 0 but min_note_size

@dinosaure

Copy link
Copy Markdown
Collaborator

Thanks!

@dinosaure
dinosaure merged commit 0b909e1 into Solo5:main Oct 15, 2026
12 checks passed
@hannesm
hannesm deleted the min_note_size branch October 15, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants