From: "Guozihua (Scott)" <guozihua@huawei.com>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>,
Eric Biggers <ebiggers@kernel.org>
Cc: <linux-crypto@vger.kernel.org>, <luto@kernel.org>, <tytso@mit.edu>
Subject: Re: Inquiry about the removal of flag O_NONBLOCK on /dev/random
Date: Thu, 21 Jul 2022 19:30:09 +0800 [thread overview]
Message-ID: <cb2da51e-8935-2787-28de-caba41d6ec14@huawei.com> (raw)
In-Reply-To: <YtksefZvcFiugeC1@zx2c4.com>
On 2022/7/21 18:37, Jason A. Donenfeld wrote:
> Hi Guozihua,
>
> On Wed, Jul 20, 2022 at 11:50:46PM -0700, Eric Biggers wrote:
>> On Thu, Jul 21, 2022 at 02:44:54PM +0800, Guozihua (Scott) wrote:
>>
>> That doesn't make any sense; you should just use /dev/urandom unconditionally.
>
> What Eric said: this flow doesn't really make sense. Why not use
> /dev/urandom unconditionally or getrandom(GRND_INSECURE)?
>
> But also I have to wonder: you wrote '-EAGAIN' but usually userspace
> checks errno==EAGAIN, a positive value. That makes me wonder whether you
> wrote your email with your code is open. So I just wanted to triple
> check that what you've described is actually what the code is doing,
> just in case there's some ambiguity.
>
> I'm just trying to find out what this code is and where it is to assess
> whether we change the userspace behavior again, given that this has been
> sitting for several years now.
>
> Jason
> .
Hi Jason and Eric.
To clarify, the code in question is not written by me and I did not see
the code myself, the code is from another team. We discovered this
change during the test when we try to run our userspace program on a
newer version kernel, and it blocks for a long time during the boot
process. It seems that the author use the -EAGAIN error code as an
indication that /dev/random is not ready and they implemented a "best
effort" mechanism in terms of getting random data.
Honestly speaking I don't know what they are using those random data
for, and I am trying to get some background knowledge for this flag and
the change, maybe figure out whether that team is using the flag as
intended, and bring this up with them.
--
Best
GUO Zihua
next prev parent reply other threads:[~2022-07-21 11:30 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-14 7:33 Inquiry about the removal of flag O_NONBLOCK on /dev/random Guozihua (Scott)
2022-07-18 8:52 ` Guozihua (Scott)
2022-07-19 3:47 ` Eric Biggers
2022-07-19 8:06 ` Guozihua (Scott)
2022-07-19 11:01 ` Jason A. Donenfeld
2022-07-21 3:50 ` Guozihua (Scott)
2022-07-21 4:07 ` Eric Biggers
2022-07-21 6:44 ` Guozihua (Scott)
2022-07-21 6:50 ` Eric Biggers
2022-07-21 10:37 ` Jason A. Donenfeld
2022-07-21 11:30 ` Guozihua (Scott) [this message]
2022-07-26 7:43 ` Guozihua (Scott)
2022-07-26 11:08 ` Jason A. Donenfeld
2022-07-26 11:33 ` Guozihua (Scott)
2022-07-28 8:24 ` Guozihua (Scott)
2022-09-06 7:14 ` Guozihua (Scott)
2022-09-06 10:16 ` Jason A. Donenfeld
2022-09-07 13:03 ` Jason A. Donenfeld
2022-09-08 3:31 ` Guozihua (Scott)
2022-09-08 9:51 ` Jason A. Donenfeld
2022-09-08 10:40 ` Jason A. Donenfeld
2022-09-08 14:26 ` [PATCH] random: restore O_NONBLOCK support Jason A. Donenfeld
2022-09-19 10:27 ` Inquiry about the removal of flag O_NONBLOCK on /dev/random Guozihua (Scott)
2022-09-19 10:40 ` Jason A. Donenfeld
2022-09-19 10:45 ` Guozihua (Scott)
2022-07-21 11:09 ` Theodore Ts'o
2022-07-21 11:30 ` Guozihua (Scott)
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=cb2da51e-8935-2787-28de-caba41d6ec14@huawei.com \
--to=guozihua@huawei.com \
--cc=Jason@zx2c4.com \
--cc=ebiggers@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=luto@kernel.org \
--cc=tytso@mit.edu \
/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