This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug dynamic-link/25341] Different behaviour of LD_PRELOAD and LD_LIBRARY_PATH from error tolerance perspective
- From: "aladjev.andrew at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 03 Jan 2020 23:28:49 +0000
- Subject: [Bug dynamic-link/25341] Different behaviour of LD_PRELOAD and LD_LIBRARY_PATH from error tolerance perspective
- Auto-submitted: auto-generated
- References: <bug-25341-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=25341
--- Comment #5 from Aladjev Andrew <aladjev.andrew at gmail dot com> ---
I agree, we need to ignore files from different architecture properly. Both
LD_PRELOAD and LD_LIBRARY_PATH shouldn't receive these files.
Today we can see that "open_verify" function is full of legacy code. It is
almost impossible to understand it. We need first version of this function from
glibc-2.2 from 2000 year to understand something.
https://sourceware.org/git/?p=glibc.git;a=blob;f=elf/dl-load.c;h=45f38f3c44d1c66619281bacd2cbb915f5931951;hb=55f462edb056e70ddfdd7bf388a8088d6773ff1d
Unfortunately we can see that "open_verify" was broken by design. It has
nothing for ignoring other architectures.
if (ehdr->e_ident[EI_DATA] != byteorder)
{
if (BYTE_ORDER == BIG_ENDIAN)
lose (0, fd, name, NULL, NULL,
"ELF file data encoding not big-endian");
else
lose (0, fd, name, NULL, NULL,
"ELF file data encoding not little-endian");
}
...
lose (0, fd, name, NULL, NULL, N_("internal error"));
This code was not touched since 2000 year. We can see that it throws same
signal (with different text) both for different architecture and internal
error. This is not acceptable.
What we can do? I think that "goto close_and_out;" instead of "goto call_lose;"
will be a good solution. But I am 100% sure that this patch will never be
accepted. This code is too old.
But people can use this patch for host container that should be able to ignore
different architectures. I've tested this patch on my system, it works perfect.
--
You are receiving this mail because:
You are on the CC list for the bug.