public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] introduce stack scrub (strub) feature
@ 2021-10-05  8:26 Pierre-Marie de Rodat
  2021-10-06 22:23 ` Alexandre Oliva
  0 siblings, 1 reply; 2+ messages in thread
From: Pierre-Marie de Rodat @ 2021-10-05  8:26 UTC (permalink / raw)
  To: gcc-patches; +Cc: Alexandre Oliva

[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Ada] introduce stack scrub (strub) feature
  2021-10-05  8:26 [Ada] introduce stack scrub (strub) feature Pierre-Marie de Rodat
@ 2021-10-06 22:23 ` Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2021-10-06 22:23 UTC (permalink / raw)
  To: Pierre-Marie de Rodat; +Cc: gcc-patches

On Oct  5, 2021, Pierre-Marie de Rodat <derodat@adacore.com> wrote:

> 	* gcc-interface/utils.c (handle_strub_attribute): New.
> 	(gnat_internal_attribute_table): Add strub.

FTR, this is just a dummy.  The actual implementation was submitted
along with the language- and machine-independent infrastructure at
https://gcc.gnu.org/pipermail/gcc-patches/2021-September/579091.html and
it's yet to be reviewed.

-- 
Alexandre Oliva, happy hacker                https://FSFLA.org/blogs/lxo/
   Free Software Activist                       GNU Toolchain Engineer
Disinformation flourishes because many people care deeply about injustice
but very few check the facts.  Ask me about <https://stallmansupport.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-06 22:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05  8:26 [Ada] introduce stack scrub (strub) feature Pierre-Marie de Rodat
2021-10-06 22:23 ` Alexandre Oliva

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).