Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGw6cBstQ772esFVYaOrH2w-M2u8CU+qFh3WviV7cEHN5XfSdw@mail.gmail.com>
Date: Mon, 4 Apr 2022 20:57:34 -0700
From: Michael Forney <mforney@...rney.org>
To: musl@...ts.openwall.com
Cc: Colin Cross <ccross@...gle.com>
Subject: Re: [PATCH] dl_iterate_phdr: return empty string for the name
 of the main program

On 2022-04-04, Colin Cross <ccross@...gle.com> wrote:
> The glibc man page for dl_iterate_phdr states:
> The first object visited by callback is the main program.   For  the  main
> program,  the
> dlpi_name field will be an empty string.
>
> This is relied upon by the LLVM ASAN runtime:
> https://github.com/llvm/llvm-project/blob/72ec2f76396fe5de5397bfb898993fdb22e2b0da/compiler-rt/lib/asan/asan_linux.cpp#L135
>
> Without this patch, running a binary that has been instrumented with
> ASAN fails with:
> ==4156919==ASan runtime does not come first in initial library list; you
> should either link runtime to your application or manually preload it with
> LD_PRELOAD.
>
> Use a constant empty string instead of the DSO name field for the first
> entry in the DSO list.

I believe glibc is the exception here, not musl. When I looked at
this, every other operating system I tried used the program name for
the first object.

I attempted to fix this generically here:
https://reviews.llvm.org/D119515

Unfortunately, it seems to have caused some breakage and got reverted,
but I wasn't able to reproduce it and nobody offered any pointers
about how I might go about reproducing it. Any help moving forward
with that would be appreciated.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.