HomeFreeBSD

linker: Handle a truncated hints file properly

Description

linker: Handle a truncated hints file properly

If vattr.va_size is 0, we will end up accessing invalid memory. This is
mostly harmless (because malloc(0) still allocates some memory), but it
triggers a KASAN report.

PR: 282268
Reviewed by: christos, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D47240

(cherry picked from commit b5149b265346c55994c7ebaab2a6a6fd1bd6fe5e)

Details

Provenance
markjAuthored on Oct 23 2024, 4:54 PM
Reviewer
christos
Differential Revision
D47240: linker: Handle a truncated hints file properly
Parents
rG390486cb25f9: devmatch: Catch truncated linker hints files
Branches
Unknown
Tags
Unknown