This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] malloc: Fix for infinite loop in memalign/posix_memalign.
- From: Ryan Arnold <ryan dot arnold at linaro dot org>
- To: Will Newton <will dot newton at linaro dot org>, "Carlos O'Donell" <carlos at redhat dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>, Patch Tracking <patches at linaro dot org>
- Date: Tue, 29 Oct 2013 17:43:12 -0700
- Subject: Re: [PATCH] malloc: Fix for infinite loop in memalign/posix_memalign.
- Authentication-results: sourceware.org; auth=none
- References: <52569CED dot 3060700 at linaro dot org>
On Thu, Oct 10, 2013 at 5:26 AM, Will Newton <will.newton@linaro.org> wrote:
>
> A very large alignment argument passed to mealign/posix_memalign
> causes _int_memalign to enter an infinite loop. Limit the maximum
> alignment value to the maximum representable power of two to
> prevent this from happening.
>
> Changelog:
>
> 2013-10-10 Will Newton <will.newton@linaro.org>
>
> [BZ #16038]
> * malloc/hooks.c (memalign_check): Limit alignment to the
> maximum representable power of two.
> * malloc/malloc.c (__libc_memalign): Likewise.
> * malloc/tst-memalign.c (do_test): Add test for very
> large alignment values.
> * malloc/tst-posix_memalign.c (do_test): Likewise.
I think the patch looks good. Carlos, what do you think?
Ryan