From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by sourceware.org (Postfix) with ESMTPS id 69852385781D for ; Tue, 25 May 2021 12:18:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 69852385781D Received: by mail-qv1-xf2d.google.com with SMTP id e8so12582667qvp.7 for ; Tue, 25 May 2021 05:18:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fi8GoqFf0TrlmmPZIxRYRh3u2k9JYYTgZVDpuNRcALY=; b=RSie/02ah0poCNrIgtwXoWuCzZV8IcXM51C31cpNk++hmUvPHCPgj3UwGZGpZqk+3/ ykMOmazQqfkqz4uZKDa5lN+gC8uglY4FUWcQyog6PGXq70KrLzMsKtlq9O2UeXekfCK5 VgVucuM654+9IOCYtFNv/9XmgG0FdC1HdW6rA+L91QKgJezs46AbdA+Y5kcZz2mtqsr7 A39LVAH+BtTKAXLUhAiPAOODye/0OCJ3Lmvx75nFBP3yuU0wdsqfpUN69o98PWrjEgfT FLKJHVBK/qORakQABCPaPFejsTF3Cn8gS81+i7qAdGc7Wd3EpZfmvdeoEChII7xvSmHd 4WOw== X-Gm-Message-State: AOAM530XYq8456EmST7qEJY4Zk/WLywGJnXCNJJvtbpg+t13OTTw0amD 8RGeGHONDyrpekzgc8YkKaAbjA== X-Google-Smtp-Source: ABdhPJxIhqBUnl9kUbFspGSpg9+gYZGwtHH25A1ks9lWjxklztAGipdGpTZ6GePJkz6JLh6tJ6NeAQ== X-Received: by 2002:ad4:4483:: with SMTP id m3mr36557361qvt.14.1621945080973; Tue, 25 May 2021 05:18:00 -0700 (PDT) Received: from [192.168.1.4] ([177.194.37.86]) by smtp.gmail.com with ESMTPSA id h3sm12944627qkk.82.2021.05.25.05.17.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 May 2021 05:18:00 -0700 (PDT) Subject: Re: [PATCH 3/3] Misc: Add and the cstack_* family of functions To: Florian Weimer , Paul Eggert Cc: libc-alpha@sourceware.org, Bruno Haible References: <73724441.XAIsEQcG03@omega> <146fa4f0-ea19-fdc4-a05c-74008bb4ab5f@linaro.org> <87tumr1csv.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella Message-ID: <04c9457b-6d48-ca15-788c-da6de5d4abfc@linaro.org> Date: Tue, 25 May 2021 09:17:57 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <87tumr1csv.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2021 12:18:02 -0000 On 25/05/2021 04:40, Florian Weimer wrote: > * Paul Eggert: > >> On 5/24/21 12:11 PM, Adhemerval Zanella via Libc-alpha wrote: >> >>> If this is really a requirement, I think the best options would be to add >>> an extra flag to opt-in. >> >> Opt-in works for me. Although the GNU apps I help maintain typically >> don't have nested functions, nested functions are a longstanding GNU C >> feature and are a good thing to have when you need them. > > Since the requirement for non-executable stacks does not encapsulate > well, I'd rather make this automatic if you think executable stack > support is required. (The code allocating the stack might not know > about the trampolines.) Although honoring PT_GNU_STACK seems the most straightforward I still think we should make it a opt-in, executable stacks has strong security implications and I think it is better the caller knows it is enabling.