From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28424 invoked by alias); 11 Jun 2018 19:52:57 -0000 Mailing-List: contact gnu-gabi-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: gnu-gabi-owner@sourceware.org Received: (qmail 28412 invoked by uid 89); 11 Jun 2018 19:52:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.4 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=attack, hacking X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mail-vk0-f50.google.com Received: from mail-vk0-f50.google.com (HELO mail-vk0-f50.google.com) (209.85.213.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 11 Jun 2018 19:52:55 +0000 Received: by mail-vk0-f50.google.com with SMTP id b77-v6so13005405vkb.5 for ; Mon, 11 Jun 2018 12:52:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=MhAbvpvrKTO2BzWKjsKKqb3mpVxuDTOmEsTxgfggk20=; b=VgMz8fZuzmYjBruv8Kg7tl1OtZEl4gW3SusnN9Zayf2p8RFLFmt/Z/59w8wBEIJV/9 T8OymPx6+0nbw9eUNiqE6kDaMJRxT9bJPLjjGQ2zIGi6CEODgil3Z6/nq4wuhmSA9dmy 3oA9gw5FR/LwrorrI6Qp39sdOJqFN9wUjJvo9mmWWNa0xwqry0T5Ge2HqO0QKkDHA9eU +Pzzep6/eb9TJbHAg1QNCg5RDVHcstAsvF8g9JCuYzjs3tlzdUqnMZbvHBBZ0VRXIPoP KMXmDsvqerINiMI/ZqioaxRMf3R5jiLtlsXvXUuZhcXBztQVVMjh7r5Xy5wnCQQFCGXh mSWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=MhAbvpvrKTO2BzWKjsKKqb3mpVxuDTOmEsTxgfggk20=; b=uf+TQZebrVDR1P3hIxh3YxZCEuXORzqwkjFNupJS7eV6F/8uesphjtkWImaX0tmbuP CKR8Ud88mwVgp6msVFcmfbdEmWYAUsmbXjjPz8nSzASySJ32NI/F5/bXSDRVpSAn20wX jlo9kuuOZajPLLysGu4nwMmcC/PuJIt4PeTGMKeE8BHGBWWxgDf4aglHk4ckLjd/fF/I HMoAzmCQKVq51b9jJF7KwvhgTrDyxvDzluPAJURclIB/6ZsWBM8lHx4Aaaipiw5Pixvw 6H+W1V4c1cxIfC9sAORZaEifA9VVbsgYrHzf1VD6DDvA7YGrceYi29piBwHYDWPeC2wS 3AEw== X-Gm-Message-State: APt69E3dpH7CJabntwl2uw+ucOb6eDG1rDqTjsqEwgds+nDWNOQO0NBi yR5rqa8miUcPkzXPsmghO29tey2hyNnhpV3+Vhg= X-Google-Smtp-Source: ADUXVKLCnfoROpk+9Ed2igetYWLSideou4rBF9CKdiCPp2sW6Y6H85thWeTzxdnhSCeEZUdSPGcvJCU8MXTvEQpK6mM= X-Received: by 2002:a1f:6b47:: with SMTP id g68-v6mr319778vkc.169.1528746773643; Mon, 11 Jun 2018 12:52:53 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:d90a:0:0:0:0:0 with HTTP; Mon, 11 Jun 2018 12:52:52 -0700 (PDT) In-Reply-To: <0140c64d-ceef-070e-a8f5-95a930984800@redhat.com> References: <0140c64d-ceef-070e-a8f5-95a930984800@redhat.com> From: Cary Coutant Date: Mon, 01 Jan 2018 00:00:00 -0000 Message-ID: Subject: Re: Flag for late RELRO application To: Florian Weimer Cc: gnu-gabi@sourceware.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-q2/txt/msg00004.txt.bz2 > I would like to add a flag to gABI (visible in the dynamic section) which > indicates that the loader shall apply RELRO protection only after running > the ELF constructors from DT_INIT and DT_INIT_ARRAY. > > This would allow applications to allocate a mapping and store a pointer to > it in permanently read-only memory. On the mapping itself, the application > can set the protection flags (and keys) as needed. Why can't the application that wants to do this simply do the following? mprotect(&ptr, sizeof(ptr), PROT_READ|PROT_WRITE); ptr = ...; mprotect(&ptr, sizeof(ptr), PROT_READ); We have RELRO to collect all the data together that the dynamic loader needs to initialize. I see no good reason to extend that feature to support an application-specific need, especially when it significantly expands the window during which the program is subject to attack. Initializers are just as prone to hacking as the rest of the program. -cary