1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

mcheck: Align struct hdr to MALLOC_ALIGNMENT bytes [BZ #28068]

1. Align struct hdr to MALLOC_ALIGNMENT bytes so that malloc hooks in
libmcheck align memory to MALLOC_ALIGNMENT bytes.
2. Remove tst-mallocalign1 from tests-exclude-mcheck for i386 and x32.
3. Add tst-pvalloc-fortify and tst-reallocarray to tests-exclude-mcheck
since they use malloc_usable_size (see BZ #22057).

This fixed BZ #28068.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
This commit is contained in:
H.J. Lu
2021-07-12 14:36:39 -07:00
parent 72e84d1db2
commit 84ea6ea24b
4 changed files with 5 additions and 10 deletions

View File

@ -95,7 +95,9 @@ tests-exclude-mcheck = tst-mallocstate \
tst-malloc_info \
tst-memalign \
tst-posix_memalign \
tst-realloc
tst-realloc \
tst-pvalloc-fortify \
tst-reallocarray
tests-mcheck = $(filter-out $(tests-exclude-mcheck), $(tests))

View File

@ -20,6 +20,7 @@
#ifndef _MALLOC_INTERNAL
# define _MALLOC_INTERNAL
# include <malloc.h>
# include <malloc-size.h>
# include <mcheck.h>
# include <stdint.h>
# include <stdio.h>
@ -53,7 +54,7 @@ struct hdr
struct hdr *next;
void *block; /* Real block allocated, for memalign. */
unsigned long int magic2; /* Extra, keeps us doubleword aligned. */
};
} __attribute__ ((aligned (MALLOC_ALIGNMENT)));
/* This is the beginning of the list of all memory blocks allocated.
It is only constructed if the pedantic testing is requested. */