diff options
author | Miloslav Trmač <mitr@redhat.com> | 2010-07-21 16:15:52 +0200 |
---|---|---|
committer | Miloslav Trmač <mitr@redhat.com> | 2010-07-21 16:15:52 +0200 |
commit | 9caead04e2ddf52a6f18539c339cd270d5a94ff4 (patch) | |
tree | 8d14234ff1842a874f38bdf5fa1cb415615342b5 | |
parent | 9666790d5518a80bc9e2a7e21fcb6bf836c1548d (diff) | |
download | kernel-crypto-9caead04e2ddf52a6f18539c339cd270d5a94ff4.tar.gz kernel-crypto-9caead04e2ddf52a6f18539c339cd270d5a94ff4.tar.xz kernel-crypto-9caead04e2ddf52a6f18539c339cd270d5a94ff4.zip |
Panic if FIPS rng test can't be set upncr-rhel5-patches
If in FIPS mode, failure to allocate a buffer for the continuous test
would silently disable the test. Panic instead.
This is originally a hunk from
From: Neil Horman <nhorman@redhat.com>
Date: Sat, 13 Jun 2009 14:19:10 -0400
Subject: [crypto] add continuous test to hw rng in FIPS mode
Message-id: 20090613181910.GB24861@localhost.localdomain
-rw-r--r-- | drivers/char/random.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c index 2849713d223..d702a6ab083 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -952,8 +952,11 @@ static void init_std_data(struct entropy_store *r) mix_pool_bytes(r, &now, sizeof(now)); mix_pool_bytes(r, utsname(), sizeof(*(utsname()))); /* Enable continuous test in fips mode */ - if (fips_enabled) + if (fips_enabled) { r->last_data = kmalloc(EXTRACT_SIZE, GFP_KERNEL); + if (!r->last_data) + panic("RNG self test failed to init!\n"); + } } static int rand_initialize(void) |