Commit Graph

587 Commits

Author SHA1 Message Date
Daniel Micay
d35674c67e expected_size is not an output parameter 2018-10-14 18:28:01 -04:00
Daniel Micay
8b033c5e44 make ALIGNMENT_CEILING into a function 2018-10-14 18:23:42 -04:00
Daniel Micay
118549451b add tidy target to the Makefile for clang-tidy 2018-10-14 18:05:08 -04:00
Daniel Micay
b66ca56ba1 initialize ptr to nullptr in handle_out_of_memory
It will break out of the loop in the first iteration if there's no
handler or the handler throws an out-of-memory error.
2018-10-14 18:00:55 -04:00
Daniel Micay
4fbfe4d3ec fix canary space reservation for pvalloc 2018-10-14 17:49:36 -04:00
Daniel Micay
f11c448a0d slightly reorganize slab metadata 2018-10-14 15:13:06 -04:00
Daniel Micay
3db3e167ed remove usage of ATOMIC_VAR_INIT
This was never truly required in practice and has been officially
obsoleted in C17.
2018-10-13 16:50:49 -04:00
Daniel Micay
65a7014b48 randomize free slabs reuse 2018-10-13 13:57:00 -04:00
Daniel Micay
83df37436d fix usage of pthread_atfork for glibc < 2.28 2018-10-12 16:03:15 -04:00
Daniel Micay
0a64c7d6a1 document the randomized array in the quarantine 2018-10-12 15:10:35 -04:00
Daniel Micay
6669166fe9 move memory_unmap outside of lock scope 2018-10-12 15:06:51 -04:00
Daniel Micay
b2007ad3d9 implement randomization for the region quarantine 2018-10-12 15:03:59 -04:00
Daniel Micay
ac2b940f0f fix compatibility with older GCC versions
Avoid relying on compiler extensions supporting more flexible usage of
constants closer to how it works in C++.
2018-10-11 18:12:49 -04:00
Daniel Micay
e47c783524 add test for delete size mismatch 2018-10-11 01:45:47 -04:00
Daniel Micay
7606bf4c1f clean up includes in new.cc 2018-10-11 01:35:25 -04:00
Daniel Micay
54c78fe1c2 distinguish between mmap / mremap errors 2018-10-10 19:05:35 -04:00
Daniel Micay
2381d973b1 expand on metadata address space security 2018-10-10 18:55:31 -04:00
Daniel Micay
29fd86ab37 document sized deallocation validation 2018-10-10 18:49:17 -04:00
Daniel Micay
c74fe56091 minor include style fix 2018-10-10 18:19:56 -04:00
Daniel Micay
ddcdd9423c make the memory mapping quarantine more efficient 2018-10-09 14:13:59 -04:00
Daniel Micay
57d5ab769b add write-after-free tests with potential reuse 2018-10-08 17:41:06 -04:00
Daniel Micay
5fa6e01929 clearer name for MREMAP_MAYMOVE threshold 2018-10-08 17:18:13 -04:00
Daniel Micay
1a10c17e8b add quarantine for large allocations 2018-10-08 16:14:07 -04:00
Daniel Micay
cc9699f1b4 use multi-word bitmap to support up to 256 slots 2018-10-07 18:50:06 -04:00
Daniel Micay
5e2f03296e remove old debugging code 2018-10-07 16:18:17 -04:00
Daniel Micay
fa2796a941 Makefile: add missing dependencies 2018-10-07 11:31:07 -04:00
Daniel Micay
cf07ae6007 update configuration in README 2018-10-06 15:38:09 -04:00
Daniel Micay
348f9fa557 add configuration for frequency of guard slabs 2018-10-06 15:36:03 -04:00
Daniel Micay
4ee12e64e0 configuration for guard region sizes 2018-10-06 15:17:55 -04:00
Daniel Micay
d18b05eaf4 avoid redundant checks for large realloc 2018-10-06 13:31:16 -04:00
Daniel Micay
eb7ced7781 implement in-place growth of large allocations 2018-10-06 13:24:22 -04:00
Daniel Micay
3a936295f8 Makefile: split out shared compiler flags 2018-10-05 02:45:40 -04:00
Daniel Micay
4716ff5b92 explicitly export C++ allocator overrides
This doesn't make any difference for GCC, but these aren't replaced
outside of the library with Clang without explicitly exporting them.
2018-10-05 02:23:49 -04:00
Daniel Micay
e6e9ac1fc9 support replacing C++ new/delete implementation
This adds support for sanity checks based on sized deallocation and will
reduce the overhead of calls through the C++ allocator.
2018-10-05 02:11:29 -04:00
Daniel Micay
3dc49f8f73 slightly improve sized deallocation error messages 2018-10-05 01:06:12 -04:00
Daniel Micay
dcd969ae04 use a consistent style for fixed-size int types
The stdint.h types don't cover 128-bit integers and the underscore makes
them ill suited to usage in function suffixes. Instead, use the common
naming style in the Linux kernel and elsewhere including the ChaCha8
implementation included here.
2018-10-04 15:17:11 -04:00
Daniel Micay
92a33182fb port chacha.h to the code style used elsewhere 2018-10-04 04:13:28 -04:00
Daniel Micay
08a633b244 fix another typo in the README 2018-10-04 04:12:21 -04:00
Daniel Micay
ef32a4b7ea add -pipe to CFLAGS 2018-10-04 04:03:48 -04:00
Daniel Micay
e99191d5d4 document tuning vm.max_map_count 2018-10-04 03:44:19 -04:00
Daniel Micay
d12cf324dd add documentation on testing 2018-10-04 03:27:30 -04:00
Daniel Micay
2a31c7291b add basic documentation on configuration 2018-10-04 03:15:55 -04:00
Daniel Micay
642eed81c0 allow using larger guards on large allocations 2018-10-04 02:58:24 -04:00
Daniel Micay
9b7691a2a7 take canaries into account for the offset test 2018-10-04 02:52:20 -04:00
Daniel Micay
71d52d981e fix output of size class offset test 2018-10-04 02:41:01 -04:00
Daniel Micay
15e5e2d0ac fix typo in README 2018-10-03 17:23:20 -04:00
Daniel Micay
5811bd184c avoid unnecessary preprocessor use for canary mask 2018-10-03 17:17:20 -04:00
Daniel Micay
93fcc6a978 add simple string overflow test 2018-10-03 17:15:38 -04:00
Daniel Micay
b24569b6ca zero leading byte of canaries 2018-10-03 17:09:57 -04:00
Daniel Micay
1fbf0e27f5 make error reporting more robust 2018-10-03 16:58:49 -04:00