public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@redhat.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: Eyal Itkin <eyal.itkin@gmail.com>,
	GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [suggestion] tcache double-free check
Date: Wed, 22 Jul 2020 22:35:40 -0400	[thread overview]
Message-ID: <66144794-20fe-b271-91f0-86456838e7df@redhat.com> (raw)
In-Reply-To: <87lfjdtned.fsf@oldenburg2.str.redhat.com>

On 7/21/20 2:03 AM, Florian Weimer wrote:
> * 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.

I'm not against it, but we'd need something that is random, and for that
we need entropy. What have we got to use?

-- 
Cheers,
Carlos.


  reply	other threads:[~2020-07-23  2:35 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
2020-07-23  2:35     ` Carlos O'Donell [this message]
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=66144794-20fe-b271-91f0-86456838e7df@redhat.com \
    --to=carlos@redhat.com \
    --cc=eyal.itkin@gmail.com \
    --cc=fweimer@redhat.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).