Bug in jitterentropy handling
Eric Berry
eric.berry at canonical.com
Wed Oct 15 23:54:06 CEST 2025
Please see the attached patch.
The flag jent_rng_is_initialized is not being handled correctly.
- It is set to true before the corresponding jent_rng_collector structure
is fully initialized.
- It is not cleared when the jent_rng_collector is freed.
Subsequently, when trying to generate entropy in the function
_gcry_rndjent_poll after the jent_rng_collector has been freed,
jent_rng_is_initialized is true so jent_rng_collector is not
re-initialized, but then when trying to generate entropy jent_rng_collector
is null so entropy generation is skipped.
In Ubuntu, we want to create a userspace FIPS mode that generates entropy
solely through the jitter entropy library. Because of this bug, the
modifications we made to rndgetentropy.c to get all of the entropy from
_gcry_rndjent_poll goes into an infinite loop because _gcry_rndjent_poll
generates 0 random entropy. Consequently I think the existing code that
tries to generate 50% of the bytes from jitterentropy is actually getting
none.
This patch was generated against the master branch.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gcrypt-devel/attachments/20251015/356a2c37/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rndjent.fix.patch
Type: application/octet-stream
Size: 1102 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gcrypt-devel/attachments/20251015/356a2c37/attachment.obj>
More information about the Gcrypt-devel
mailing list