rtld-elf - Allow dynamic (late) relocations to relro section
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 11 Feb 2019 21:47:22 +0000 (13:47 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 11 Feb 2019 21:47:22 +0000 (13:47 -0800)
commit1f732d3d8e7e1bc46c6772f97df7c4e217cb54fd
treec624f0929552da558a9e7890b94076967f2c9f5d
parent4d589fc24b0cfb3d55afd2387b66b0751c93ed3e
rtld-elf - Allow dynamic (late) relocations to relro section

* Normally the relro section is mprotect()ed to read-only after normal
  load relocations.

* It appears that some programs can issue dynamic relocations at
  run-time to such sections.

* If the relro mprotect has been done on an object, temporarily mprotect
  the object back to RW to execute the relocation, then mprotect it back
  to RO.

Reported-by: marino
libexec/rtld-elf/rtld.c
libexec/rtld-elf/x86_64/reloc.c