public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "Houdek.Ryan@fex-emu.org" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/28487] Static application fault with dlopen library in rtld_malloc stubs
Date: Fri, 22 Oct 2021 11:39:25 +0000	[thread overview]
Message-ID: <bug-28487-131-N4TgHTg5x3@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28487-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=28487

--- Comment #2 from Ryan Houdek <Houdek.Ryan@fex-emu.org> ---
This application can't be fully dynamic because it needs to support
binfmt_misc.
This application will be used in cross-arch chroot environments and runtime
executable dynamic loader executable environment at the same time.

In the cross-arch chroot environment, dynamic libraries (likely, more on that
in a moment) won't be used.
We don't want, and in some edge cases, can't provide the host architecture's
libraries to be available inside of the chroot.
binfmt_misc will load the interpreter for each process in this instance.
We can't provide the host architecture's libraries in these cases since the
distributions involved may not support multiarch.

In the case of the application being used outside of the cross-arch chroot.
Then the binfmt_misc application will still be picked up for the other
architecture's executables (Think 32-bit x86 being executed on AArch64).
At some point in the application's code path, we will need to load libGL, but
we can't know that up front.

Then in the worst case, we will be in a cross-arch chroot environment, we will
have binded the host architecture's libraries in to the cross-arch chroot.
We will then end up dynamically loading libraries or not depending on a bunch
of tooling being run.

Since binfmt_misc is something that needs to be setup by a root user, we can't
really do much about changing the binary depending on namespace. Doesn't really
matter since in some cases you can't ever preempt what will happen.

If dlopen from static-pie executables is removed then it is very much going to
break behaviour here. It wasn't noticed before but it is now since some of the
scope is expanding.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2021-10-22 11:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-22  3:15 [Bug libc/28487] New: " Houdek.Ryan@fex-emu.org
2021-10-22 11:04 ` [Bug libc/28487] " carlos at redhat dot com
2021-10-22 11:39 ` Houdek.Ryan@fex-emu.org [this message]
2021-11-16  9:13 ` fweimer at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-28487-131-N4TgHTg5x3@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).