Skip to content

hw_random: introduce rng_quality sysfs attribute

Dominik Brodowski linux-crypto lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4hw_random: do not bother to order list of devices by qualitydrivers/char/hw_random/core.c+16 -200 replies
2/4hw_random: start and stop in-kernel rngd in separate functiondrivers/char/hw_random/core.c+14 -100 replies
3/4hw_random: use per-rng quality value instead of global settingdrivers/char/hw_random/core.c+20 -130 replies
4/4hw_random: introduce rng_quality sysfs attributedrivers/char/hw_random/core.c+63 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] hw_random: introduce rng_quality sysfs attribute

Currently, the hw_random core exposes a module parameter "current_quality". However, that is fundamentally broken: If it is set at boot time, it is overwritten once the first hw rng device is loaded. If it is set at runtime, it is without effect if the hw rng device had its quality value set to 0 (and no default_quality was set). If a new rng is selected, it gets overwritten.

Therefore, let's mark it as obsolete, and replace it with a new sysfs attribute named "rng_quality". This sets the quality setting of the hw rng device currently loaded and active, and starts/stops the hwrng kernel thread as required.

Dominik Brodowski (4):
hw_random: do not bother to order list of devices by quality
hw_random: start and stop in-kernel rngd in separate function
hw_random: use per-rng quality value instead of global setting
hw_random: introduce rng_quality sysfs attribute

 drivers/char/hw_random/core.c | 145 +++++++++++++++++++++++++---------
 1 file changed, 107 insertions(+), 38 deletions(-)

---
If preferred, the "current_quality" module parameter can be removed altogether.

Signature · 1 line
2.35.1