From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dragonfly.birch.relay.mailchannels.net (dragonfly.birch.relay.mailchannels.net [23.83.209.51]) by sourceware.org (Postfix) with ESMTPS id 4A2E23858409 for ; Wed, 20 Oct 2021 14:28:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4A2E23858409 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 4D19A600973 for ; Wed, 20 Oct 2021 14:28:14 +0000 (UTC) Received: from pdx1-sub0-mail-a99.g.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id E6E9B600FAB for ; Wed, 20 Oct 2021 14:28:13 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a99.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.114.12.82 (trex/6.4.3); Wed, 20 Oct 2021 14:28:14 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Absorbed-Shoe: 60f4dccc6ca9828a_1634740094183_3417159067 X-MC-Loop-Signature: 1634740094183:1547962475 X-MC-Ingress-Time: 1634740094183 Received: from pdx1-sub0-mail-a99.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a99.g.dreamhost.com (Postfix) with ESMTP id 8EACF87E90 for ; Wed, 20 Oct 2021 07:28:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gotplt.org; h=message-id :date:mime-version:subject:to:references:from:in-reply-to :content-type:content-transfer-encoding; s=gotplt.org; bh=xVYI0A U+2bfNKV3Q+BFE3mjqvKE=; b=YSuFhVXGgQaFDxtcplpRPVg7gyDzyZDNB78EEE tDiCmoKAtfmUZ+31XrCpzQYPjCDweSMR3nqOFp6os+dHI8GabS5hSX4iOJYx7vaV ocXYiwTr2/i0KZEhDaOz2tQq7JFiH568pZdd924mBmc5HgdM8D0SO3s5f8DWPQlP jo+XI= Received: from [192.168.1.174] (unknown [1.186.123.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a99.g.dreamhost.com (Postfix) with ESMTPSA id CB4127E76B for ; Wed, 20 Oct 2021 07:28:12 -0700 (PDT) Message-ID: Date: Wed, 20 Oct 2021 19:58:07 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [PATCH v2 0/2] _FORTIFY_SOURCE=3 improvements Content-Language: en-US To: libc-alpha@sourceware.org References: <20211012161629.302696-1-siddhesh@sourceware.org> <20211020052434.1221167-1-siddhesh@sourceware.org> X-DH-BACKEND: pdx1-sub0-mail-a99 From: Siddhesh Poyarekar In-Reply-To: <20211020052434.1221167-1-siddhesh@sourceware.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3031.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, RCVD_IN_SBL, RCVD_IN_SORBS_WEB, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Wed, 20 Oct 2021 14:28:18 -0000 On 10/20/21 10:54, Siddhesh Poyarekar via Libc-alpha wrote: > This patchset changes the layout of fortified functions to make them > _FORTIFY_SOURCE=3 friendly and at the same time, continue working the > same for _FORTIFY_SOURCE=2 and lower. At a high level it makes sure > that no branches are emitted at compile time and only one of either the > regular or _chk version of the function is called. The conditions are > also reworked to make them more readable and foldable even in cases > where the compiler doesn't know the exact values of the operation length > and size, but can make decisions based on ranges of their values. > > The changeset also adds some _FORTIFY_SOURCE=3 testing coverage on > compilers that are able to set that fortification level. > > Changes from v1: > > - Committed access attribute related patch > - Updated macros to fold the sign check into a single macro I'll be backporting this series to 2.34 unless there are any objections. Thanks, Siddhesh