diff options
-rw-r--r-- | drivers/char/random.c | 3 | ||||
-rw-r--r-- | include/linux/random.h | 1 | ||||
-rw-r--r-- | init/main.c | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c index 0d91fe52f3f5..92e6c67e1ae6 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
@@ -1462,12 +1462,11 @@ struct ctl_table random_table[] = { | |||
1462 | 1462 | ||
1463 | static u32 random_int_secret[MD5_MESSAGE_BYTES / 4] ____cacheline_aligned; | 1463 | static u32 random_int_secret[MD5_MESSAGE_BYTES / 4] ____cacheline_aligned; |
1464 | 1464 | ||
1465 | static int __init random_int_secret_init(void) | 1465 | int random_int_secret_init(void) |
1466 | { | 1466 | { |
1467 | get_random_bytes(random_int_secret, sizeof(random_int_secret)); | 1467 | get_random_bytes(random_int_secret, sizeof(random_int_secret)); |
1468 | return 0; | 1468 | return 0; |
1469 | } | 1469 | } |
1470 | late_initcall(random_int_secret_init); | ||
1471 | 1470 | ||
1472 | /* | 1471 | /* |
1473 | * Get a random word for internal kernel use only. Similar to urandom but | 1472 | * Get a random word for internal kernel use only. Similar to urandom but |
diff --git a/include/linux/random.h b/include/linux/random.h index 3b9377d6b7a5..6312dd9ba449 100644 --- a/include/linux/random.h +++ b/include/linux/random.h | |||
@@ -17,6 +17,7 @@ extern void add_interrupt_randomness(int irq, int irq_flags); | |||
17 | extern void get_random_bytes(void *buf, int nbytes); | 17 | extern void get_random_bytes(void *buf, int nbytes); |
18 | extern void get_random_bytes_arch(void *buf, int nbytes); | 18 | extern void get_random_bytes_arch(void *buf, int nbytes); |
19 | void generate_random_uuid(unsigned char uuid_out[16]); | 19 | void generate_random_uuid(unsigned char uuid_out[16]); |
20 | extern int random_int_secret_init(void); | ||
20 | 21 | ||
21 | #ifndef MODULE | 22 | #ifndef MODULE |
22 | extern const struct file_operations random_fops, urandom_fops; | 23 | extern const struct file_operations random_fops, urandom_fops; |
diff --git a/init/main.c b/init/main.c index d03d2ec2eacf..586cd3359c02 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -75,6 +75,7 @@ | |||
75 | #include <linux/blkdev.h> | 75 | #include <linux/blkdev.h> |
76 | #include <linux/elevator.h> | 76 | #include <linux/elevator.h> |
77 | #include <linux/sched_clock.h> | 77 | #include <linux/sched_clock.h> |
78 | #include <linux/random.h> | ||
78 | 79 | ||
79 | #include <asm/io.h> | 80 | #include <asm/io.h> |
80 | #include <asm/bugs.h> | 81 | #include <asm/bugs.h> |
@@ -778,6 +779,7 @@ static void __init do_basic_setup(void) | |||
778 | do_ctors(); | 779 | do_ctors(); |
779 | usermodehelper_enable(); | 780 | usermodehelper_enable(); |
780 | do_initcalls(); | 781 | do_initcalls(); |
782 | random_int_secret_init(); | ||
781 | } | 783 | } |
782 | 784 | ||
783 | static void __init do_pre_smp_initcalls(void) | 785 | static void __init do_pre_smp_initcalls(void) |