mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2024-12-20 13:24:21 -05:00
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:
parent
2c421590b5
commit
d757835d90
@ -2,11 +2,11 @@
|
||||
|
||||
__attribute__((optimize(0)))
|
||||
int main(void) {
|
||||
char *p = malloc(128 * 1024);
|
||||
char *p = malloc(256 * 1024);
|
||||
if (!p) {
|
||||
return 1;
|
||||
}
|
||||
*(p + 128 * 1024 + 7) = 0;
|
||||
*(p + 256 * 1024 + 7) = 0;
|
||||
free(p);
|
||||
return 0;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ class TestSimpleMemoryCorruption(unittest.TestCase):
|
||||
def test_eight_byte_overflow_large(self):
|
||||
_stdout, _stderr, returncode = self.run_test(
|
||||
"eight_byte_overflow_large")
|
||||
self.assertEqual(returncode, 0)
|
||||
self.assertEqual(returncode, -11)
|
||||
|
||||
def test_eight_byte_overflow_small(self):
|
||||
_stdout, stderr, returncode = self.run_test(
|
||||
|
Loading…
Reference in New Issue
Block a user