]> 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:00:49 +0000 (15:00 +0100)
commit54ba8bcd42355ad0c0ca763b6bba40a2b2829f38
tree66181fb6174eae22002a83a85b9a5e3854610738
parentf9c3c12f3365c3e26aa11a31c6effea7d959f0ba
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