This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug dynamic-link/25341] Different behaviour of LD_PRELOAD and LD_LIBRARY_PATH from error tolerance perspective


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]