increase size for eight_byte_overflow_large test

This was not working as expected due to CONFIG_EXTENDED_SIZE_CLASSES
resulting in 128k being a slab allocation size class. The addition of
padding for the canary pushes it into the next size class, resulting in
this writing over size class rounding padding rather than this actually
being an overflow as intended.
This commit is contained in:
Daniel Micay 2020-04-11 15:17:37 -04:00
parent 2c421590b5
commit d757835d90
2 changed files with 3 additions and 3 deletions

View File

@ -2,11 +2,11 @@
__attribute__((optimize(0))) __attribute__((optimize(0)))
int main(void) { int main(void) {
char *p = malloc(128 * 1024); char *p = malloc(256 * 1024);
if (!p) { if (!p) {
return 1; return 1;
} }
*(p + 128 * 1024 + 7) = 0; *(p + 256 * 1024 + 7) = 0;
free(p); free(p);
return 0; return 0;
} }

View File

@ -51,7 +51,7 @@ class TestSimpleMemoryCorruption(unittest.TestCase):
def test_eight_byte_overflow_large(self): def test_eight_byte_overflow_large(self):
_stdout, _stderr, returncode = self.run_test( _stdout, _stderr, returncode = self.run_test(
"eight_byte_overflow_large") "eight_byte_overflow_large")
self.assertEqual(returncode, 0) self.assertEqual(returncode, -11)
def test_eight_byte_overflow_small(self): def test_eight_byte_overflow_small(self):
_stdout, stderr, returncode = self.run_test( _stdout, stderr, returncode = self.run_test(