From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19523 invoked from network); 5 Apr 2022 03:57:50 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 5 Apr 2022 03:57:50 -0000 Received: (qmail 20211 invoked by uid 550); 5 Apr 2022 03:57:48 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 20179 invoked from network); 5 Apr 2022 03:57:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mforney.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=mNnbZouc4jasGyTHzLTZPKVl1BpPfVJIM0q3xf6APJM=; b=h6yWEES3oGRf8tB/c7G/YaXDmilDWkLjivgU8Oz3KJKKleHMF8w4o7qgwGEkHdDH+i f6CTEUGZZnKLS4kmN8Idf4YVLFTd9QQ+w6z4jGCOS8barDsHKKc0y5GD08z7+LNQFKb7 B3F84bVOL5soNeyLUe5SeLviZHu/UEz9OlyZ/orOc5m35/4e7X5a00R8Y3dXIa8c2hrf qwHrDV2zdQokCFrU4zH2dOhhUfY/AU/iYXoi3Q4RIqWYeFkSrfADZ53AxXuhntyP5P6A u4aiD7pCKH+TkpRNrnzXB691m4DRKSmdU0nHDgIpowRQrDmxZOa6RFhaf2RAD2/sY7uF TSCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=mNnbZouc4jasGyTHzLTZPKVl1BpPfVJIM0q3xf6APJM=; b=wLI6v/jk8OOBMv1YQY8u4D9LNeZNq/gp9xffnwY72Wt69gJMplWFiVWHLoKe3Ss/aP 080KVECxP7BoPvL4Togcuiukn0qkuhkw8TDh7Qv4T67rd0K6Ud4uHos5EI+BzcRs+vJA bb/Fg48VImT1hGk3Ms9/GwwB8EOufqrJhNXGbrMaiXga4INaA1vmHKLEjn4vwoL5lRm8 30UrSNLaC2B8YPHInBmPiTkLIBU5r4/eByQbqjXfivE1oKu+1UdgRs9m0BOVNbdrLTLC n72F384MxehIi6SChR8jnsk/858yWCoF8F6I+MrdQaFqX2FRkx0dzdePtus2W712jzHe viLQ== X-Gm-Message-State: AOAM530Jw430gC44YiQAUcKmzfChynlmLKQ/YKjZF5x58ObDnY1SYXwa VwtK0oDsUUDMRaYZ+/OTbM5dnX16xppUfC/zqMuMAa6WsWfazQ== X-Google-Smtp-Source: ABdhPJw0qI1e/83qJ5TvTYIRnl0S5xb+1DfE3wYcc9wIvp/682/Y0ItQgl6mus8FLP6PwVR6bIAEmSV0hsp1HnIMGWw= X-Received: by 2002:a17:906:5641:b0:6da:8691:3fcc with SMTP id v1-20020a170906564100b006da86913fccmr1436226ejr.50.1649131055506; Mon, 04 Apr 2022 20:57:35 -0700 (PDT) MIME-Version: 1.0 X-Originating-IP: [98.45.152.168] In-Reply-To: <20220405031859.17673-1-ccross@google.com> References: <20220405031859.17673-1-ccross@google.com> From: Michael Forney Date: Mon, 4 Apr 2022 20:57:34 -0700 Message-ID: To: musl@lists.openwall.com Cc: Colin Cross Content-Type: text/plain; charset="UTF-8" Subject: Re: [musl] [PATCH] dl_iterate_phdr: return empty string for the name of the main program On 2022-04-04, Colin Cross 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.