From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Google-Smtp-Source: AGHT+IE9+KPn+7M2k8vIGiD9iDiHclQCVZW4HkDnpCaR6b79BpDYDeTzq0HGArYDJO1xvH/fl/b2Jg== 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 Content-Type: text/plain 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 List-Id: 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

    -- Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ Free Software Activist GNU Toolchain Engineer More tolerance and less prejudice are key for inclusion and diversity Excluding neuro-others for not behaving ""normal"" is *not* inclusive