public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "adhemerval.zanella at linaro dot org" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/29437] arc4random is too slow
Date: Mon, 08 Aug 2022 12:42:46 +0000	[thread overview]
Message-ID: <bug-29437-131-cSi3Mqo5hL@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29437-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=29437

--- Comment #11 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
(In reply to Florian Weimer from comment #8)
> (In reply to Cristian Rodríguez from comment #4)
> > (In reply to Miroslav Lichvar from comment #0)
> > 
> > > This can be fixed easily in the chrony source code, but I thought it might
> > > be a good example of a real-world application impacted by this change and
> > > there could be others.
> > 
> > You need a PRNG, seeded by a single call to arc4random_buf.. (xoroshiro128+?)
> > People are unfortunately rejecting your usecase as invalid because this does
> > not require a csprng. :-( (to me that sums up everything that is wrong, you
> > known you don't need one, but notmal averege joe programmer has no idea of
> > all the subtleties ans is stuck with using random() ..)
> 
> Absolutely not. The idea behind arc4random is that an entire distribution
> can use this function without worrying performance or properties of the
> generated stream of randomness. It was designed for a search-and-replace of
> calls to random, without case-by-case reviews if the change is actually
> required for security reasons. If the glibc implementation does not meet
> that, we have failed.

I disagree that we have failed, the main problem is that arc4random
implementation from OpenBSD (which is copied on multiple systems and libraries)
did not take into consideration the problems Jason has raised, and thus now
callers expect a certain performance on any possible system (even if the
cryptographic secure part can not be safely enforced).

So the question is should we trade performance or correctness?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2022-08-08 12:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-02 10:46 [Bug libc/29437] New: " mlichvar at redhat dot com
2022-08-02 11:03 ` [Bug libc/29437] " fweimer at redhat dot com
2022-08-02 22:57 ` jason at zx2c4 dot com
2022-08-02 22:58 ` jason at zx2c4 dot com
2022-08-03  6:28 ` mlichvar at redhat dot com
2022-08-06 13:36 ` crrodriguez at opensuse dot org
2022-08-06 13:54 ` crrodriguez at opensuse dot org
2022-08-08 11:05 ` mlichvar at redhat dot com
2022-08-08 12:29 ` adhemerval.zanella at linaro dot org
2022-08-08 12:35 ` fweimer at redhat dot com
2022-08-08 12:37 ` fweimer at redhat dot com
2022-08-08 12:38 ` adhemerval.zanella at linaro dot org
2022-08-08 12:39 ` jason at zx2c4 dot com
2022-08-08 12:42 ` adhemerval.zanella at linaro dot org [this message]
2022-08-08 12:43 ` fweimer at redhat dot com
2022-08-08 12:44 ` fweimer at redhat dot com
2022-08-08 12:45 ` jason at zx2c4 dot com
2022-08-08 12:51 ` adhemerval.zanella at linaro dot org
2022-08-08 12:56 ` jason at zx2c4 dot com
2023-01-09 11:44 ` yann at droneaud dot fr

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=bug-29437-131-cSi3Mqo5hL@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@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).