FreeBSD Bugzilla – Attachment 196446 Details for
Bug 230808
rand_harvestq high CPU utilization
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to limit fast entropy
random_harvestq.c.patch (text/plain), 884 bytes, created by
rwmaillists
on 2018-08-22 19:38:32 UTC
(
hide
)
Description:
Patch to limit fast entropy
Filename:
MIME Type:
Creator:
rwmaillists
Created:
2018-08-22 19:38:32 UTC
Size:
884 bytes
patch
obsolete
>--- random_harvestq.c.orig 2018-08-22 02:14:41.673532000 +0100 >+++ random_harvestq.c 2018-08-22 19:58:41.329400000 +0100 >@@ -55,6 +55,10 @@ > #include <machine/atomic.h> > #include <machine/cpu.h> > >+#include <crypto/rijndael/rijndael-api-fst.h> >+#include <crypto/sha2/sha256.h> >+ >+#include <dev/random/hash.h> > #include <dev/random/randomdev.h> > #include <dev/random/random_harvestq.h> > >@@ -209,6 +213,9 @@ > /* It's an indenting error. Yeah, Yeah. */ > #endif > local_read_rate = atomic_readandclear_32(&read_rate); >+ /* Don't waste CPU cycles hashing more than the generator can use */ >+ if (local_read_rate > RANDOM_KEYSIZE_WORDS - 1) >+ local_read_rate = RANDOM_KEYSIZE_WORDS - 1; > LIST_FOREACH(rrs, &source_list, rrs_entries) { > for (i = 0; i < p_random_alg_context->ra_poolcount*(local_read_rate + 1); i++) { > n = rrs->rrs_source->rs_read(entropy, sizeof(entropy));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 230808
: 196446