public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Carlos O'Donell <carlos@redhat.com>
Cc: Eyal Itkin <eyal.itkin@gmail.com>,
	GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [suggestion] tcache double-free check
Date: Tue, 21 Jul 2020 08:03:54 +0200	[thread overview]
Message-ID: <87lfjdtned.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <7cdac141-6a06-e6b8-7a2e-66e74c050bc9@redhat.com> (Carlos O'Donell's message of "Mon, 20 Jul 2020 22:44:28 -0400")

* Carlos O'Donell:

>> Instead of using some arbitrary constant or coming up with a fancy
>> random value, is it possible we update the key to something that won't
>> point to a critical memory management struct such as the tcache
>> control block? I suggest a simple change that will ensure that the
>> value used won't be a pointer that can be dereferenced: ~tcache
>> (instead of tcache). The bitwise not costs a mere 1 CPU cycle, while
>> making sure the key won't be a valid memory address.
>
> That sounds good to me.
>
> I assume the point being that you can't use a "memory derefernce"
> gadget directly with that memory, you'd need some other primitive
> to process the ~tcache.

Why can't we use a random marker value?  Then we don't leak an address,
either.

Thanks,
Florian


  reply	other threads:[~2020-07-21  6:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-19  6:40 Eyal Itkin
2020-07-21  2:44 ` Carlos O'Donell
2020-07-21  6:03   ` Florian Weimer [this message]
2020-07-23  2:35     ` Carlos O'Donell
2020-07-23 11:56       ` Adhemerval Zanella
2020-07-23 12:06         ` Florian Weimer
2020-07-23 21:26           ` Carlos O'Donell
2020-07-23 22:07             ` Eyal Itkin
2020-07-24  3:01               ` Carlos O'Donell
2020-07-24 12:29               ` Adhemerval Zanella

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=87lfjdtned.fsf@oldenburg2.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=carlos@redhat.com \
    --cc=eyal.itkin@gmail.com \
    --cc=libc-alpha@sourceware.org \
    /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).