r210275 - in /trunk/gcc: ChangeLog cfgexpand.c ...

fw@gcc.gnu.org fw@gcc.gnu.org
Fri May 9 12:23:00 GMT 2014


Author: fw
Date: Fri May  9 12:23:46 2014
New Revision: 210275

URL: http://gcc.gnu.org/viewcvs?rev=210275&root=gcc&view=rev
Log:
-fstack-protector-strong: Instrumentation for return slots

This patch fixes a loophole in the -fstack-protector-strong protection.
If a function call uses a return slot, the caller needs stack protector
instrumentation because the return slot is addressable. 

gcc/

2014-05-09  Florian Weimer  <fweimer@redhat.com>

	* cfgexpand.c (stack_protect_decl_p): New function, extracted from
	expand_used_vars.
	(stack_protect_return_slot_p): New function.
	(expand_used_vars): Call stack_protect_decl_p and
	stack_protect_return_slot_p for -fstack-protector-strong.

gcc/testsuite/

2014-05-09  Florian Weimer  <fweimer@redhat.com>

	* gcc.dg/fstack-protector-strong.c: Add coverage for return slots.
	* g++.dg/fstack-protector-strong.C: Likewise.
	* gcc.target/i386/ssp-strong-reg.c: New file.

Added:
    trunk/gcc/testsuite/gcc.target/i386/ssp-strong-reg.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cfgexpand.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/fstack-protector-strong.C
    trunk/gcc/testsuite/gcc.dg/fstack-protector-strong.c



More information about the Gcc-cvs mailing list