This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2 2/7] malloc: Additional checks for unsorted bin integrity I.
- From: Florian Weimer <fweimer at redhat dot com>
- To: Istvan Kurucsai <pistukem at gmail dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 17 Aug 2018 16:07:37 +0200
- Subject: Re: [PATCH v2 2/7] malloc: Additional checks for unsorted bin integrity I.
- References: <1510068430-27816-1-git-send-email-pistukem@gmail.com> <1510068430-27816-3-git-send-email-pistukem@gmail.com> <5ccf43e6-88b4-4863-69a3-2971ccd640e2@redhat.com> <CAHJ3J3nW_CDjizW1JKMH=349KGfZxAKcdBmjKp1d1VN4RnOCMA@mail.gmail.com>
On 01/16/2018 02:54 PM, Istvan Kurucsai wrote:
+ if (__glibc_unlikely ((prev_size (next) & ~(SIZE_BITS)) != size))
+ malloc_printerr ("malloc(): mismatching next->prev_size (unsorted)");
Is the masking required? I think prev_size is stored without the bits.
+ if (__glibc_unlikely (bck->fd != victim)
+ || __glibc_unlikely (victim->fd != unsorted_chunks (av)))
+ malloc_printerr ("malloc(): unsorted double linked list corrupted");
+ if (__glibc_unlikely (prev_inuse(next)))
+ malloc_printerr ("malloc(): invalid next->prev_inuse (unsorted)");
Space missing after prev_inuse.
Otherwise, this looks okay.
Thanks,
Florian