[PATCH 0/2] Fix IFUNC resolvers in dlopen'd modules and improve instrumentation

Adhemerval Zanella adhemerval.zanella@linaro.org
Tue May 26 14:00:44 GMT 2026


This series addresses issues with IFUNC resolver instrumentation in
dynamically loaded modules:

elf: Set up TLS slotinfo for dlopen'd modules before relocation (BZ 34170)
Fixes a critical issue where IFUNC resolvers in dlopen'd DSOs cannot access
their own TLS storage via any TLS model.  The solution reorders the dlopen
workflow to register modules in the TLS slotinfo list before relocation,
ensuring resolvers can locate their TLS blocks when they execute.

elf: Remove inhibit_stack_protector from __ifunc_resolver
A cleanup that removes the stack protector inhibition from IFUNC resolvers,
now that they can be fully instrumented after prior improvements.

Both patches have been tested on aarch64-linux-gnu and x86_64-linux-gnu.
I also run the elf tests on different ABI through qemu system (armhf,
loongarch, mips64el, powerpc, s390x, and riscv).

Adhemerval Zanella (2):
  elf: Set up TLS slotinfo for dlopen'd modules before relocation (BZ
    34170)
  elf: Remove inhibit_stack_protector from __ifunc_resolver

 elf/Makefile                                | 23 ++++++
 elf/dl-open.c                               | 51 ++++++------
 elf/tst-ifunc-tls-init-gd-global-lib.c      |  3 +
 elf/tst-ifunc-tls-init-gd-ld-lib-skeleton.c | 69 ++++++++++++++++
 elf/tst-ifunc-tls-init-gd-ld.c              | 89 +++++++++++++++++++++
 elf/tst-ifunc-tls-init-gd-lib.c             |  2 +
 elf/tst-ifunc-tls-init-ld-lib.c             |  2 +
 elf/tst-ifunc-tls-init-tlsdesc-lib.c        |  3 +
 elf/tst-ifunc-tls-init-tlsdesc.c            | 69 ++++++++++++++++
 include/libc-symbols.h                      |  2 +-
 10 files changed, 286 insertions(+), 27 deletions(-)
 create mode 100644 elf/tst-ifunc-tls-init-gd-global-lib.c
 create mode 100644 elf/tst-ifunc-tls-init-gd-ld-lib-skeleton.c
 create mode 100644 elf/tst-ifunc-tls-init-gd-ld.c
 create mode 100644 elf/tst-ifunc-tls-init-gd-lib.c
 create mode 100644 elf/tst-ifunc-tls-init-ld-lib.c
 create mode 100644 elf/tst-ifunc-tls-init-tlsdesc-lib.c
 create mode 100644 elf/tst-ifunc-tls-init-tlsdesc.c

-- 
2.43.0



More information about the Libc-alpha mailing list