This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] malloc: Fix for infinite loop in memalign/posix_memalign.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]