This bug was fixed in the package binutils - 2.24-5ubuntu13

---------------
binutils (2.24-5ubuntu13) trusty-proposed; urgency=medium

  * SRU LP: #1311866.
  * Update from the 2.24 branch, 20141113.
    - Fix PR gold/16945, properly handle 64-bit GOT relocations on x86_64.
    - Fix PR gold/16900, an issue where first reserved word of GOT is not
      initialized if there is no PLT.
    - gold: Fix handling of __ehdr_start when it cannot be defined.
    - Apply mainline patches for ppc476 workaround.
    - Add binutils test cases for AArch64.
    - Disassembler fix on AArch64.
    - Fix PR ld/17047, crash in the bfd linker with MALLOC_PERTURB.
    - Fix PR ld/17277, ARM32, bogus DT_TEXTREL marker (and R_ARM_NONE)
      for PC-relative cross-section relocs.
    - [AArch64] Cortex-A53 erratum 835769 linker workaround.
  * Remove the aarch64-fix-instruction-mask, applied on the branch.
  * Fix PR gold/15639, -flto and ld.gold on ARM. LP: #1191909.
  * Use 64k for COMMONPAGESIZE on PPC. LP: #1412553.
  * Fix PR ld/16452, PR ld/16457, don't output symbol version definitions
    for non-DT_NEEDED. LP: #1248642.
  * Add powerpc target for ppc64el builds. Closes: #760395. LP: #1433238.
  * binutils-doc: Include all info files. LP: #1410780.
  * Fix PR ld/16715 (ARM), set st_value to zero for undefined symbols.
    LP: #1441961.
 -- Matthias Klose <d...@ubuntu.com>   Tue, 14 Apr 2015 19:52:45 +0200

** Changed in: binutils (Ubuntu Trusty)
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to binutils in Ubuntu.
https://bugs.launchpad.net/bugs/1412553

Title:
  RELRO not working on Ubuntu 14.04

Status in binutils package in Ubuntu:
  Fix Released
Status in binutils source package in Trusty:
  Fix Released

Bug description:
  RELRO (RELocation Read-Only) is security feature provided by the
  linker and implemented in conjunction with glibc to relocations
  sections that are used to resolve dynamically loaded functions read-
  only.

  The GLIBC side looks at the segments placement set by the linker and
  if they met some criteria regarding alignment, the are mprotect to be
  read-only.  More specifically, on GLIBC code:

  elf/dl-reloc.c:

  324 void internal_function
  325 _dl_protect_relro (struct link_map *l)
  326 {
  327   ElfW(Addr) start = ((l->l_addr + l->l_relro_addr)
  328                       & ~(GLRO(dl_pagesize) - 1));
  329   ElfW(Addr) end = ((l->l_addr + l->l_relro_addr + l->l_relro_size)
  330                     & ~(GLRO(dl_pagesize) - 1));
  331 
  332   if (start != end
  333       && __mprotect ((void *) start, end - start, PROT_READ) < 0)
  334     {
  335       static const char errstring[] = N_("\
  336 cannot apply additional memory protection after relocation");
  337       _dl_signal_error (errno, l->l_name, NULL, errstring);
  338     }
  339 }

  The problem is, if linker does not set the alignment correctly,
  'start' and 'end' will be equal and thus not protected. And this is
  happening on Ubuntu 14.04 due the fact its uses default binutils
  elf{32,64}-ppc.c ELF_COMMONPAGESIZE to align it to 4k instead of 64k.

  There is a recent patch on binutils-dev maillist [1] to change the
  default for 64k and Fedora rawhide already sets it [2] in its
  binutils.spec spec:

  # On ppc64 and aarch64, we might use 64KiB pages
  sed -i -e '/#define.*ELF_COMMONPAGESIZE/s/0x1000$/0x10000/' bfd/elf*ppc.c
  sed -i -e '/#define.*ELF_COMMONPAGESIZE/s/0x1000$/0x10000/' bfd/elf*aarch64.c

  Ubuntu for powerpc64le should do the same.

  [1] https://sourceware.org/ml/binutils/2014-12/msg00165.html
  [2] 
http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/source/SRPMS/b/binutils-2.24-29.fc22.src.rpm

  I tested and building a binutils with the ELF_COMMONPAGESIZE set to
  64k instead of default 4k and rebuilding GLIBC I see its relocation
  sections being correctly mprotected.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/binutils/+bug/1412553/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to