diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2022-09-26 18:32:25 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2022-09-29 21:37:27 +0200 |
commit | 08475dab7cf5b610ea2420828e97c54f5f370d7d (patch) | |
tree | c93d3225e580cefccf5609cd9f4fea2e306cefe1 /mm/kfence | |
parent | f62384995e4cb7703e5295779c44135c5311770d (diff) | |
download | lwn-08475dab7cf5b610ea2420828e97c54f5f370d7d.tar.gz lwn-08475dab7cf5b610ea2420828e97c54f5f370d7d.zip |
kfence: use better stack hash seed
As of the prior commit, the RNG will have incorporated both a cycle
counter value and RDRAND, in addition to various other environmental
noise. Therefore, using get_random_u32() will supply a stronger seed
than simply using random_get_entropy(). N.B.: random_get_entropy()
should be considered an internal API of random.c and not generally
consumed.
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Marco Elver <elver@google.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'mm/kfence')
-rw-r--r-- | mm/kfence/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/kfence/core.c b/mm/kfence/core.c index c252081b11df..239b1b4b094f 100644 --- a/mm/kfence/core.c +++ b/mm/kfence/core.c @@ -864,7 +864,7 @@ static void kfence_init_enable(void) void __init kfence_init(void) { - stack_hash_seed = (u32)random_get_entropy(); + stack_hash_seed = get_random_u32(); /* Setting kfence_sample_interval to 0 on boot disables KFENCE. */ if (!kfence_sample_interval) |