From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by sourceware.org (Postfix) with ESMTPS id 8E0433858C41 for ; Wed, 17 May 2023 00:11:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8E0433858C41 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dabbelt.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dabbelt.com Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-528cdc9576cso34848a12.0 for ; Tue, 16 May 2023 17:11:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20221208.gappssmtp.com; s=20221208; t=1684282260; x=1686874260; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=wyWvpIHkWAqTRA7TPLjejX/GfXZYk+ub2WuIP622E5E=; b=JHpSPgbHt/ItGVidm1JB2I+RulsTx3z4HGl3VUBI2OAsj51hshlOFF0mrRolUc+Ikt WWVHNUGkFqIdOUc+D7D2DAJ2UJH1BwyeJgrJCAwJ/i2MR9Di6KRghQP8A7hxaPZCuhd0 tiINPaCGQ2sKp/aEoudXqSD/01EitPjsxPyPdfEGkrkDtmNVTlOf/1KaBSqsHRWmwGLl VcWZMtKMP0d9kbDafpJtugExQ+08UrR9ZjK3l7atLpChR3Xj14sWxuuguxiPxd+4N7dY EneGBbSlQjUg4qfwvJmRInq5/tbz2TKvLPNYAX4M5dIDol3y+SjbmWQIjm3USI0UUAni Dvkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684282260; x=1686874260; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=wyWvpIHkWAqTRA7TPLjejX/GfXZYk+ub2WuIP622E5E=; b=gZPeAUIkhDOVM3jMYSlfbmMeL2k/Zwd/dcxpT7EZ45JUuosjwElS7PPuiKDQ/3FfFs ElvKwiN4QsiuszQwM/4qPRY5c0OgXnSnVK2WlpUPLt6VcJQP7EHLctC5hNdwiy9c5Tri E8ctuMG9yr9iwZaXCwY/Yfyv7T0d0TIQuRPWa19V9Fj205W6sLgjXeBfsfDuZ1YauZ99 PPGvXQsd6RKasft6gnllS0vxR/MlzSTti2jp42pzC4i83kwU2bY6La4nONl4G3uBZKFY C6nh1JGPIrim8BWTn5swsjm3gCZck/ehRLMfpbLogwCmsH5OfIH5brCR181vxDgJbnew RRVA== X-Gm-Message-State: AC+VfDzM9wjwf6x+3HxZUZIAofyuhrzGWDjlEMjd3fmeBG+i3uImUGRq MA7RTzqex6cs6VePeTZyGx3rnw== X-Google-Smtp-Source: ACHHUZ57RxwAjT6AYhODhFpT/SUETFwqAyd1FmS1qlTc5BO7owHQ0FxtWvCclRzrjjyoNZu6UmWXmg== X-Received: by 2002:a17:90b:1d87:b0:24f:13e7:e42a with SMTP id pf7-20020a17090b1d8700b0024f13e7e42amr39842547pjb.28.1684282260516; Tue, 16 May 2023 17:11:00 -0700 (PDT) Received: from localhost ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id on2-20020a17090b1d0200b0024df7d7c35esm153796pjb.43.2023.05.16.17.10.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 17:11:00 -0700 (PDT) Date: Tue, 16 May 2023 17:11:00 -0700 (PDT) X-Google-Original-Date: Tue, 16 May 2023 17:10:37 PDT (-0700) Subject: Re: global pointer gets overwritten with dlopen(3) on RISC-V In-Reply-To: CC: l.stelmach@samsung.com, fw@deneb.enyo.de, libc-alpha@sourceware.org, schwab@suse.de, maskray@google.com, fweimer@redhat.com, adhemerval.zanella@linaro.org, joseph@codesourcery.com, binutils@sourceware.org, m.pikula@partner.samsung.com, m.szyprowski@samsung.com, k.lewandowsk@samsung.com From: Palmer Dabbelt To: szabolcs.nagy@arm.com Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, 16 May 2023 00:59:51 PDT (-0700), szabolcs.nagy@arm.com wrote: > The 05/16/2023 08:53, Lukasz Stelmach via Binutils wrote: >> No, the file we dlopen is an executable meant to work standalone. We >> dlopen it for testing and this setup has worked for us on different >> platforms (armv7l, aarch64, x86). We MAY have not encoutered an error > > it is guaranteed broken on all those targets if the exe has > local exec TLS access. (initial exec TLS is broken too but > you may get lucky with that) > > i think you can get into trouble with interposition, copy > relocs or canonical plts too. > > but even if everything happens to work, it is just bad > design: it relies on implementation internals instead of > documented interfaces. OK, so sounds like this just isn't a bug. It's oddly similar to the other half of this thread: users are relying on carefully constructing binaries to work, but that relies on unspecified behavior and thus isn't supportable. >> because our glibc has been patched. I have to investigate the details as >> Florian brough it to our attention that an error should be reported.