Bug 218861 - libelf elf_update fails when adding sections
Summary: libelf elf_update fails when adding sections
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-toolchain (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-04-24 23:20 UTC by Eric McCorkle
Modified: 2018-11-12 17:07 UTC (History)
4 users (show)

See Also:


Attachments
Patch to fix the problem (3.37 KB, patch)
2017-04-24 23:20 UTC, Eric McCorkle
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.