Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177578938
D20239.1794790846.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D20239.1794790846.diff
View Options
Index: sys/dev/random/fortuna.c
===================================================================
--- sys/dev/random/fortuna.c
+++ sys/dev/random/fortuna.c
@@ -377,8 +377,12 @@
if (fortuna_state.fs_pool[0].fsp_length < fortuna_state.fs_minpoolsize
#ifdef _KERNEL
- /* FS&K - Use 'getsbinuptime()' to prevent reseed-spamming. */
- || (now - fortuna_state.fs_lasttime <= SBT_1S/10)
+ /*
+ * FS&K - Use 'getsbinuptime()' to prevent reseed-spamming, but do
+ * not block initial seeding (fs_lasttime == 0).
+ */
+ || (__predict_true(fortuna_state.fs_lasttime != 0) &&
+ now - fortuna_state.fs_lasttime <= SBT_1S/10)
#endif
) {
RANDOM_RESEED_UNLOCK();
@@ -469,5 +473,14 @@
return (false);
#endif
+ if (__predict_true(!uint128_is_zero(fortuna_state.fs_counter)))
+ return (true);
+
+ /*
+ * Maybe we have enough entropy in the zeroth pool but just haven't
+ * kicked the initial seed step. Do so now.
+ */
+ random_fortuna_pre_read();
+
return (!uint128_is_zero(fortuna_state.fs_counter));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 16, 1:00 AM (19 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41753136
Default Alt Text
D20239.1794790846.diff (1 KB)
Attached To
Mode
D20239: Fortuna: Fix false negatives in is_random_seeded()
Attached
Detach File
Event Timeline