From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Florian Weimer Newsgroups: gmane.comp.gnu.binutils,gmane.comp.lib.glibc.alpha,gmane.comp.gcc.devel Subject: Run (some?) ELF constructors after applying RELRO protection Date: Tue, 27 Feb 2018 11:01:23 +0100 Message-ID: <255b0226-8eb1-93f1-280d-ed004e52ca0e@redhat.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1519725597 16388 195.159.176.226 (27 Feb 2018 09:59:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 27 Feb 2018 09:59:57 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 To: GNU C Library , GCC , Binutils Original-X-From: binutils-return-100733-gcgb-binutils=m.gmane.org@sourceware.org Tue Feb 27 10:59:53 2018 Return-path: Envelope-to: gcgb-binutils@blaine.gmane.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=Ckb SSStsyZEoJzLCdPoS0fCSiFaS7Y7tNPQMcxFtRSH6gkLI/axpY4divrNPNBDHv+w /Kpdmb6keeR7Za1dDcNURLP1q3TlEnDZSbKaQUV+s+VnXn0f+OIcFa6eVHKSRbQM 9JzN7AzLETgwgqKxIMtqrwGfmhZUk/RVjSCjTaHU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type:content-transfer-encoding; s=default; bh=pKc1Y0xjc 79vVCGmeT015wM1vw4=; b=r/w4LzyMRbWv/PSHP1ZXtvBsLDdi6XvLrrlwmMsSH tzfG5Xoo645K6D7N4LKx0eOvPNcyyiRYb7aj48P69Afh/9/wepO+Q0+gin6LJDir D9V+QgQohpEVpYHsplPBmP73hajD+K9uycIEmpR6wAiiZ4RnfYtunb9ZuoLr8LVP /A= Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Original-Sender: binutils-owner@sourceware.org Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com X-IsSubscribed: yes Xref: news.gmane.org gmane.comp.gnu.binutils:82697 gmane.comp.lib.glibc.alpha:82984 gmane.comp.gcc.devel:147886 Archived-At: Received: from server1.sourceware.org ([209.132.180.131] helo=sourceware.org) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqc36-0003n0-LO for gcgb-binutils@blaine.gmane.org; Tue, 27 Feb 2018 10:59:52 +0100 Received: (qmail 20170 invoked by alias); 27 Feb 2018 10:01:48 -0000 Received: (qmail 19981 invoked by uid 89); 27 Feb 2018 10:01:27 -0000 Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Feb 2018 10:01:26 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 174BDEAE80; Tue, 27 Feb 2018 10:01:25 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-116-123.ams2.redhat.com [10.36.116.123]) by smtp.corp.redhat.com (Postfix) with ESMTP id 848C41C73D; Tue, 27 Feb 2018 10:01:24 +0000 (UTC) I think it would be a nice addition to the toolchain if it were possible to programatically initialize data in the RELRO section. We do this in glibc, but I don't think this is currently supported for general use. One important application is to allocate a memory region with mmap, on which protection flags can be changed as needed. This way, the application can have a read-only path to its own configuration data, for example. Do you think this would be worthwhile to implement? Any suggestions how we should do it, without needing binutils/GCC/glibc updates? Thanks, Florian