aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/random
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2020-01-01 00:35:02 +0000
committerConrad Meyer <cem@FreeBSD.org>2020-01-01 00:35:02 +0000
commit767991d2bed376736535f8f788007a9c3766fcaf (patch)
treef5ed8acdd81f0afdf2fb26b865003e898d5adbef /sys/dev/random
parent80a1b8c5e3be1c1fa1a7485a3f9e9d97f0826d24 (diff)
Notes
Diffstat (limited to 'sys/dev/random')
-rw-r--r--sys/dev/random/fortuna.c7
-rw-r--r--sys/dev/random/random_harvestq.c1
2 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/random/fortuna.c b/sys/dev/random/fortuna.c
index aa9e2fded5cb4..4b04a563b4263 100644
--- a/sys/dev/random/fortuna.c
+++ b/sys/dev/random/fortuna.c
@@ -359,6 +359,13 @@ random_fortuna_process_event(struct harvest_event *event)
*/
pl = event->he_destination % RANDOM_FORTUNA_NPOOLS;
/*
+ * If a VM generation ID changes (clone and play or VM rewind), we want
+ * to incorporate that as soon as possible. Override destingation pool
+ * for immediate next use.
+ */
+ if (event->he_source == RANDOM_PURE_VMGENID)
+ pl = 0;
+ /*
* We ignore low entropy static/counter fields towards the end of the
* he_event structure in order to increase measurable entropy when
* conducting SP800-90B entropy analysis measurements of seed material
diff --git a/sys/dev/random/random_harvestq.c b/sys/dev/random/random_harvestq.c
index 0e965a78b0c57..4cf628bde5e00 100644
--- a/sys/dev/random/random_harvestq.c
+++ b/sys/dev/random/random_harvestq.c
@@ -354,6 +354,7 @@ static const char *random_source_descr[ENTROPYSOURCE] = {
[RANDOM_PURE_CCP] = "PURE_CCP",
[RANDOM_PURE_DARN] = "PURE_DARN",
[RANDOM_PURE_TPM] = "PURE_TPM",
+ [RANDOM_PURE_VMGENID] = "VMGENID",
/* "ENTROPYSOURCE" */
};