Bug 218860 - libelf doesn't reload section headers after update with ELF_C_WRITE
Summary: libelf doesn't reload section headers after update with ELF_C_WRITE
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Ed Maste
URL:
Keywords: patch
Depends on:
Blocks: 228911
  Show dependency treegraph
 
Reported: 2017-04-24 23:13 UTC by Eric McCorkle
Modified: 2018-08-31 17:53 UTC (History)
6 users (show)

See Also:


Attachments
Patch to fix the problem (394 bytes, patch)
2017-04-24 23:13 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:13:29 UTC
Created attachment 182064 [details]
Patch to fix the problem

The libelf library in base doesn't reload section headers after clearing them when performing an elf_update with ELF_C_WRITE.  This is because it fails to clear a flag indicating that the section headers have been loaded.

This is fixed with the attached patch.
Comment 1 Eric McCorkle 2017-04-24 23:16:11 UTC
Review for fix: https://reviews.freebsd.org/D10486
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-08-01 15:55:34 UTC
A commit references this bug:

Author: emaste
Date: Wed Aug  1 15:55:15 UTC 2018
New revision: 337045
URL: https://svnweb.freebsd.org/changeset/base/337045

Log:
  libelf: reload section headers after update with ELF_C_WRITE

  These issues (PR 218860 and PR 218861) are still undergoing additional
  discussion in the upstream context and there may be additional changes
  to come.

  PR:		218860
  Submitted by:	Eric McCorkle
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D10486

Changes:
  head/contrib/elftoolchain/libelf/elf_update.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-08-31 17:29:41 UTC
A commit references this bug:

Author: emaste
Date: Fri Aug 31 17:29:25 UTC 2018
New revision: 338411
URL: https://svnweb.freebsd.org/changeset/base/338411

Log:
  MFC r337045: libelf: reload section headers after update with ELF_C_WRITE

  These issues (PR 218860 and PR 218861) are still undergoing additional
  discussion in the upstream context and there may be additional changes
  to come.

  PR:		218860
  Submitted by:	Eric McCorkle
  Sponsored by:	The FreeBSD Foundation (MFC)

Changes:
_U  stable/11/
  stable/11/contrib/elftoolchain/libelf/elf_update.c