mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Thorsten Glaser <tg@mirbsd.de>
To: musl@lists.openwall.com
Subject: Re: [musl] [PATCH 1/1] ldso: continue searching if wrong architecture is found first
Date: Wed, 7 Feb 2024 19:51:54 +0000 (UTC)	[thread overview]
Message-ID: <Pine.BSM.4.64L.2402071946230.13700@herc.mirbsd.org> (raw)
In-Reply-To: <ZcPVkWI0/sMV/BYJ@localhost>

i262jq@0w.se dixit:

>I wonder how the loader would distinguish between "right" and "wrong"
>if there are multiple libraries differing for example only in some minor

That is precisely what we wondered about for the time_t-64-on-ILP32
transition in Debian.

>build option - which difference still can be crucial for the actual
>application or for other used libraries?

tl;dr: random build options cannot be distinguished. You have the
flags in the ELF header, which have CPU architecture and bitness,
and (other than x32 (amd64ilp32) and arm64ilp32, from there on it
gets machine-dependent as you need to define per-architecture ABI
flags, e.g. EABI vs. old ABI or MIPS o32 vs n32 vs n64.

So this will always be some kind of system-global at least, if not
world-global, thing, not something for the odd application or admin
to decide.

>Is it really worth to make LD_LIBRARY_PATH "more usable", but still unsafe?

I still think so.

>To the contrary, relying on the explicit loader in a wrapper is totally
>safe, because the path to the libraries is not inherited at any later
>exec.

What if the first binary you run is not the one that needs to get the
changed library path, but the binaries it runs?

>Are there any practical cases where the overhead of an extra execve()
>of a small wrapper would be a noticeable problem?

It may be very hard to get these into the right places.

bye,
//mirabilos
-- 
„Cool, /usr/share/doc/mksh/examples/uhr.gz ist ja ein Grund,
mksh auf jedem System zu installieren.“
	-- XTaran auf der OpenRheinRuhr, ganz begeistert
(EN: “[…]uhr.gz is a reason to install mksh on every system.”)

  reply	other threads:[~2024-02-07 19:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-07  1:22 [musl] [PATCH 0/1] ldso: continue searching if wrong architecture is found Markus Mayer
2024-02-07  1:22 ` [musl] [PATCH 1/1] ldso: continue searching if wrong architecture is found first Markus Mayer
2024-02-07 17:30   ` Rich Felker
2024-02-07 19:10     ` i262jq
2024-02-07 19:51       ` Thorsten Glaser [this message]
2024-02-08 15:52         ` i262jq
2024-02-07 20:59     ` Markus Mayer
2024-02-07  8:26 ` [musl] [PATCH 0/1] ldso: continue searching if wrong architecture is found i262jq
2024-02-07 16:45   ` enh
2024-02-07 17:07     ` Thorsten Glaser
2024-02-07 17:54       ` enh
2024-02-07 18:09 ` Colin Cross
2024-04-02 20:59   ` Markus Mayer

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=Pine.BSM.4.64L.2402071946230.13700@herc.mirbsd.org \
    --to=tg@mirbsd.de \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).