From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0L8sOZTHQGIHEgAAgWs5BA (envelope-from ) for ; Sun, 27 Mar 2022 22:22:44 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id ODqJNpTHQGLiCQAA9RJhRA (envelope-from ) for ; Sun, 27 Mar 2022 22:22:44 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 920FE371E7 for ; Sun, 27 Mar 2022 22:22:44 +0200 (CEST) Received: from localhost ([::1]:36904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nYZPP-0000Yr-EX for larch@yhetil.org; Sun, 27 Mar 2022 16:22:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYZPA-0000Yc-36 for guix-devel@gnu.org; Sun, 27 Mar 2022 16:22:28 -0400 Received: from [2a02:1800:110:4::f00:18] (port=51514 helo=michel.telenet-ops.be) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nYZP5-0002fS-0d for guix-devel@gnu.org; Sun, 27 Mar 2022 16:22:24 -0400 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id BYNL270054UW6Th06YNLob; Sun, 27 Mar 2022 22:22:20 +0200 Message-ID: <8464b1bff3acb0a84f46ea6dcbbeaa7045b03d1c.camel@telenet.be> Subject: Re: Hardened toolchain From: Maxime Devos To: zimoun , kiasoc5@tutanota.com, guix-devel@gnu.org Date: Sun, 27 Mar 2022 22:22:20 +0200 In-Reply-To: <874k3r8m4m.fsf@gmail.com> References: <874k3r8m4m.fsf@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-a+4QuRAUpEMO5yDDKArf" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1648412540; bh=omvUsbyHVR59PNLwCVQ8YjwV6pckldZBVItRTJdXJ0U=; h=Subject:From:To:Date:In-Reply-To:References; b=XhGck9T3zCCSFjpbw2aW5nWbzguELNLhMJVhLqU2YOFTtKGA/zHagNXoSXo/KHYE+ v2IILJIxRmHWY597wfr9PmTbce/My5SP0huiWL6BG0zNsAE1aWkPkh9C02DujVX4JF 9SLRjqPcCw7afVvesKEpJDfV7znIv+MAZIRE1c0YQKU3mj2WiBiYTXx5gN+axIRCb5 KnSZokz4zSZ3GFZzYBfc7qFDwbyZrItE5cribeBPb8oGZ6nojfFH2J5v6qwwOQKJom rKYg8lNVBzM7uoWBWk64vcTM9fWGy3Dpem94VZ4ziZPLosYxwfA0vZV6bmjayMPzN2 q25SLfZ92WZbg== X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a02:1800:110:4::f00:18 (failed) Received-SPF: pass client-ip=2a02:1800:110:4::f00:18; envelope-from=maximedevos@telenet.be; helo=michel.telenet-ops.be X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1648412564; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=omvUsbyHVR59PNLwCVQ8YjwV6pckldZBVItRTJdXJ0U=; b=RJrlsYmxZNU5YjpSI0PREu7LhKrHjVQzalq66XxNS12oRnuMnobK637+BOg28chV19PjTU OFnrSxLYuvtAnd1Of3p57RrkUiJh97/AiVS6XJxvCk0yeG3tt/VLA2n/gTVbeUTNDooMUn 5pzbU+ZFcgvTzBAtzEKQyX8l7BICooKnU+uuTmz8GWHiQcqxWj3d3OCPe7fYThtGvI9LxJ gAGEDwq7A7bu094Ng1IoSo1SO/cjWq6KYyU07ak5Q7Lzk8q5SiaDUUWAyjUWtQK65p2qpy dgYbldFP8IdN0DaR4FbQJpKdeB1I2FySnqoJof+vpgm+yJPyDswz9KIAn/MFNA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1648412564; a=rsa-sha256; cv=none; b=avGKOGWRd+8n8hlZmoor65vMh47QW0UHz9JZ8uIEPtYklvYxowTOq9mmF9v8MqybUvm6Qy F863mFxAwJVTUyVt48snwAHOYVyHfGOXGz4YCuBcW9S/gfx8EDF3BPGdLgfUholZ8zSq0b bnfDNo+1IdOPKN2zZlLdfDoBpQpgqqY5ZjcGWX48jDE+cUHd5G1fzHCE3+Nt1wBsQHTap5 s7Nr4mLPNUAoejfdPYvgvghHKtLniuHkPLTt/XD2fxlMLX9n3gAC1qNZN2Vw22QdrsSMrc iUQ5vaX2kZqJZlQ0M/B96wrOeVALey7tj8iSwtx7d2xEgl4L79DH3aDTXBVqZg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=telenet.be header.s=r22 header.b=XhGck9T3; dmarc=pass (policy=none) header.from=telenet.be; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -6.26 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=telenet.be header.s=r22 header.b=XhGck9T3; dmarc=pass (policy=none) header.from=telenet.be; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 920FE371E7 X-Spam-Score: -6.26 X-Migadu-Scanner: scn1.migadu.com X-TUID: yCoVzUpHfj7s --=-a+4QuRAUpEMO5yDDKArf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable zimoun schreef op ma 21-03-2022 om 14:34 [+0100]: > > * gcc can be compiled with `--enable-default-ssp --enable-default- > > pie` > > to enforce ssp and pic >=20 > You wrote [1]: >=20 > --8<---------------cut here---------------start------------->8--- > (define-public gcc > =C2=A0 (package > =C2=A0=C2=A0=C2=A0 (inherit gcc) > =C2=A0=C2=A0=C2=A0 (arguments > =C2=A0=C2=A0=C2=A0=C2=A0 (substitute-keyword-arguments (package-arguments= gcc) > =C2=A0=C2=A0=C2=A0=C2=A0 ((#:configure-flags flags > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 `(append (list "--enable-default-ssp= " "--enable-default-pie") > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ,flags= ))))))) > --8<---------------cut here---------------end--------------->8--- I think it would be a lot simpler to just add this to the 'standard' gcc configure flags, in (gnu packages gcc), given that probably the idea is to do this hardening for all packages? Needs a world-rebuild though. Alternatively, the ssp and order hardening flags can be set in CFLAGS for individual packages, maybe by default in 'gnu-build-system' and the like. Alternatively, you could look into how "--with-c-toolchain" does things. Greetings, Maxime. --=-a+4QuRAUpEMO5yDDKArf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYkDHfBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7g4yAQDE3sYPId8+7V6N0wBvzL+Ga9F9 iykp96IVGlzcaBIdTgEAnMyzgRDw5H/DLY49FotcvGk6nuiKVr3XhKZLKZhkvwc= =7VfG -----END PGP SIGNATURE----- --=-a+4QuRAUpEMO5yDDKArf--