From patchwork Wed Dec 20 08:15:39 2023
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Alexandre Oliva
X-Patchwork-Id: 181522
Return-Path:
Delivered-To: ouuuleilei@gmail.com
Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2489944dyi;
Wed, 20 Dec 2023 00:16:17 -0800 (PST)
X-Google-Smtp-Source:
AGHT+IEKnMhnkFNHeLWTJdviQHUZADp1sw/NdOMu6yAiwngPcd22Hhs7PX92OTT2HuFGXsma9A5W
X-Received: by 2002:a5b:f4a:0:b0:dbc:ddf0:1754 with SMTP id
y10-20020a5b0f4a000000b00dbcddf01754mr2615994ybr.109.1703060177193;
Wed, 20 Dec 2023 00:16:17 -0800 (PST)
ARC-Seal: i=2; a=rsa-sha256; t=1703060177; cv=pass;
d=google.com; s=arc-20160816;
b=rDGsG/Xzjmm24mlTevp/UGOWIRsChApOn/GSSsatTSr5UBJYbke/oaVDRjzrPoM5xf
BJgNGDcNJBUb72Fzmqrkmh6bu2na2mRiMidprwmIsINKyVVnIkg49nhyr0hUd+yu9l6X
PRPEkkdkHx8w4tKt8m4N72ANnXTPBFFa5odlwLbjpEwJC5BqBcCgeMEeIi4R6iklns8R
8Rs0YMXZ0Vbr5yRTb7d/scGIObyiUiqSGIv209l+9yOe9uzUiMvTyxHANiRnS+uv9H5C
o6UE8c/efRknjrA/Y6hbIV5RRc9DCe8VJWYZAXVceHiNiAcGdhQOc/9SStic1zrXaKmE
qkCQ==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20160816;
h=errors-to:list-subscribe:list-help:list-post:list-archive
:list-unsubscribe:list-id:precedence:mime-version:user-agent
:message-id:in-reply-to:date:references:organization:subject:cc:to
:from:dkim-signature:arc-filter:dmarc-filter:delivered-to;
bh=etAgcqZgR/9X0o1Iz9iYc4YsWr52aH8L0YlnDnMK6gY=;
fh=jW0Z4VeKI+ZH963cTdrDZio3DYNhvWfEMv/RN9QeeXo=;
b=O1wtRbvelnhqc4FmxlHFlcwB0sf2jsrCrSjoToU8KLMgNepFvVwFIPzGKTBq1kuwL8
IP7D+ZnYXlon0xTVl8nwIs7BybtCEF2duHTl1WYGh5x4vLuJ8owMubHgzWRBmPv5Ua6E
aG4wZhd5c9cpYbxtS00zIlC/2XabJybTr9Dcu/fl4bCONpkyTcZyNYIjnJiY3fGpw1rB
ABX1v8HzisxTmlHYZCNnVBBiui++7L63OvoruxCTF8gb1/60mUipPW7U1rGLTFJTm1Lt
xkuVh43BxqDCtaZQxwRQDIKA3hoEduC/9R731l38Eol6pjStP46FZUdVEhVqyNI/1I+y
Qq8A==
ARC-Authentication-Results: i=2; mx.google.com;
dkim=pass header.i=@adacore.com header.s=google header.b=g6ZLmM41;
arc=pass (i=1);
spf=pass (google.com: domain of
gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as
permitted sender)
smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org";
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com
Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97])
by mx.google.com with ESMTPS id
e3-20020a05622a110300b00425a8441e7csi27770709qty.431.2023.12.20.00.16.17
for
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 20 Dec 2023 00:16:17 -0800 (PST)
Received-SPF: pass (google.com: domain of
gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as
permitted sender) client-ip=8.43.85.97;
Authentication-Results: mx.google.com;
dkim=pass header.i=@adacore.com header.s=google header.b=g6ZLmM41;
arc=pass (i=1);
spf=pass (google.com: domain of
gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as
permitted sender)
smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org";
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com
Received: from server2.sourceware.org (localhost [IPv6:::1])
by sourceware.org (Postfix) with ESMTP id DEC6C3861814
for ; Wed, 20 Dec 2023 08:16:16 +0000 (GMT)
X-Original-To: gcc-patches@gcc.gnu.org
Delivered-To: gcc-patches@gcc.gnu.org
Received: from mail-oo1-xc2a.google.com (mail-oo1-xc2a.google.com
[IPv6:2607:f8b0:4864:20::c2a])
by sourceware.org (Postfix) with ESMTPS id 9D75A3861866
for ; Wed, 20 Dec 2023 08:15:49 +0000 (GMT)
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9D75A3861866
Authentication-Results: sourceware.org;
dmarc=pass (p=none dis=none) header.from=adacore.com
Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9D75A3861866
Authentication-Results: server2.sourceware.org;
arc=none smtp.remote-ip=2607:f8b0:4864:20::c2a
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703060151; cv=none;
b=QNnEVOvFSQlIzb2h0imslRwbVeMW0YSFPka6rTzQ847B8BQYSu7a/ByMXMbT7X/5BBTby1C2qMmlCe20RX3WumZGjfOqJkjOLuIUeTcmnSnb0dpSmF1o/kzTo9xfYf5ZlolwUf9zyOKr5zix8i2FougUtppXuWK+JZI8JQwuLjA=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1703060151; c=relaxed/simple;
bh=ej1FsK9ASeOT52q/MwUpL9AW00UHkb/PgbnZ1LxvOFM=;
h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;
b=CJa7+r9yTPu4kfiq8McPgsLJSI93qVHgM9zUljq8Ajtp07BlWjgi0aOBIPLWvUicriO7tuo8dOY4JQx7uMxAiYFvGz7T7nC9/N9EUu9AvKnA1ptXFptXAFyFKW5w7vI+EEv0jbVumdgowxYfDAfhkl02yqjE9DleeuWmegoFqNE=
ARC-Authentication-Results: i=1; server2.sourceware.org
Received: by mail-oo1-xc2a.google.com with SMTP id
006d021491bc7-593efe46fc2so771488eaf.2
for ; Wed, 20 Dec 2023 00:15:49 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=adacore.com; s=google; t=1703060149; x=1703664949; darn=gcc.gnu.org;
h=mime-version:user-agent:message-id:in-reply-to:date:references
:organization:subject:cc:to:from:from:to:cc:subject:date:message-id
:reply-to; bh=etAgcqZgR/9X0o1Iz9iYc4YsWr52aH8L0YlnDnMK6gY=;
b=g6ZLmM41cTAOKkQDIuW0hgpRm2LTkKqIOfpgfFRBOu1v+IM6buCLSx7F4guLu/A71S
r/D/Z6/pYzZQFLD4BrGTAU9xm6kngFwdJU29cWVVczMgsHOqTckA83TaNzLRCmnoE4U3
1II8C+1H4owTcPN3ARbFs2E98kAWGczRYCJ3hQS3IKHrJCrfIzOZKpqHZanDglCNt1UN
aO5AldIj/ZXZoAjBUE7WyDmOYncgGZSG/38+t1iyhviN280ZtFtQprWByO+P4G7GpCPw
h3IW0ySyWjX7uhxyUCDaJQh1Bs7a4RXzcCFZhP3aSv1TNVwxoaOA+FswHKBHmAHcFyNJ
8d5w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1703060149; x=1703664949;
h=mime-version:user-agent:message-id:in-reply-to:date:references
:organization:subject:cc:to:from:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=etAgcqZgR/9X0o1Iz9iYc4YsWr52aH8L0YlnDnMK6gY=;
b=iu2RoyAQH1C6m7PYtQJ/7v4TX07UyF1UE1X/abdI7pol/mf+pcbUknZYGKn5UwRjv7
g62grpstvwkTZ3lU55vexYMstZA4MCKdu8ptuKAwcvEkqDpud0PUbxCI6wquA15qWCW/
dlWxsI8/Wbs3jaqng2NPQ/vJ0N68qlEviIIEMRNTq07ZF2vNMHTz0neHWWt9HOoBwUap
F9Qzno/FsSEQY+nZq4fxdd+I61bpdQUvcVHgwr22fJ89X5LMPmMc/neozaPfFl7TkpSv
vDpaWDUoElWgxdKXuDICH8b/8jxZ++B4+3SVtZiWP2PijRwgHgofmit60045hUYAbMEK
+mMg==
X-Gm-Message-State: AOJu0YzpYU5EiwLzkqvDO7iPHPXeqx7nmsk7LLKg58EwsqcxXSsflOD6
NmBHTzVBywggTuZ7hBI2+T4bqw==
X-Received: by 2002:a05:6359:6082:b0:173:227:39bb with SMTP id
ry2-20020a056359608200b00173022739bbmr997577rwb.0.1703060148769;
Wed, 20 Dec 2023 00:15:48 -0800 (PST)
Received: from free.home ([2804:7f1:2080:dd67:1c01:ac85:7bb4:256d])
by smtp.gmail.com with ESMTPSA id
q20-20020a62ae14000000b006cb4fa1174dsm7517444pff.124.2023.12.20.00.15.47
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 20 Dec 2023 00:15:47 -0800 (PST)
Received: from livre (livre.home [172.31.160.2])
by free.home (8.15.2/8.15.2) with ESMTPS id 3BK8Fdjv683154
(version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);
Wed, 20 Dec 2023 05:15:39 -0300
From: Alexandre Oliva
To: Richard Biener
Cc: gcc-patches@gcc.gnu.org
Subject: [PATCH FYI] www: new AdaCore-contributed hardening features in gcc
13 and 14
Organization: Free thinker, does not speak for AdaCore
References:
Date: Wed, 20 Dec 2023 05:15:39 -0300
In-Reply-To:
(Richard Biener's message of "Thu, 30 Nov 2023 13:00:08 +0100")
Message-ID:
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.84
X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT,
KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP,
T_SCC_BODY_TEXT_LINE,
WEIRD_QUOTING autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: gcc-patches@gcc.gnu.org
X-Mailman-Version: 2.1.30
Precedence: list
List-Id: Gcc-patches mailing list
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org
X-getmail-retrieved-from-mailbox: INBOX
X-GMAIL-THRID: 1785788028313439060
X-GMAIL-MSGID: 1785788028313439060
On Nov 30, 2023, Richard Biener wrote:
>> >> Here are changes.html entries for this and for the other newly-added
>> >> features:
>>
>> > LGTM.
(sorry, I should be following up two messages upthread, but I don't seem
to have saved that one)
I've finally put in the www changes.
Mention hardening of conditionals (added in gcc 13), control flow
redundancy, hardened booleans, and stack scrubbing.
Also cover forced inlining of string operations while at that.
---
htdocs/gcc-13/changes.html | 6 ++++++
htdocs/gcc-14/changes.html | 29 +++++++++++++++++++++++++++++
2 files changed, 35 insertions(+)
diff --git a/htdocs/gcc-13/changes.html b/htdocs/gcc-13/changes.html
index ee6383a095706..d3bacc167cd30 100644
--- a/htdocs/gcc-13/changes.html
+++ b/htdocs/gcc-13/changes.html
@@ -168,6 +168,12 @@ You may also want to check out our
been added, see also
Profiling and Test Coverage in Freestanding Environments.
+
+ New options -fharden-compares
+ and -fharden-conditional-branches
to verify compares
+ and conditional branches, to detect some power-deprivation
+ hardware attacks, using reversed conditions.
+
diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html
index 11c7ca7e6967f..24e6409a11b68 100644
--- a/htdocs/gcc-14/changes.html
+++ b/htdocs/gcc-14/changes.html
@@ -128,6 +128,35 @@ a work-in-progress.
of hardening flags. The options it enables can be displayed using the
--help=hardened
option.
+
+ New option -fharden-control-flow-redundancy
, to
+ verify, at the end of functions, that the visited basic blocks
+ correspond to a legitimate execution path, so as to detect and
+ prevent attacks that transfer control into the middle of
+ functions.
+
+
+ New type attribute hardbool
, for C and Ada. Hardened
+ booleans take user-specified representations for true
+ and false
, presumably with higher hamming distance
+ than standard booleans, and get verified at every use, detecting
+ memory corruption and some malicious attacks.
+
+
+ New type attribute strub
to control stack scrubbing
+ properties of functions and variables. The stack frame used by
+ functions marked with the attribute gets zeroed-out upon returning
+ or exception escaping. Scalar variables marked with the attribute
+ cause functions contaning or accessing them to get stack scrubbing
+ enabled implicitly.
+
+
+ New option -finline-stringops
, to force inline
+ expansion of memcmp
, memcpy
,
+ memmove
and memset
, even when that is
+ not an optimization, to avoid relying on library
+ implementations.
+
New Languages and Language specific improvements