Commit 52782b74 authored by Stephan Müller's avatar Stephan Müller Committed by Treehugger Robot
Browse files

UPSTREAM: crypto: jitter - Allow configuration of memory size



The memory size consumed by the Jitter RNG is one contributing factor in
the amount of entropy that is gathered. As the amount of entropy
directly correlates with the distance of the memory from the CPU, the
caches that are possibly present on a given system have an impact on the
collected entropy.

Thus, the kernel compile time should offer a means to configure the
amount of memory used by the Jitter RNG. Although this option could be
turned into a runtime option (e.g. a kernel command line option), it
should remain a compile time option as otherwise adminsitrators who may
not have performed an entropy assessment may select a value that is
inappropriate.

The default value selected by the configuration is identical to the
current Jitter RNG value. Thus, the patch should not lead to any change
in the Jitter RNG behavior.

To accommodate larger memory buffers, kvzalloc / kvfree is used.

Signed-off-by: default avatarStephan Mueller <smueller@chronox.de>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>

(cherry picked from commit 59bcfd78)
Bug: 452983319
Bug: 425813935
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Cherrypick-From: https://android-review.googlesource.com/q/commit:d250e78cef7eb1d577ed8a838fcd5904fd825f2c


Merged-In: If6bba578fbff7623d36db455c6d0d720db3da1a9
Change-Id: If6bba578fbff7623d36db455c6d0d720db3da1a9
Signed-off-by: default avatarGina Ko <yichunko@google.com>
parent 774a09e1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment