public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Zack Weinberg <zackw@panix.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: Joseph Myers <joseph@codesourcery.com>,
	GNU C Library <libc-alpha@sourceware.org>
Subject: arc4random (was Re: Remove add-ons mechanism)
Date: Fri, 29 Sep 2017 23:58:00 -0000	[thread overview]
Message-ID: <CAKCAbMhfO-0wT9oJcAbRQquz3iBkJuVeejk4su73FmhUgG-C6Q@mail.gmail.com> (raw)

On Fri, Sep 29, 2017 at 7:04 AM, Florian Weimer <fweimer@redhat.com> wrote:
> On 09/29/2017 12:01 AM, Zack Weinberg wrote:
>> I don't disagree with this patch exactly, but I was thinking of using
>> the add-ons mechanism to prototype a CSPRNG addition to glibc
>
> I've got something towards an implementation of arc4random (not certifiable,
> but it should be unpredictable in practice).

I'm delighted to hear that, and please let me know if i can help in
any way.  I don't have a whole lot of time toward libc hacking this
cycle but I would really like to see it done this cycle, so I'll find
the time. :)

> I think I found a way to do full fork protection even without
> MADV_WIPEONFORK, using a global counter in a MAP_SHARED segment. Reseeding
> is still needed to deal with a counter overflow on 32-bit architectures, and
> there is some overhead by the globally shared counter, but I think it is
> superior to all approaches I've seen so far (and it does not require a fork
> handler or a system call for every random number generation).

Is the idea that after a fork, processes may share RNG state but they
see each others' counter increments so they won't return the same
random bits from paired calls?  Kind of like how it would work for
multiple threads with a shared but atomically accessed RNG state?

zw

             reply	other threads:[~2017-09-29 23:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-29 23:58 Zack Weinberg [this message]
2017-09-30  6:22 ` arc4random Florian Weimer

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=CAKCAbMhfO-0wT9oJcAbRQquz3iBkJuVeejk4su73FmhUgG-C6Q@mail.gmail.com \
    --to=zackw@panix.com \
    --cc=fweimer@redhat.com \
    --cc=joseph@codesourcery.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).