Go to file
Jason A. Donenfeld f0986de551 package/urandom-scripts: hash old seed with new seed when saving
Writing into /dev/urandom doesn't actually credit any entropy bits. And
while it adds that data to the entropy pool, it won't actually be
immediately used when reading from /dev/urandom subsequently. This is
how the kernel's /dev/urandom has always worked, unfortunately.

As a result of this behavior, which may be understandably surprising,
writing a good seed file into /dev/urandom and then saving a new seed
file immediately after is dangerous, because the new seed file may wind
up being entirely deterministic, even if the old seed file was quite
good.

This has been fixed in systemd with
<da2862ef06>,
and fortunately it's possible to do the same thing in shell script here.
Specifically, instead of just saving new /dev/urandom output straight
up, we hash the new /dev/urandom together with the old seed, in order to
produce the new seed. This way the amount of entropy in the new seed
will stay the same or get better, but not appreciably regress.

At the same time, the pool size check in this script is useless. Writing
to /dev/urandom never credits bits anyway, so no matter what, writing
into /dev/urandom is useful and not harmful. There's also not much of a
point in seeding with more than 256 bits, which is what the hashing
operation above produces. So this commit removes the file size check.

As a final note, while this commit improves upon the status quo by
removing a vulnerability, this shell script still does not actually
initialize the RNG like it says it does. For initialization via a seed
file, the RNDADDENTROPY ioctl must be used but there's currently no way
to do that from a shell script for now.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2022-03-24 09:22:47 +01:00
arch core: introduce NORMALIZED_ARCH as non-kernel replacement for KERNEL_ARCH 2022-02-08 21:20:23 +01:00
board configs/octavo_osd32mp1_red: new defconfig 2022-03-20 18:08:55 +01:00
boot boot/optee-os: bump to version 3.16.0 2022-03-18 23:39:45 +01:00
configs configs/octavo_osd32mp1_red: new defconfig 2022-03-20 18:08:55 +01:00
docs docs/manual: Remove link to emdebian and replace with debian port page 2022-03-15 22:28:01 +01:00
fs fs/common.mk: use find instead of shell glob patterns 2022-03-12 17:45:21 +01:00
linux linux: bump CIP-RT kernel to version 5.10.104-cip3-rt3 2022-03-22 08:56:04 +01:00
package package/urandom-scripts: hash old seed with new seed when saving 2022-03-24 09:22:47 +01:00
support support/dependencies: requires cmake >= 3.18 2022-03-21 22:04:16 +01:00
system system/skeleton: provide run/lock directory 2022-01-12 20:38:09 +01:00
toolchain toolchain/toolchain-external/toolchain-external-bootlin: update with new s390x toolchain 2022-03-10 22:09:26 +01:00
utils utils/scanpypi: support alternative Homepage format 2022-03-13 19:24:23 +01:00
.clang-format
.defconfig
.flake8
.gitignore
.gitlab-ci.yml utils/checkpackagelib/lib_sysv: run shellcheck 2022-02-06 18:27:03 +01:00
CHANGES Update for 2022.02 2022-03-08 23:08:11 +01:00
Config.in support/download: Add SFTP support 2022-01-06 09:34:05 +01:00
Config.in.legacy package/libcurl: bump version to 7.82.0 2022-03-23 21:44:00 +01:00
COPYING
DEVELOPERS DEVELOPERS: update email address 2022-03-23 18:01:29 +01:00
Makefile support/scripts/graph-build-time: add support for timeline graphing 2022-03-20 23:52:24 +01:00
Makefile.legacy
README

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: buildroot@buildroot.org
You can also find us on #buildroot on OFTC IRC.

If you would like to contribute patches, please read
https://buildroot.org/manual.html#submitting-patches