public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Zack Weinberg <zackw@panix.com>
To: Jeff Law <law@redhat.com>
Cc: Florian Weimer <fweimer@redhat.com>,
	GNU C Library <libc-alpha@sourceware.org>,
	 Joseph Myers <joseph@codesourcery.com>,
	 Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Subject: Re: [PATCH] explicit_bzero final
Date: Fri, 16 Dec 2016 21:35:00 -0000	[thread overview]
Message-ID: <CAKCAbMgxEUP0B3WQJkMK5G9owUsJFpvXv0CRA49J6-Dg9oqQJQ@mail.gmail.com> (raw)
In-Reply-To: <6a5179d4-fe8c-a101-380a-88c3ad94684d@redhat.com>

On Fri, Dec 16, 2016 at 1:26 PM, Jeff Law <law@redhat.com> wrote:
> On 12/15/2016 04:21 PM, Zack Weinberg wrote:
>> To be clear, explicit_bzero itself is not going away.  It is already in
>> use in a wide variety of applications, and substitutes (such as the
>> hypothetical __attribute__((sensitive))) will not become widespread
>> quickly enough to avoid adding it to glibc.  I've been working on this
>> patch off and on for _two years_, and I picked it up from someone else
>> who'd given up on the process after roughly that long himself.  I fully
>> intend to commit it in some form tomorrow evening; I consider missing
>> 2.25 unacceptable.
>
> Understood.  And my position is that explicit_bzero is inherently flawed.
> You really need direct compiler support.
>
> So while it's not going away and it's an incremental improvement over
> nothing, it comes with a cost.  Namely that some objects which previously
> weren't addressable become addressable and are now sitting in memory waiting
> to be extracted.

I do agree with both parts of this as well.

>> What I'd hope we could do with compiler-side smarts is _convert_
>> explicit_bzero to __attribute__((sensitive)) or a clobbering assignment
>> or whatever the most convenient compiler-side representation winds up
>> being, so that artifacts of glibc's implementation become irrelevant.
>
> We can likely infer something passed to explicit_bzero is sensitive and
> build a web to capture whatever DECLs potentially feed the explicit_bzero.
> So we convert the fence to the CONSTRUCTOR assignment.  That's fine. Then
> we'd want DSE to eliminate the memset, then recompute addressability.

What I just committed to glibc does not have the inlines, so that
memset won't be kicking around.  It will probably still be necessary
to recompute addressability after lowering the builtin, though.

I wish I could say that I would have time to help with making compiler
support happen, but realistically I don't.

zw

      reply	other threads:[~2016-12-16 21:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-12 23:06 Zack Weinberg
2016-12-13  1:58 ` Paul Eggert
2016-12-13  7:02 ` Florian Weimer
2016-12-13 15:53   ` Zack Weinberg
2016-12-13 22:47     ` Jeff Law
2016-12-14  1:04       ` Zack Weinberg
2016-12-14  1:05         ` Zack Weinberg
2016-12-14 13:15         ` Florian Weimer
2016-12-14 17:06           ` Florian Weimer
2016-12-14 22:28             ` Zack Weinberg
2016-12-14 22:37               ` Joseph Myers
2016-12-15  9:08               ` Florian Weimer
2016-12-15 10:20                 ` Florian Weimer
2016-12-15 23:31                 ` Zack Weinberg
2016-12-16  7:50                   ` Florian Weimer
2016-12-14 16:58         ` Jeff Law
2016-12-14 23:11           ` Zack Weinberg
2016-12-15  5:25             ` Jeff Law
2016-12-15 23:21               ` Zack Weinberg
2016-12-16 18:26                 ` Jeff Law
2016-12-16 21:35                   ` Zack Weinberg [this message]

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=CAKCAbMgxEUP0B3WQJkMK5G9owUsJFpvXv0CRA49J6-Dg9oqQJQ@mail.gmail.com \
    --to=zackw@panix.com \
    --cc=Wilco.Dijkstra@arm.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=law@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).