Consider crediting some of the entropy we add from an unused sector
Discussion on this started on #11897 and there we agreed it was not a blocker for the initial iteration.
Crediting the entropy would cause the entropy pool to be marked as initialized, thereby:
- Preventing warnings being printed during boot, like
random: sgdisk: uninitialized urandom read (16 bytes read)
random: get\_random\_bytes called from start\_kernel+0x94/0x52e with crng\_init=0
- Allowing programs which block until the entropy pool is initialized to run earlier (relevant for #16891)
- Allowing us to check whether the entropy was actually added, by comparing /proc/sys/kernel/random/entropy_avail before and after adding the entropy
segfault’s proposal is to credit up to the amount of entropy available when the seed was updated, i.e. the content of /proc/sys/kernel/random/entropy_avail.