[PATCH] D28272: ELF: Reserve space for copy relocations of read-only symbols in relro.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 3 18:14:13 PST 2017


pcc created this revision.
pcc added reviewers: rafael, ruiu, davide.
pcc added subscribers: llvm-commits, tmsriram, eugenis.

When reserving copy relocation space for a shared symbol, scan the DSO's
program headers to see if the symbol is in a read-only segment. If so,
reserve space for that symbol in a new synthetic section named .bss.rel.ro
which will be covered by the relro program header.

This fixes the security issue disclosed on the binutils mailing list at:
https://sourceware.org/ml/libc-alpha/2016-12/msg00914.html


https://reviews.llvm.org/D28272

Files:
  lld/ELF/OutputSections.h
  lld/ELF/Relocations.cpp
  lld/ELF/Symbols.cpp
  lld/ELF/Symbols.h
  lld/ELF/SyntheticSections.cpp
  lld/ELF/Writer.cpp
  lld/test/ELF/Inputs/copy-rel-pie.s
  lld/test/ELF/Inputs/relocation-copy-relro.s
  lld/test/ELF/relocation-copy-relro.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28272.82988.patch
Type: text/x-patch
Size: 9487 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170104/bad71aad/attachment.bin>


More information about the llvm-commits mailing list