]> git.ipfire.org Git - thirdparty/glibc.git/commit
Fix tcache count maximum (BZ #24531)
authorWilco Dijkstra <wdijkstr@arm.com>
Fri, 10 May 2019 15:38:21 +0000 (16:38 +0100)
committerWilco Dijkstra <wdijkstr@arm.com>
Wed, 22 May 2019 14:41:24 +0000 (15:41 +0100)
commitac92c66821fae2ae6587114acc454f97a6bc7859
tree0a6c4a683a39efeeb03970404e70bc65de387222
parent4385ec1d8af4203b23dce8c9dc2f1aff5acaf094
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.

(cherry picked from commit 5ad533e8e65092be962e414e0417112c65d154fb)
ChangeLog
malloc/malloc.c
manual/tunables.texi