|
|
76b6d9 |
From 768358b6a80742f6be68ecd9f952f4b60614df96 Mon Sep 17 00:00:00 2001
|
|
|
76b6d9 |
From: Eyal Itkin <eyalit@checkpoint.com>
|
|
|
76b6d9 |
Date: Tue, 31 Mar 2020 01:55:13 -0400
|
|
|
76b6d9 |
Subject: Typo fixes and CR cleanup in Safe-Linking
|
|
|
76b6d9 |
|
|
|
76b6d9 |
Removed unneeded '\' chars from end of lines and fixed some
|
|
|
76b6d9 |
indentation issues that were introduced in the original
|
|
|
76b6d9 |
Safe-Linking patch.
|
|
|
76b6d9 |
|
|
|
76b6d9 |
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
|
|
|
76b6d9 |
|
|
|
76b6d9 |
diff --git a/malloc/malloc.c b/malloc/malloc.c
|
|
|
76b6d9 |
index 1282863681..0e4acb22f6 100644
|
|
|
76b6d9 |
--- a/malloc/malloc.c
|
|
|
76b6d9 |
+++ b/malloc/malloc.c
|
|
|
76b6d9 |
@@ -2170,7 +2170,7 @@ do_check_malloc_state (mstate av)
|
|
|
76b6d9 |
while (p != 0)
|
|
|
76b6d9 |
{
|
|
|
76b6d9 |
if (__glibc_unlikely (!aligned_OK (p)))
|
|
|
76b6d9 |
- malloc_printerr ("do_check_malloc_state(): " \
|
|
|
76b6d9 |
+ malloc_printerr ("do_check_malloc_state(): "
|
|
|
76b6d9 |
"unaligned fastbin chunk detected");
|
|
|
76b6d9 |
/* each chunk claims to be inuse */
|
|
|
76b6d9 |
do_check_inuse_chunk (av, p);
|
|
|
76b6d9 |
@@ -2977,9 +2977,9 @@ tcache_thread_shutdown (void)
|
|
|
76b6d9 |
while (tcache_tmp->entries[i])
|
|
|
76b6d9 |
{
|
|
|
76b6d9 |
tcache_entry *e = tcache_tmp->entries[i];
|
|
|
76b6d9 |
- if (__glibc_unlikely (!aligned_OK (e)))
|
|
|
76b6d9 |
- malloc_printerr ("tcache_thread_shutdown(): " \
|
|
|
76b6d9 |
- "unaligned tcache chunk detected");
|
|
|
76b6d9 |
+ if (__glibc_unlikely (!aligned_OK (e)))
|
|
|
76b6d9 |
+ malloc_printerr ("tcache_thread_shutdown(): "
|
|
|
76b6d9 |
+ "unaligned tcache chunk detected");
|
|
|
76b6d9 |
tcache_tmp->entries[i] = REVEAL_PTR (e->next);
|
|
|
76b6d9 |
__libc_free (e);
|
|
|
76b6d9 |
}
|
|
|
76b6d9 |
@@ -4225,14 +4225,14 @@ _int_free (mstate av, mchunkptr p, int have_lock)
|
|
|
76b6d9 |
for (tmp = tcache->entries[tc_idx];
|
|
|
76b6d9 |
tmp;
|
|
|
76b6d9 |
tmp = REVEAL_PTR (tmp->next))
|
|
|
76b6d9 |
- {
|
|
|
76b6d9 |
- if (__glibc_unlikely (!aligned_OK (tmp)))
|
|
|
76b6d9 |
- malloc_printerr ("free(): unaligned chunk detected in tcache 2");
|
|
|
76b6d9 |
- if (tmp == e)
|
|
|
76b6d9 |
- malloc_printerr ("free(): double free detected in tcache 2");
|
|
|
76b6d9 |
- /* If we get here, it was a coincidence. We've wasted a
|
|
|
76b6d9 |
- few cycles, but don't abort. */
|
|
|
76b6d9 |
- }
|
|
|
76b6d9 |
+ {
|
|
|
76b6d9 |
+ if (__glibc_unlikely (!aligned_OK (tmp)))
|
|
|
76b6d9 |
+ malloc_printerr ("free(): unaligned chunk detected in tcache 2");
|
|
|
76b6d9 |
+ if (tmp == e)
|
|
|
76b6d9 |
+ malloc_printerr ("free(): double free detected in tcache 2");
|
|
|
76b6d9 |
+ /* If we get here, it was a coincidence. We've wasted a
|
|
|
76b6d9 |
+ few cycles, but don't abort. */
|
|
|
76b6d9 |
+ }
|
|
|
76b6d9 |
}
|
|
|
76b6d9 |
|
|
|
76b6d9 |
if (tcache->counts[tc_idx] < mp_.tcache_count)
|
|
|
76b6d9 |
@@ -4506,7 +4506,7 @@ static void malloc_consolidate(mstate av)
|
|
|
76b6d9 |
do {
|
|
|
76b6d9 |
{
|
|
|
76b6d9 |
if (__glibc_unlikely (!aligned_OK (p)))
|
|
|
76b6d9 |
- malloc_printerr ("malloc_consolidate(): " \
|
|
|
76b6d9 |
+ malloc_printerr ("malloc_consolidate(): "
|
|
|
76b6d9 |
"unaligned fastbin chunk detected");
|
|
|
76b6d9 |
|
|
|
76b6d9 |
unsigned int idx = fastbin_index (chunksize (p));
|
|
|
76b6d9 |
@@ -4938,7 +4938,7 @@ int_mallinfo (mstate av, struct mallinfo *m)
|
|
|
76b6d9 |
p = REVEAL_PTR (p->fd))
|
|
|
76b6d9 |
{
|
|
|
76b6d9 |
if (__glibc_unlikely (!aligned_OK (p)))
|
|
|
76b6d9 |
- malloc_printerr ("int_mallinfo(): " \
|
|
|
76b6d9 |
+ malloc_printerr ("int_mallinfo(): "
|
|
|
76b6d9 |
"unaligned fastbin chunk detected");
|
|
|
76b6d9 |
++nfastblocks;
|
|
|
76b6d9 |
fastavail += chunksize (p);
|
|
|
76b6d9 |
@@ -5480,7 +5480,7 @@ __malloc_info (int options, FILE *fp)
|
|
|
76b6d9 |
while (p != NULL)
|
|
|
76b6d9 |
{
|
|
|
76b6d9 |
if (__glibc_unlikely (!aligned_OK (p)))
|
|
|
76b6d9 |
- malloc_printerr ("__malloc_info(): " \
|
|
|
76b6d9 |
+ malloc_printerr ("__malloc_info(): "
|
|
|
76b6d9 |
"unaligned fastbin chunk detected");
|
|
|
76b6d9 |
++nthissize;
|
|
|
76b6d9 |
p = REVEAL_PTR (p->fd);
|