Commit graph

4 commits

Author SHA1 Message Date
Ryan Prichard
76e7fd4e26 Fix modify_stack_protector flake
The previous test would fail to crash if the first byte of the canary was
already NUL (1 of 256 runs assuming uniform canary distribution).

Bug: http://b/121156651
Test: bionic unit tests
2019-01-01 19:46:41 -08:00
Elliott Hughes
17fdd028da Remove a workaround from stack_protector_test that's not needed in master.
The compiler in master doesn't leave a gap between the buffer and the stack
guard canary.

Bug: http://b/27815668
Change-Id: Iae6681683881055c2719d661a2179f5305c23135
2016-04-01 21:02:25 -07:00
Elliott Hughes
6057d184f5 Fix the stack-protector test for x86/x86-64.
Built for fugu this was working fine, but built for generic x86/x86-64
the compiler was (a) optimizing out all the stack writes and (b) inserting
enough padding on x86-64 for the canary to be safely out of the way.

While here, let's tighten up this test so we test that it's sufficient to
only overwrite the buffer by one byte...

(cherry-pick of 6f90c1ac59eb4e7811b7b0e408615049c935c0a9.)

Bug: http://b/27815668
Change-Id: I80a646de4b30fd5c78df20fdaa7e3eb163585caf
2016-04-01 20:08:03 -07:00
Elliott Hughes
fc69a8ad5f Improve and fix the stack-protector tests.
Bug: http://b/26888853
Change-Id: I505dbf7d5934f7247fb639f55dd6a9341df3947b
2016-03-09 14:50:03 -08:00