Dynamically allocate scudo allocation buffer.
This is so we can increase the buffer size for finding elusive bugs. Tested by hand with this program ``` int main(int argc, char** argv) { if (argc < 2) return 1; int n = atoi(argv[1]); char* x = reinterpret_cast<char*>(malloc(1)); *((volatile char*)x) = 1; free(x); for (; n > 0; --n) { char* y = reinterpret_cast<char*>(malloc(1024)); *((volatile char*)y) = 1; free(y); } *x = 2; return 0; } ``` SCUDO_OPTIONS=allocation_ring_buffer_size=30000 ./uaf 1000000 -> no allocation trace SCUDO_OPTIONS=allocation_ring_buffer_size=30000000 ./uaf 1000000 -> allocation trace Reviewed By: hctim, eugenis Differential Revision: https://reviews.llvm.org/D140932
Loading
Please sign in to comment