diff options
author | 2019-05-10 16:38:21 +0100 | |
---|---|---|
committer | 2019-05-10 16:38:21 +0100 | |
commit | 5ad533e8e65092be962e414e0417112c65d154fb (patch) | |
tree | bb926e04c328e70f54fc026cbee805c52d9b2f6d /manual | |
parent | sem_close: Use __twalk_r (diff) | |
download | glibc-5ad533e8e65092be962e414e0417112c65d154fb.tar.gz glibc-5ad533e8e65092be962e414e0417112c65d154fb.tar.bz2 glibc-5ad533e8e65092be962e414e0417112c65d154fb.zip |
Fix tcache count maximum (BZ #24531)
The tcache counts[] array is a char, which has a very small range and thus
may overflow. When setting tcache_count tunable, there is no overflow check.
However the tunable must not be larger than the maximum value of the tcache
counts[] array, otherwise it can overflow when filling the tcache.
[BZ #24531]
* malloc/malloc.c (MAX_TCACHE_COUNT): New define.
(do_set_tcache_count): Only update if count is small enough.
* manual/tunables.texi (glibc.malloc.tcache_count): Document max value.
Diffstat (limited to 'manual')
-rw-r--r-- | manual/tunables.texi | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/manual/tunables.texi b/manual/tunables.texi index 749cabff1b..ae638823a2 100644 --- a/manual/tunables.texi +++ b/manual/tunables.texi @@ -189,8 +189,8 @@ per-thread cache. The default (and maximum) value is 1032 bytes on @deftp Tunable glibc.malloc.tcache_count The maximum number of chunks of each size to cache. The default is 7. -There is no upper limit, other than available system memory. If set -to zero, the per-thread cache is effectively disabled. +The upper limit is 127. If set to zero, the per-thread cache is effectively +disabled. The approximate maximum overhead of the per-thread cache is thus equal to the number of bins times the chunk count in each bin times the size |