1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:58:11 +00:00

Kernel: Allow process creation during low-entropy condition

Fixes #2871.

Ignoring the 'securely generated bytes' constraint seems to
be fine for Linux, so it's probably fine for Serenity.

Note that there *might* be more bottlenecks down the road
if Serenity is started in a non-GUI way. Currently though,
loading the GUI seems to generate enough interrupts to
seed the entropy pool, even on my non-RDRAND setup. Yay! :^)
This commit is contained in:
Ben Wiederhake 2020-07-25 06:05:14 +02:00 committed by Andreas Kling
parent 8c14219fb1
commit b3472cb4a7

View file

@ -1118,7 +1118,7 @@ Vector<AuxiliaryValue> Process::generate_auxiliary_vector() const
auxv.append({ AuxiliaryValue::Secure, ((m_uid != m_euid) || (m_gid != m_egid)) ? 1 : 0 });
char random_bytes[16] {};
get_good_random_bytes((u8*)random_bytes, sizeof(random_bytes));
get_fast_random_bytes((u8*)random_bytes, sizeof(random_bytes));
auxv.append({ AuxiliaryValue::Random, String(random_bytes, sizeof(random_bytes)) });