Bug 218860

Summary: libelf doesn't reload section headers after update with ELF_C_WRITE
Product: Base System Reporter: Eric McCorkle <emc2>
Component: miscAssignee: Ed Maste <emaste>
Status: Closed FIXED    
Severity: Affects Some People CC: cem, emaste, jkoshy, kaiw, rgrimes, toolchain
Priority: --- Keywords: patch
Version: CURRENT   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 228911    
Attachments:
Description Flags
Patch to fix the problem none

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