HomeFreeBSD

imgact_elf: Check note body sizes

Description

imgact_elf: Check note body sizes

In parse_notes we validate that the note name fits within the note
buffer, but we do not do the same for the note data, so there is some
potential for an OOB read in the note handler. Add a bounds check.

Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Reviewed by: kib, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53063

(cherry picked from commit c86af2cc4cd12fb0174843b22d737c3b5b5d55d0)

Details

Provenance
markjAuthored on Oct 15 2025, 8:14 PM
Reviewer
kib
Differential Revision
D53063: imgact_elf: Check note body sizes
Parents
rGc47f9af4771b: libnv: Fix a length check in nvpair_unpack_string_array()
Branches
Unknown
Tags
Unknown