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.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31829 invoked from network); 26 Sep 2020 04:14:55 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 26 Sep 2020 04:14:55 -0000 Received: (qmail 6040 invoked by uid 550); 26 Sep 2020 04:14:51 -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 6019 invoked from network); 26 Sep 2020 04:14:50 -0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QkntnOYCS7iwZO8zCq5L99d0fvVW+xdYKycd1FO8/zeMVA3kk9mFibIxGOoWvQDj6eamo4nIAyActWS0JM5Z5ByUWEWKD33DW6+K8JxOKf48nrbW5d1l98I9w+UEI230tbzj3DR8U/c+3/vtoz2JAcam4rVEe6OMfCNYhQreo5h9xh4dlI9d4+NFEPR6fXLRsCC3zFZzzEWX4LVxNbhwV+g1AOZqfI7gl6mpzdpWINOlhLJG0ZunUZHut9kN4xMuk4wC98Pwt0x9Ta9peLUqovcFOOxk8+Cpj+g2zDkTyu9RZTeDwFL7PVJMzGm46lew6xtsAcLpzKx0BlwUno0GFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=41jCKGoUGFJTbx2h2EoBkEyYIpHrU10mP3v7Bnp+jV4=; b=MMTEuE8dxvjDb4SFg8y6t6DLbNkAGSWPLBnt5/oQqP6rVSWsPYQUIVgvAAK5U8E0vwZ+k1iB4WNxxR9P2Xdzo1XzfqEDwPvrRM8PjhMU5Nri51IMMF8rQ8yG1/JCYMF77O8XY4HOUWNN8EpG67/x5md0WnMWQYDEaqWCfdwNVPhM3gnXLbdS0aoz+D/GJRqKhlMUSM3vqW3EvxADy+JQntHXQOCe3Y/GpJLB+YnAw+zHvEvT2i/nKzMol3aHAGML5N67JLRaD1B2q5aV8xJycSUHBNEdEEpti/lPD/FEV7xxBauY92baQrKJwdwujjDthkvqsU9w/+MFNYaKzgvLpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none X-IncomingTopHeaderMarker: OriginalChecksum:76D33DE30CE44B9B612166E09D961EBB9CA427C307E98C4E30F1AF27A5984749;UpperCasedChecksum:C81532D7FF4F9BE24D79C61E1D55A783364BA48E954AF6C59E4B583DDA57EDF6;SizeAsReceived:9234;Count:50 X-Gm-Message-State: AOAM532OOo9WpPyPu2dPyHHnxbT8Z8roUCb7FJV7CpT3Zqkiqh1wED8M jgcUAvGD6dZpASDREAX80EnH99Hue7sxTSChEMU= X-Google-Smtp-Source: ABdhPJx4/CrIsrXSMPmjW+ezqcXBe12ysAyhVl/zia33ivKVEPk6+Sq7w1zx2MDJWz+ufSveuNS7r1Wwg6iAdt0s2GI= X-Received: by 2002:a37:478c:: with SMTP id u134mr1308769qka.206.1601093669609; Fri, 25 Sep 2020 21:14:29 -0700 (PDT) References: <20200925093733.GJ2947641@port70.net> <7318ee2c-17f5-99a9-12e4-622fe94cbfe2@gmail.com> <20200925224607.GP3265@brightrain.aerifal.cx> In-Reply-To: From: Fangrui Song Date: Fri, 25 Sep 2020 21:14:18 -0700 X-Gmail-Original-Message-ID: Message-ID: To: musl@lists.openwall.com Cc: Rich Felker Content-Type: text/plain; charset="UTF-8" X-TMN: [5dlXQ/GIJd+/wDUlO//i1YfUlljkBeEg] X-ClientProxiedBy: MN2PR10CA0019.namprd10.prod.outlook.com (2603:10b6:208:120::32) To MWHPR12MB1456.namprd12.prod.outlook.com (2603:10b6:301:f::9) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 8267a882-446c-4716-0fc7-08d861d2adb2 X-MS-TrafficTypeDiagnostic: DM6NAM11HT208: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R0kxitQWbLH7T8b1Nqsff/S9TjsR0znKERnjlPYtW5UKJ62Ua6IpVD592QKJS2nH1r00ksc1VL00On2mhVpYGiQovA6maKqywcWg+OUFKWRUVb3qIQyxUCbjt9mlcYZvvFb0LzNa3Qx44g8AtQJ1o7o07Fq0iU0wZtO51nofhZmkCY6zMs6aMXwC/8yaRjyFwmGRJDgQMOyWxmTNqkv+dA== X-MS-Exchange-AntiSpam-MessageData: jyokL/sogPF+WI6Jx/t1q3yGceUq6APKgOgae9rT1AqJU4zqQ7a2wlV/9P6fIC2MwM75GcDB/RxZsGrZq/rxnkqvhL2MLpAVAREDCcVAScVPUosI8sgm0ccBopgvvHzM33MviduEoKXAA26bA/kYww== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8267a882-446c-4716-0fc7-08d861d2adb2 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2020 04:14:37.4042 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT063.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM11HT208 Subject: Re: [musl] SIGSEGV with TEXTREL On Fri, Sep 25, 2020 at 7:53 PM Dominic Chen wrote: > > On 9/25/2020 6:46 PM, Rich Felker wrote: > > > > The right way to make this more friendly, I think, would be tracking > > the writable mapping range for each DSO (technically this is > > incomplete since it could be multiple ranges, but in that case we'd > > just take the convex hull of them and accept false negatives because > > anything else is almost surely too big a performance hit), and > > erroring out before processing a relocation at an address that's not > > writable for its DSO. This would also go part of the way towards > > making it possible for ldd to process untrusted files. > > I agree that that seems to be a better solution, and it was also > discussed in the previous mailing list thread. But my point is just that > given how this issue has been reoccurring, I think it'd be useful to do > something now (e.g. emit a non-fail warning if TEXTRELs are present), > rather than deferring any changes. > > Thanks, > > Dominic binutils 2.35 can be configured with --enable-textrel-check=yes, and Linux/x86 defaults to 'yes'. ld emits a warning upon a text relocation: warning: creating DT_TEXTREL in a PIE (LLD always disallows text relocations by default (-z text). You need -z notext to enable DF_TEXTREL and text relocations.)