]> git.ipfire.org Git - thirdparty/glibc.git/commit - NEWS
Fix integer overflow in malloc when tcache is enabled [BZ #22375]
authorArjun Shankar <arjun@redhat.com>
Thu, 30 Nov 2017 12:31:45 +0000 (13:31 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Wed, 6 Dec 2017 06:44:51 +0000 (07:44 +0100)
commitdf8c219cb987cfe85c550efa693a1383a11e38aa
treea866156f613faaa6c87edb9c1a9ce8d76afe1aa0
parent0890d5379cac9b7e2a5f09c3647ebad235c1442d
Fix integer overflow in malloc when tcache is enabled [BZ #22375]

When the per-thread cache is enabled, __libc_malloc uses request2size (which
does not perform an overflow check) to calculate the chunk size from the
requested allocation size. This leads to an integer overflow causing malloc
to incorrectly return the last successfully allocated block when called with
a very large size argument (close to SIZE_MAX).

This commit uses checked_request2size instead, removing the overflow.

(cherry picked from commit 34697694e8a93b325b18f25f7dcded55d6baeaf6)
ChangeLog
NEWS
malloc/malloc.c