www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11171] New: Text relocations in Phobos shared library

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11171

           Summary: Text relocations in Phobos shared library
           Product: D
           Version: D2
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: public dicebot.lv



Have noticed that issue during package maintenance for Arch Linux and reporting
by Martin Nowak request. Arch Linux automatically verifies all packages
targeting official repos with own `namcap` tool. At some point I have noticed
it warning me that `libphobos2.so` has text relocations.

This is how package is built:
https://github.com/Dicebot/Arch-PKGBUILDs/blob/master/dmd/PKGBUILD

Essentially it is just `make -f posix.mak MODEL=$_archbits
DMD=$srcdir/dmd/src/dmd RELEASE=1`

$ uname -a

2013 x86_64 GNU/Linux

$ readelf -d /usr/lib/libphobos2.so | grep TEXTREL
 0x0000000000000016 (TEXTREL)            0x0

$ eu-readelf -r /usr/lib/libphobos2.so | wc -l
18615

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 04 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11171




P.S. version of shared library in question is
https://www.archlinux.org/packages/community/x86_64/libphobos/ , it can be
installed at any point by standard package manager (pacman)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 04 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11171


Martin Krejcirik <mk krej.cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mk krej.cz



Just noticed this too. It makes shared libraries unusable on hardened system
(like grsecurity).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 31 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11171


safety0ff.bugz <safety0ff.bugz gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |safety0ff.bugz gmail.com



14:55:11 PDT ---


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 31 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11171






Likely, but it's not just Gentoo. I use Grsecurity kernel on Debian and get this error: ./prog: error while loading shared libraries: /usr/local/lib/libphobos2.so.0.64: cannot make segment writable for relocation: Permission denied The only solution is to disable MPROTECT for given exacutable. http://pax.grsecurity.net/docs/mprotect.txt -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 31 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11171




15:10:09 PDT ---



Likely, but it's not just Gentoo.
I'm aware, it should probably be renamed. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 31 2013