mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-26 17:13:35 +03:00
Implement use-after-free detection using junk and stash.
On deallocation, sampled pointers (specially aligned) get junked and stashed into tcache (to prevent immediate reuse). The expected behavior is to have read-after-free corrupted and stopped by the junk-filling, while write-after-free is checked when flushing the stashed pointers.
This commit is contained in:
parent
06aac61c4b
commit
b75822bc6e
22 changed files with 793 additions and 42 deletions
|
|
@ -157,6 +157,8 @@ arena_stats_merge(tsdn_t *tsdn, arena_t *arena, unsigned *nthreads,
|
|||
cache_bin_t *cache_bin = &descriptor->bins[i];
|
||||
astats->tcache_bytes +=
|
||||
cache_bin_ncached_get_remote(cache_bin,
|
||||
&tcache_bin_info[i]) * sz_index2size(i) +
|
||||
cache_bin_nstashed_get(cache_bin,
|
||||
&tcache_bin_info[i]) * sz_index2size(i);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue