public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <derodat@adacore.com>
To: gcc-patches@gcc.gnu.org
Cc: Alexandre Oliva <oliva@adacore.com>
Subject: [Ada] introduce stack scrub (strub) feature
Date: Tue, 5 Oct 2021 08:26:58 +0000	[thread overview]
Message-ID: <20211005082658.GA2693918@adacore.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1486 bytes --]

This is the GNAT part of the patch that adds the strub attribute for
function and variable types, command-line options, passes and
adjustments to implement it, documentation, and tests.

Besides documentation, the bulk of the patch adds strub(callable) to
subprograms that the compiler may call implicitly.  The reason for
that is that, in -fstrub=strict mode, a context that requires stack
scrubbing can only call subprograms that also perform stack scrubbing,
or that are declared safe to call from strub contexts, i.e.,
strub-callable.  Subprograms that may be implicitly called, and that
are safe to call (i.e., that won't leave on the stack caller-supplied
data that ought to be scrubbed), should thus be marked with this
pragma, so that they don't prevent units from compiling with
-fstrub=strict.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* doc/gnat_rm.rst: Add...
	* doc/gnat_rm/security_hardening_features.rst: New.
	* doc/gnat_rm/about_this_guide.rst: Link to new chapter.
	* gnat_rm.texi: Regenerate.
	* gcc-interface/utils.c (handle_strub_attribute): New.
	(gnat_internal_attribute_table): Add strub.
	* libgnat/a-except.adb: Make Rcheck_CE_* strub-callable.
	* libgnat/a-except.ads (Raise_Exception): Likewise.
	(Raise_Exception_Always): Likewise.
	* libgnat/s-arit128.ads (Multiply_With_Ovflo_Check128):
	Likewise.
	* libgnat/s-arit64.ads (Multiply_With_Ovflo_Check64):
	Likewise.
	* libgnat/s-secsta.ads (SS_Allocate, SS_Mark, SS_Release):
	Likewise.

[-- Attachment #2: patch.diff.gz --]
[-- Type: application/gzip, Size: 73238 bytes --]

             reply	other threads:[~2021-10-05  8:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-05  8:26 Pierre-Marie de Rodat [this message]
2021-10-06 22:23 ` Alexandre Oliva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211005082658.GA2693918@adacore.com \
    --to=derodat@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=oliva@adacore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).