linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Xu (Hello71)" <alex_y_xu@yahoo.ca>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Jann Horn <jannh@google.com>,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	Guenter Roeck <linux@roeck-us.net>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Theodore Ts'o <tytso@mit.edu>
Subject: Re: [PATCH] random: allow writes to /dev/urandom to influence fast init
Date: Wed, 23 Mar 2022 00:30:14 -0400	[thread overview]
Message-ID: <1648009787.fah6dos6ya.none@localhost> (raw)
In-Reply-To: <20220322191436.110963-1-Jason@zx2c4.com>

I searched for users of RNDADDTOENTCNT using 
(?s:ioctl.{1,500}RNDADDTOENTCNT) on Debian Code Search and 
"/(?s)ioctl.{1,40},\s*RNDADDTOENTCNT/ -path:incfs_test.c" on GitHub Code 
Search (beta).

Several programs use it for testing purposes, without writing any 
entropy to /dev/random or /dev/urandom, including rauc, wireguard, and 
openSUSE kdump. Several programs use it as intended, after writing 
entropy to /dev/random or /dev/urandom. Of the latter group,

- kata-containers is a lightweight VM implementation. Its guest-side 
  agent offers a gRPC endpoint which will write the provided data to 
  /dev/random, then call RNDADDTOENTCNT with the length of the data, 
  then call RNDRESEEDRNG. As far as I can tell, this endpoint is 
  made available to users on the host, but is not used by 
  kata-containers itself.

- aws-nitro-enclaves-sdk-c is an SDK for building lightweight VMs to be 
  used with AWS Nitro Enclaves. kmstool-enclave is a sample application 
  provided, which writes "up to 256 bytes" (from where?) to /dev/random, 
  then calls RNDADDTOENTCNT, then repeats the process until it reaches 
  1024 bytes.

- sandy-harris/maxwell is a "jitter entropy" daemon, similar to haveged. 
  It writes 4 bytes of "generated entropy" to /dev/random, then calls 
  RNDADDTOENTCNT, then repeats.

- guix is, among other things, a "GNU/"Linux distribution. The provided 
  base services write the seed file to /dev/urandom, then call 
  RNDADDTOENTCNT, then write 512 bytes from /dev/hwrng to /dev/urandom, 
  then call RNDADDTOENTCNT, then "immediately" read 512 bytes from 
  /dev/urandom and write it to the seed file. On shutdown, 512 bytes are 
  read from /dev/urandom and written to the seed file.

I was unable to locate any other public non-archived usages of 
RNDADDTOENTCNT on Debian or GitHub Code Search.

I don't have any particular expertise with the random subsystem or 
conclusions to make from this data, but I hope this helps inform the 
discussion.

Cheers,
Alex.

  parent reply	other threads:[~2022-03-23  4:30 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-22 19:14 [PATCH] random: allow writes to /dev/urandom to influence fast init Jason A. Donenfeld
2022-03-22 20:42 ` Linus Torvalds
2022-03-22 23:54   ` Jason A. Donenfeld
2022-03-23  2:15 ` David Laight
2022-03-23  2:50   ` Jason A. Donenfeld
2022-03-23  8:43     ` Rasmus Villemoes
2022-03-24 14:12       ` Jason A. Donenfeld
2022-03-23 11:45     ` David Laight
2022-03-23  3:35 ` Theodore Ts'o
2022-03-23  4:00   ` Jason A. Donenfeld
2022-03-23 12:31     ` Theodore Ts'o
2022-05-23 17:59     ` Pavel Machek
2022-03-23  4:30 ` Alex Xu (Hello71) [this message]
2022-03-23  4:47   ` Jason A. Donenfeld
2022-03-23 14:01     ` David Laight
2022-03-23 19:53       ` Jason A. Donenfeld
2022-03-24 18:01         ` Eric Biggers
2022-03-24  3:18     ` Jason A. Donenfeld
2022-03-24 16:28       ` Alex Xu (Hello71)
2022-03-24 17:20         ` Jason A. Donenfeld
2022-03-24 19:03           ` Alex Xu (Hello71)
2022-03-24 18:26       ` Eric Biggers
2022-03-24 18:31         ` Jason A. Donenfeld
2022-06-19 16:44       ` Pavel Machek
2022-03-24 19:53 ` Eric Biggers
2022-03-24 20:25   ` Jason A. Donenfeld
2022-06-19 16:56     ` Pavel Machek

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=1648009787.fah6dos6ya.none@localhost \
    --to=alex_y_xu@yahoo.ca \
    --cc=Jason@zx2c4.com \
    --cc=jannh@google.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=linux@roeck-us.net \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).