about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2021-02-04 11:38:23 +0000
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2021-03-19 11:46:20 +0000
commit67c2661c42f047abb0863c95dd385eaa656bcb47 (patch)
tree592c78f73e9e49c597b3f61640e137d621246942
parentb3c08077cf6d884f45013168cd67e6e5133badf6 (diff)
downloadglibc-67c2661c42f047abb0863c95dd385eaa656bcb47.tar.gz
glibc-67c2661c42f047abb0863c95dd385eaa656bcb47.tar.xz
glibc-67c2661c42f047abb0863c95dd385eaa656bcb47.zip
malloc: Simplify __mtag_tag_new_usable
The chunk cannot be a dumped one here.  The only non-obvious cases
are free and realloc which may be called on a dumped area chunk,
but in both cases it can be verified that tagging is already
avoided for dumped area chunks.

Reviewed-by: DJ Delorie <dj@redhat.com>
-rw-r--r--malloc/arena.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/malloc/arena.c b/malloc/arena.c
index bf17be27d4..0777dc70c6 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -298,11 +298,6 @@ __mtag_tag_new_usable (void *ptr)
   if (ptr)
     {
       mchunkptr cp = mem2chunk(ptr);
-      /* This likely will never happen, but we can't handle retagging
-	 chunks from the dumped main arena.  So just return the
-	 existing pointer.  */
-      if (DUMPED_MAIN_ARENA_CHUNK (cp))
-	return ptr;
       ptr = __libc_mtag_tag_region (__libc_mtag_new_tag (ptr),
 				    CHUNK_AVAILABLE_SIZE (cp) - CHUNK_HDR_SZ);
     }