public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Ayush Mittal <ayush.m@samsung.com>
To: libc-alpha@sourceware.org
Cc: maninder1.s@samsung.com, a.sahrawat@samsung.com,
	akhilesh.k@samsung.com, Ayush Mittal <ayush.m@samsung.com>
Subject: [PATCH 1/1] malloc: remove redundant check of unsorted bin corruption
Date: Thu,  8 Apr 2021 14:59:09 +0530	[thread overview]
Message-ID: <1617874149-11830-1-git-send-email-ayush.m@samsung.com> (raw)
In-Reply-To: <CGME20210408092938epcas5p4c8c403c2aa26d19185e1be641ce293aa@epcas5p4.samsung.com>

* malloc/malloc.c (_int_malloc): remove redundant check of
  unsorted bin corruption

With commit "b90ddd08f6dd688e651df9ee89ca3a69ff88cd0c"
(malloc: Additional checks for unsorted bin integrity),
same check of (bck->fd != victim) is added before checking of unsorted
chunk corruption, which was added in "bdc3009b8ff0effdbbfb05eb6b10966753cbf9b8"
(Added check before removing from unsorted list).

..
3773           if (__glibc_unlikely (bck->fd != victim)
3774               || __glibc_unlikely (victim->fd != unsorted_chunks (av)))
3775             malloc_printerr ("malloc(): unsorted double linked list corrupted");
..
..
3815           /* remove from unsorted list */
3816          if (__glibc_unlikely (bck->fd != victim))
3817            malloc_printerr ("malloc(): corrupted unsorted chunks 3");
3818          unsorted_chunks (av)->bk = bck;
..

So this extra check can be removed.

Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Signed-off-by: Ayush Mittal <ayush.m@samsung.com>
---
 malloc/malloc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/malloc/malloc.c b/malloc/malloc.c
index 5b87bdb081..77bde442ab 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -3813,8 +3813,6 @@ _int_malloc (mstate av, size_t bytes)
             }
 
           /* remove from unsorted list */
-          if (__glibc_unlikely (bck->fd != victim))
-            malloc_printerr ("malloc(): corrupted unsorted chunks 3");
           unsorted_chunks (av)->bk = bck;
           bck->fd = unsorted_chunks (av);
 
-- 
2.17.1


       reply	other threads:[~2021-04-08  9:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20210408092938epcas5p4c8c403c2aa26d19185e1be641ce293aa@epcas5p4.samsung.com>
2021-04-08  9:29 ` Ayush Mittal [this message]
2023-02-22 22:05   ` DJ Delorie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1617874149-11830-1-git-send-email-ayush.m@samsung.com \
    --to=ayush.m@samsung.com \
    --cc=a.sahrawat@samsung.com \
    --cc=akhilesh.k@samsung.com \
    --cc=libc-alpha@sourceware.org \
    --cc=maninder1.s@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).