This is a fully working version of a heap protector, which uses XOR cookies to obfuscate the heap metadata. The hope is that this makes exploitation of simple heap overflows more difficult because the attackers have to obtain the heap guard values first before they can create a malloc chunk that is recognized by the malloc implementation. I verified that existing Emacs binaries which contain a dumped heap will still work after this change. I still need to redo the performance analysis. An older version of the code had these results for one of DJ's workload files: Welch Two Sample t-test data: old_malloc and new_malloc t = -5.0042, df = 157.65, p-value = 1.484e-06 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -4.267772 -1.852228 sample estimates: mean of x mean of y 131.07 134.13 Welch Two Sample t-test data: old_calloc and new_calloc t = -0.90822, df = 197.05, p-value = 0.3649 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -8.435823 3.115823 sample estimates: mean of x mean of y 206.83 209.49 Welch Two Sample t-test data: old_realloc and new_realloc t = -4.7164, df = 122.86, p-value = 6.406e-06 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -4.202311 -1.717689 sample estimates: mean of x mean of y 139.70 142.66 Welch Two Sample t-test data: old_free and new_free t = -3.0362, df = 105.61, p-value = 0.003018 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -1.4546563 -0.3053437 sample estimates: mean of x mean of y 96.47 97.35 So 3 cycles for malloc, realloc and probably calloc, and one cycle for free. I still hope to recover some of the performance loss with micro-optimizations, but I'd like to get the patch committed ASAP to increase testing time before the release. Florian