Bug 15360 - Add a boot-time random number generation (entropy pool) test
Summary: Add a boot-time random number generation (entropy pool) test
Status: NEW
Alias: None
Product: System Startup
Classification: Runtime
Component: system-startup (show other bugs)
Version: 5.0
Hardware: x86 Multiple
: Medium+ enhancement
Target Milestone: 5.99
Assignee: Unassigned
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2024-01-18 17:41 UTC by Randy MacLeod
Modified: 2025-01-30 16:08 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Randy MacLeod 2024-01-18 17:41:38 UTC
When trying to clean up by moving rng-tools from oe-core to meta-oe, it
became clear that we don't have a way to confirm that the entropy pool
has sufficient sources of randomness to avoid having getrandom() block for "too long". This can be a problem, especially at boot time.

rng-tools was brought back into oe-core with the following log:

> Revert this commit since:
>
>  - some systems using oe-core master may still be using kernels from
>    before 5.6 pulled in the rng-tools algorithm, and
>
>  - some hardware platforms may not have a hardware random number generator
>    and could therefore need to run rngd to avoid long boot-time initialization
>    due to a depleted entropy pool.


and this comment from me:

   The additional context that doesn't belong in the commit log
   is that we talked about this change in the YP bug review meeting
   and decided that we would keep rng-tools in oe-core for 5.0-M2
   for the two reasons given above. If we end up adding a test, as described below,
   we may never move the recipe to meta-oe.


   It seems to me that we need a test that checks if the entropy pool size
   ever falls below a critical threshold for "too long" in the first N seconds of boot time.

   Getting that test written so that: 
    - qemu VMs and
    - real HW with and without /dev/hwrng 

   all pass without the test being too permissive may take some time.


Related email threads:
https://lists.openembedded.org/g/openembedded-core/message/193798
https://lists.openembedded.org/g/openembedded-core/message/193994


Also should we document the test or how we recommend that people test their hardware?
Comment 1 Randy MacLeod 2024-01-25 15:33:48 UTC
Scott, will you be able to own this bug and add the test.
Comment 2 Randy MacLeod 2025-01-30 16:06:39 UTC
Bulk move to 5.2-M3.