[0/3] Remove prelink support

Message ID 20220121172951.285848-1-adhemerval.zanella@linaro.org
Headers
Series Remove prelink support |

Message

Adhemerval Zanella Netto Jan. 21, 2022, 5:29 p.m. UTC
  As discussed recently on maillist [1], prelink is deprecated in
practice:

  * There is no active development neither maintainace.
  * It misses supports for some architectures, even for architecture
    wildly deployed such as aarch64 [2].
  * It does not work with recent security hardening such as PIE.
  * Nor it will work on future ABI additions such as DT_RELR.
  * Even when PIE is not enabled its coverity if flacky, with some
    binaries showing corrupted state [3].
  * Recent glibc changes to support different tools (such as lld)
    showed inherent issue with current prelink support.

The first patch removes both prelink support by the loader and the
LD_TRACE_PRELINKING.

The remove of mtrace TRACE_PRELINKING usage is on its own patch
because it changes LD_TRACE_LOADED_OBJECTS semantic to support
dumping the executable loading address and fixes mtrace for non
PIE similar to BZ#22716.

Finally the third part removed LD_USE_LOAD_BIAS, which is used
solely for try support prelink with PIE.

[1] https://sourceware.org/pipermail/libc-alpha/2022-January/135520.html
[2] https://sourceware.org/pipermail/libc-alpha/2022-January/135522.html
[3] https://embed.endfa.net/yocto-cross-prelink-1/

Adhemerval Zanella (3):
  elf: Remove prelink support
  malloc: Remove LD_TRACE_PRELINKING usage from mtrace
  elf: Remove LD_USE_LOAD_BIAS

 NEWS                                   |   6 +
 elf/Makefile                           |  16 --
 elf/dl-conflict.c                      |  77 -------
 elf/dl-deps.c                          |  66 ------
 elf/dl-error-skeleton.c                |   4 +-
 elf/dl-load.c                          |   3 +-
 elf/dl-lookup.c                        | 161 --------------
 elf/dl-main.h                          |   3 +
 elf/dl-map-segments.h                  |   3 +-
 elf/dl-support.c                       |   1 -
 elf/do-rel.h                           |   3 -
 elf/rtld.c                             | 283 ++++++-------------------
 elf/tst-prelink-cmp.c                  |  49 -----
 elf/tst-prelink.c                      |  29 ---
 malloc/mtrace.pl                       |  55 ++---
 sysdeps/alpha/dl-machine.h             |  15 --
 sysdeps/arm/dl-machine.h               |   4 -
 sysdeps/generic/ldsodefs.h             |  16 --
 sysdeps/generic/unsecvars.h            |   1 -
 sysdeps/i386/dl-machine.h              |  16 +-
 sysdeps/or1k/dl-machine.h              |   4 -
 sysdeps/powerpc/powerpc32/dl-machine.h |  31 +--
 sysdeps/powerpc/powerpc64/dl-machine.h |  37 ----
 sysdeps/s390/s390-32/dl-machine.h      |  22 +-
 sysdeps/s390/s390-64/dl-machine.h      |  22 +-
 sysdeps/sh/dl-machine.h                |   2 +-
 sysdeps/sparc/sparc32/dl-machine.h     |  52 +----
 sysdeps/sparc/sparc64/dl-machine.h     |  72 +------
 sysdeps/x86_64/dl-machine.h            |  48 ++---
 29 files changed, 167 insertions(+), 934 deletions(-)
 delete mode 100644 elf/dl-conflict.c
 delete mode 100644 elf/tst-prelink-cmp.c
 delete mode 100644 elf/tst-prelink.c
  

Comments

Adhemerval Zanella Netto Jan. 24, 2022, 6:55 p.m. UTC | #1
On 21/01/2022 14:29, Adhemerval Zanella wrote:
> As discussed recently on maillist [1], prelink is deprecated in
> practice:
> 
>   * There is no active development neither maintainace.
>   * It misses supports for some architectures, even for architecture
>     wildly deployed such as aarch64 [2].
>   * It does not work with recent security hardening such as PIE.
>   * Nor it will work on future ABI additions such as DT_RELR.
>   * Even when PIE is not enabled its coverity if flacky, with some
>     binaries showing corrupted state [3].
>   * Recent glibc changes to support different tools (such as lld)
>     showed inherent issue with current prelink support.
> 
> The first patch removes both prelink support by the loader and the
> LD_TRACE_PRELINKING.
> 
> The remove of mtrace TRACE_PRELINKING usage is on its own patch
> because it changes LD_TRACE_LOADED_OBJECTS semantic to support
> dumping the executable loading address and fixes mtrace for non
> PIE similar to BZ#22716.
> 
> Finally the third part removed LD_USE_LOAD_BIAS, which is used
> solely for try support prelink with PIE.
> 
> [1] https://sourceware.org/pipermail/libc-alpha/2022-January/135520.html
> [2] https://sourceware.org/pipermail/libc-alpha/2022-January/135522.html
> [3] https://embed.endfa.net/yocto-cross-prelink-1/

Based on Weekly Call discussion, I will postpone it to 2.36 and sent a
note that 2.35 is latest release that will support prelink.
  
Carlos O'Donell Jan. 27, 2022, 4:59 a.m. UTC | #2
On 1/21/22 12:29, Adhemerval Zanella via Libc-alpha wrote:
> As discussed recently on maillist [1], prelink is deprecated in
> practice:

This goes in the right direction.

I think we should review this for glibc 2.36.

Leaving glibc 2.35 as the last release with prelink support.

I've reviewed your NEWS entry for the removal note.
 
>   * There is no active development neither maintainace.
>   * It misses supports for some architectures, even for architecture
>     wildly deployed such as aarch64 [2].
>   * It does not work with recent security hardening such as PIE.
>   * Nor it will work on future ABI additions such as DT_RELR.
>   * Even when PIE is not enabled its coverity if flacky, with some
>     binaries showing corrupted state [3].
>   * Recent glibc changes to support different tools (such as lld)
>     showed inherent issue with current prelink support.
> 
> The first patch removes both prelink support by the loader and the
> LD_TRACE_PRELINKING.
> 
> The remove of mtrace TRACE_PRELINKING usage is on its own patch
> because it changes LD_TRACE_LOADED_OBJECTS semantic to support
> dumping the executable loading address and fixes mtrace for non
> PIE similar to BZ#22716.
> 
> Finally the third part removed LD_USE_LOAD_BIAS, which is used
> solely for try support prelink with PIE.
> 
> [1] https://sourceware.org/pipermail/libc-alpha/2022-January/135520.html
> [2] https://sourceware.org/pipermail/libc-alpha/2022-January/135522.html
> [3] https://embed.endfa.net/yocto-cross-prelink-1/
> 
> Adhemerval Zanella (3):
>   elf: Remove prelink support
>   malloc: Remove LD_TRACE_PRELINKING usage from mtrace
>   elf: Remove LD_USE_LOAD_BIAS
> 
>  NEWS                                   |   6 +
>  elf/Makefile                           |  16 --
>  elf/dl-conflict.c                      |  77 -------
>  elf/dl-deps.c                          |  66 ------
>  elf/dl-error-skeleton.c                |   4 +-
>  elf/dl-load.c                          |   3 +-
>  elf/dl-lookup.c                        | 161 --------------
>  elf/dl-main.h                          |   3 +
>  elf/dl-map-segments.h                  |   3 +-
>  elf/dl-support.c                       |   1 -
>  elf/do-rel.h                           |   3 -
>  elf/rtld.c                             | 283 ++++++-------------------
>  elf/tst-prelink-cmp.c                  |  49 -----
>  elf/tst-prelink.c                      |  29 ---
>  malloc/mtrace.pl                       |  55 ++---
>  sysdeps/alpha/dl-machine.h             |  15 --
>  sysdeps/arm/dl-machine.h               |   4 -
>  sysdeps/generic/ldsodefs.h             |  16 --
>  sysdeps/generic/unsecvars.h            |   1 -
>  sysdeps/i386/dl-machine.h              |  16 +-
>  sysdeps/or1k/dl-machine.h              |   4 -
>  sysdeps/powerpc/powerpc32/dl-machine.h |  31 +--
>  sysdeps/powerpc/powerpc64/dl-machine.h |  37 ----
>  sysdeps/s390/s390-32/dl-machine.h      |  22 +-
>  sysdeps/s390/s390-64/dl-machine.h      |  22 +-
>  sysdeps/sh/dl-machine.h                |   2 +-
>  sysdeps/sparc/sparc32/dl-machine.h     |  52 +----
>  sysdeps/sparc/sparc64/dl-machine.h     |  72 +------
>  sysdeps/x86_64/dl-machine.h            |  48 ++---
>  29 files changed, 167 insertions(+), 934 deletions(-)
>  delete mode 100644 elf/dl-conflict.c
>  delete mode 100644 elf/tst-prelink-cmp.c
>  delete mode 100644 elf/tst-prelink.c
>
  
Richard Purdie Feb. 3, 2022, 3:29 p.m. UTC | #3
On Wed, 2022-01-26 at 23:59 -0500, Carlos O'Donell wrote:
> On 1/21/22 12:29, Adhemerval Zanella via Libc-alpha wrote:
> > As discussed recently on maillist [1], prelink is deprecated in
> > practice:
> 
> This goes in the right direction.
> 
> I think we should review this for glibc 2.36.
> 
> Leaving glibc 2.35 as the last release with prelink support.

Can I confirm that by the above, you mean that prelink is almost certain to be
removed after 2.35 is released?

Yocto Project has an LTS due soon and this does influence what we do there a
little which is why I'm asking specifically.

I'm saddened but resigned to it, the sad reality is there aren't enough people
to maintain everything and the utility of prelink is now questionable.

Cheers,

Richard
  
Adhemerval Zanella Netto Feb. 3, 2022, 4:30 p.m. UTC | #4
On 03/02/2022 12:29, Richard Purdie wrote:
> On Wed, 2022-01-26 at 23:59 -0500, Carlos O'Donell wrote:
>> On 1/21/22 12:29, Adhemerval Zanella via Libc-alpha wrote:
>>> As discussed recently on maillist [1], prelink is deprecated in
>>> practice:
>>
>> This goes in the right direction.
>>
>> I think we should review this for glibc 2.36.
>>
>> Leaving glibc 2.35 as the last release with prelink support.
> 
> Can I confirm that by the above, you mean that prelink is almost certain to be
> removed after 2.35 is released?
> 
> Yocto Project has an LTS due soon and this does influence what we do there a
> little which is why I'm asking specifically.
> 
> I'm saddened but resigned to it, the sad reality is there aren't enough people
> to maintain everything and the utility of prelink is now questionable.

Yes, it it still my plan to remove prelink on 2.36 as indicated in 2.35 NEWS.