Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153717656
D20239.id57318.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D20239.id57318.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
Fri, Apr 24, 4:34 AM (12 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32060274
Default Alt Text
D20239.id57318.diff (1 KB)
Attached To
Mode
D20239: Fortuna: Fix false negatives in is_random_seeded()
Attached
Detach File
Event Timeline
Log In to Comment