Bug 218861

Summary: libelf elf_update fails when adding sections
Product: Base System Reporter: Eric McCorkle <emc2>
Component: miscAssignee: freebsd-toolchain (Nobody) <toolchain>
Status: New ---    
Severity: Affects Only Me CC: cem, emaste, jkoshy, kaiw
Priority: --- Keywords: patch
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Patch to fix the problem none

Description Eric McCorkle 2017-04-24 23:20:27 UTC
Created attachment 182066 [details]
Patch to fix the problem

The libelf file in base fails to perform elf_update when growing the file by adding new sections, because elf_getdata erroneously checks section boundaries against the old file size.

This can be fixed by omitting this check when doing elf_update.

The attached patch fixes the problem.
Comment 1 Eric McCorkle 2017-04-24 23:27:18 UTC
Review for fix: https://reviews.freebsd.org/D10487
Comment 2 Ed Maste freebsd_committer freebsd_triage 2018-11-12 17:07:58 UTC
Drop from 12.0 tracking; there is an open question in the review and this is unlikely to be resolved before release.