This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] [PR libc/18801] PIE binary with STT_GNU_IFUNC symbol and TEXTREL segfaults on x86_64


On Tue, Aug 11, 2015 at 2:21 PM, Sriraman Tallam <tmsriram@google.com> wrote:
> Details here:
> https://sourceware.org/bugzilla/show_bug.cgi?id=18801
>
> Thanks to Paul Pluzhnikov for identifying the problem and suggesting the fix.

I'll note that this will cause any TEXTREL binary to fail under
SELinux config that prohibits "W+E" permissions. But I think there are
few such binaries.

It's either
- make TEXTREL binary not run under SELinux, or
- make them run, but crash mysteriously if they have a called IFUNC
resolver in them (or are linked with '-z,now').


> PR 18801
> * elf/dl-reloc.c (_dl_relocate_object):  Preserve the
> original permissions when protecting the segment for writing it.
> * sysdeps/x86_64/Makefile (ifunc-pie-txtrel-test): New test.
> * sysdeps/x86_64/tst-pie-ifunc-txtrel.S: New file.

The canonical ChangeLog entry format is:

2015-08-11  Sriraman Tallam  <tmsriram@google.com>
            Paul Pluzhnikov  <ppluzhnikov@google.com>

        [BZ #18801]
        * elf/dl-reloc.c (_dl_relocate_object): Don't remove execute
        permissions when making segment writable.
        * sysdeps/x86_64/Makefile (ifunc-pie-txtrel-test): New test.
        * sysdeps/x86_64/tst-pie-ifunc-txtrel.S: New file.

-- 
Paul Pluzhnikov


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]