This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix integer overflows in internal memalign and malloc functions [BZ #22343]
- From: Zack Weinberg <zackw at panix dot com>
- To: Arjun Shankar <arjun dot is at lostca dot se>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 4 Jan 2018 12:20:03 -0500
- Subject: Re: [PATCH] Fix integer overflows in internal memalign and malloc functions [BZ #22343]
- Authentication-results: sourceware.org; auth=none
- References: <20180104170250.GA72870@aloka.lostca.se>
On Thu, Jan 4, 2018 at 12:02 PM, Arjun Shankar <arjun.is@lostca.se> wrote:
> When posix_memalign is called with an alignment less than MALLOC_ALIGNMENT
> and a requested size close to SIZE_MAX, it falls back to malloc code
> (because the alignment of a block returned by malloc is sufficient to
> satisfy the call). In this case, an integer overflow in _int_malloc leads
> to posix_memalign incorrectly returning successfully.
I'm not qualified to review malloc patches, but I want to point out
that if this patch is approved it should be backported to all active
release branches.
zw