public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@redhat.com>
To: 清水祐太郎 <simiyu@shift-crops.net>, "Ondřej Bílka" <neleai@seznam.cz>
Cc: "libc-help@sourceware.org" <libc-help@sourceware.org>
Subject: Re: malloc/free: tcache security patch
Date: Sat, 21 Apr 2018 02:06:00 -0000	[thread overview]
Message-ID: <f5950991-a3fa-974f-0008-f47c5e8ed10e@redhat.com> (raw)
In-Reply-To: <20180421005820.9827D10E8014@mail.shift-crops.net>

On 04/20/2018 07:58 PM, 清水祐太郎 wrote:
> However, as long as there is a possibility that a bug exists, it is
> necessary to protect it with glibc.

This is not true at all.

We assume a correctly functioning program and optimize for that.

For example the dynamic loader does not protect against all forms of
errors in ELF files.

Nor does malloc catch all forms of corruption, and it should not,
because doing so is too expensive.

The checks in malloc, particularly checks in the hot path that add
instructions to tcache, *must* be rationalized as a balance between
catching corruption for debugging purposes and performance. It provides
only marginal post-attack mitigation, which is why it must be very low
cost, particularly in tcache.

Please see this for a detailed discussion on the topic:
https://sourceware.org/glibc/wiki/Style_and_Conventions#Error_Handling

What performance impact do your patches have on x86_64?

-- 
Cheers,
Carlos.

  reply	other threads:[~2018-04-21  2:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20 12:44 清水祐太郎
2018-04-20 21:36 ` Ondřej Bílka
2018-04-21  0:58   ` 清水祐太郎
2018-04-21  2:06     ` Carlos O'Donell [this message]
2018-04-21  5:37       ` 清水祐太郎

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=f5950991-a3fa-974f-0008-f47c5e8ed10e@redhat.com \
    --to=carlos@redhat.com \
    --cc=libc-help@sourceware.org \
    --cc=neleai@seznam.cz \
    --cc=simiyu@shift-crops.net \
    /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).