[Bug 272992] Calling dl_iterate_phdr via dlopen/dlsym causes failure: ld-elf.so.1: Can't find module with TLS index 1

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 09 Aug 2023 05:29:08 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272992

--- Comment #3 from commit-hook@FreeBSD.org ---
A commit in branch main references this bug:

URL:
https://cgit.FreeBSD.org/src/commit/?id=21a52f99440c9bec7679f3b0c5c9d888901c3694

commit 21a52f99440c9bec7679f3b0c5c9d888901c3694
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2023-08-09 05:07:05 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-08-09 05:07:05 +0000

    libc dlfcn.c: make dl_iterate_phdr() from libc more useful

    Apparently there are applications that resolve dl_iterate_phdr from libc
    and try to call the symbol. Our libc only provides stubs for dl* to
    satisfy static linker or statically linked binaries, and is not prepared
    to this situation.

    Add a code to dso libc to find real dl_iterate_phdr and redirect the
    call to it.

    Reported by:    yuri
    PR:     272992
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week

 lib/libc/gen/dlfcn.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

-- 
You are receiving this mail because:
You are the assignee for the bug.