public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: DJ Delorie <dj@redhat.com>
To: liqingqing <liqingqing3@huawei.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] malloc: Print error when oldsize is not equal to the current size.
Date: Tue, 13 Apr 2021 18:14:10 -0400	[thread overview]
Message-ID: <xnzgy1de8d.fsf@rhel8.vm> (raw)
In-Reply-To: <4574b99b-edac-d8dc-9141-79c3109d2fcc@huawei.com> (message from liqingqing on Thu, 1 Apr 2021 16:51:45 +0800)

liqingqing <liqingqing3@huawei.com> writes:
> the read of the oldsize is not protected by any lock, so check this value to avoid causing bigger mistakes. 

Normally nothing can change oldsize until the oldp chunk is returned to
the arena, and at the point where you added the check that hasn't
happened.  Could you be more specific about how this value might change
out from under us?

Is this a case of "some other thread might corrupt this"?  But that can
happen regardless of lock.

Are you assuming some other malloc/free call could corrupt oldsize while
they hold the lock?  If so, is there a published exploit description for
this?


  reply	other threads:[~2021-04-13 22:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26 11:05 liqingqing
2021-04-01  8:51 ` liqingqing
2021-04-13 22:14   ` DJ Delorie [this message]
2021-04-23  2:23     ` liqingqing
2022-09-22 19:51 ` 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=xnzgy1de8d.fsf@rhel8.vm \
    --to=dj@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=liqingqing3@huawei.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).