From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 74FFA3858024 for ; Mon, 3 Jul 2023 08:50:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 74FFA3858024 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 8FF941F8AC; Mon, 3 Jul 2023 08:50:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688374202; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bVUu37o9xEjUz43wvN7jTE/Tv6SvLMiak+OAXM7Fma0=; b=u9QIqwkc/3JpnZ/4n+6pD1sTyRHj42GCTYJtS07Jh0hmXmEy8pKJZmdde6hl2uOQMq2gmJ 2BdUisCupaKsYcrh9EUNoV/RAuqCXNX8G2qV6Q/+4fDESPFSOQNyG1h+ticJH2cLffzYJA 6tssffDn35FwAOtCn+AIJmNSunkR3+8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688374202; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bVUu37o9xEjUz43wvN7jTE/Tv6SvLMiak+OAXM7Fma0=; b=Hh1R7t41wsTu5qeEdy5tCAhqH9VLrKjmmWXPGTishsPf52F64/dgQ3G8XfKurb/ItSjU6y UBFR4KJf0GQ5C3DA== Received: from hawking.nue2.suse.org (unknown [10.168.4.11]) by relay2.suse.de (Postfix) with ESMTP id 7A5B02C141; Mon, 3 Jul 2023 08:50:02 +0000 (UTC) Received: by hawking.nue2.suse.org (Postfix, from userid 17005) id 3E27F4A03BD; Mon, 3 Jul 2023 10:50:02 +0200 (CEST) From: Andreas Schwab To: Siddhesh Poyarekar Cc: =?utf-8?B?RnLDqWTDqXJpYyBCw6lyYXQ=?= , libc-alpha@sourceware.org, Adhemerval Zanella Subject: Re: [PATCH v3 16/16] Add --enable-fortify-source option In-Reply-To: (Siddhesh Poyarekar's message of "Fri, 30 Jun 2023 09:51:45 -0400") References: <20230628084246.778302-1-fberat@redhat.com> <20230628084246.778302-17-fberat@redhat.com> X-Yow: I guess it was all a DREAM.. or an episode of HAWAII FIVE-O... Date: Mon, 03 Jul 2023 10:50:01 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Jun 30 2023, Siddhesh Poyarekar wrote: > On 2023-06-28 04:42, Frédéric Bérat wrote: >> It is now possible to enable fortification through a configure option. >> The level may be given as parameter, if none is provided, the configure >> script will determine what is the highest level possible that can be set >> considering GCC built-ins availability and set it. >> If level is explicitly set to 3, configure checks if the compiler >> supports the built-in function necessary for it or raise an error if it >> isn't. >> The result of the configure checks is a new variables, ${fortify_source} >> that can be used to appropriately populate CFLAGS. >> Updated NEWS and INSTALL. >> Adding dedicated x86_64 variant that enables the configuration. > > Adhemerval, do you still think we should drop this and only look at > CFLAGS? I am still not a 100% convinced that we should only look at > CFLAGS (it gives much less control which makes me uneasy) but I see your > point. We'll be setting CFLAGS in Fedora anyway (which I guess will be > true for Ubuntu, Gentoo, Debian, etc. too) and the pre-commit CI will > likely have _FORTIFY_SOURCE disabled so we may have adequate coverage. I prefer a configure option, mirroring --enable-stack-protector. Since glibc has very strict requirements wrt compiler flags it needs to handle it specially anyway, and making it explicit is cleaner. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."