One should never allocate 4-kilobyte structs and such on the interrupt
stack. It's bad for your machine's health. Make the two huge structs in reseed() static to prevent crashes. This is the bug that people have been running into and panic()ing on for the past few days. Reviewed by: phk
This commit is contained in:
parent
4f81558e41
commit
27c5032b29
@ -101,9 +101,13 @@ random_deinit(void)
|
||||
static void
|
||||
reseed(int fastslow)
|
||||
{
|
||||
unsigned char v[TIMEBIN][KEYSIZE]; /* v[i] */
|
||||
/*
|
||||
* Allocate the huge variables statically. They _will_ run you
|
||||
* out of interrupt-context stack otherwise!
|
||||
*/
|
||||
static BF_KEY hashkey;
|
||||
static unsigned char v[TIMEBIN][KEYSIZE]; /* v[i] */
|
||||
unsigned char hash[KEYSIZE]; /* h' */
|
||||
BF_KEY hashkey;
|
||||
unsigned char ivec[8];
|
||||
unsigned char temp[KEYSIZE];
|
||||
struct entropy *bucket;
|
||||
|
@ -101,9 +101,13 @@ random_deinit(void)
|
||||
static void
|
||||
reseed(int fastslow)
|
||||
{
|
||||
unsigned char v[TIMEBIN][KEYSIZE]; /* v[i] */
|
||||
/*
|
||||
* Allocate the huge variables statically. They _will_ run you
|
||||
* out of interrupt-context stack otherwise!
|
||||
*/
|
||||
static BF_KEY hashkey;
|
||||
static unsigned char v[TIMEBIN][KEYSIZE]; /* v[i] */
|
||||
unsigned char hash[KEYSIZE]; /* h' */
|
||||
BF_KEY hashkey;
|
||||
unsigned char ivec[8];
|
||||
unsigned char temp[KEYSIZE];
|
||||
struct entropy *bucket;
|
||||
|
Loading…
Reference in New Issue
Block a user