3 @@ -424,6 +424,7 @@ struct task_struct *find_task_by_vpid(pi
5 return find_task_by_pid_ns(vnr, current->nsproxy->pid_ns);
7 +EXPORT_SYMBOL(find_task_by_vpid);
9 struct pid *get_task_pid(struct task_struct *task, enum pid_type type)
11 --- a/drivers/char/random.c
12 +++ b/drivers/char/random.c
14 * unsigned int value);
15 * void add_interrupt_randomness(int irq);
17 + * void random_input_words(__u32 *buf, size_t wordcount, int ent_count)
18 + * int random_input_wait(void);
20 * add_input_randomness() uses the input layer interrupt timing, as well as
21 * the event type information from the hardware.
24 * a better measure, since the timing of the disk interrupts are more
27 + * random_input_words() just provides a raw block of entropy to the input
28 + * pool, such as from a hardware entropy generator.
30 + * random_input_wait() suspends the caller until such time as the
31 + * entropy pool falls below the write threshold, and returns a count of how
32 + * much entropy (in bits) is needed to sustain the pool.
34 * All of these routines try to estimate how many bits of randomness a
35 * particular randomness source. They do this by keeping track of the
36 * first and second order deltas of the event timings.
37 @@ -715,6 +725,63 @@ void add_disk_randomness(struct gendisk
42 + * random_input_words - add bulk entropy to pool
44 + * @buf: buffer to add
45 + * @wordcount: number of __u32 words to add
46 + * @ent_count: total amount of entropy (in bits) to credit
48 + * this provides bulk input of entropy to the input pool
51 +void random_input_words(__u32 *buf, size_t wordcount, int ent_count)
53 + mix_pool_bytes(&input_pool, buf, wordcount*4);
55 + credit_entropy_bits(&input_pool, ent_count);
57 + DEBUG_ENT("crediting %d bits => %d\n",
58 + ent_count, input_pool.entropy_count);
60 + * Wake up waiting processes if we have enough
63 + if (input_pool.entropy_count >= random_read_wakeup_thresh)
64 + wake_up_interruptible(&random_read_wait);
66 +EXPORT_SYMBOL(random_input_words);
69 + * random_input_wait - wait until random needs entropy
71 + * this function sleeps until the /dev/random subsystem actually
72 + * needs more entropy, and then return the amount of entropy
73 + * that it would be nice to have added to the system.
75 +int random_input_wait(void)
79 + wait_event_interruptible(random_write_wait,
80 + input_pool.entropy_count < random_write_wakeup_thresh);
82 + count = random_write_wakeup_thresh - input_pool.entropy_count;
84 + /* likely we got woken up due to a signal */
85 + if (count <= 0) count = random_read_wakeup_thresh;
87 + DEBUG_ENT("requesting %d bits from input_wait()er %d<%d\n",
89 + input_pool.entropy_count, random_write_wakeup_thresh);
93 +EXPORT_SYMBOL(random_input_wait);
96 +#define EXTRACT_SIZE 10
98 /*********************************************************************
100 * Entropy extraction routines
103 @@ -142,6 +142,7 @@ SYSCALL_DEFINE1(dup, unsigned int, filde
107 +EXPORT_SYMBOL(sys_dup);
109 #define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | O_DIRECT | O_NOATIME)
111 --- a/include/linux/miscdevice.h
112 +++ b/include/linux/miscdevice.h
114 #define APOLLO_MOUSE_MINOR 7
115 #define PC110PAD_MINOR 9
116 /*#define ADB_MOUSE_MINOR 10 FIXME OBSOLETE */
117 +#define CRYPTODEV_MINOR 70 /* /dev/crypto */
118 #define WATCHDOG_MINOR 130 /* Watchdog timer */
119 #define TEMP_MINOR 131 /* Temperature Sensor */
120 #define RTC_MINOR 135
121 --- a/include/linux/random.h
122 +++ b/include/linux/random.h
123 @@ -54,6 +54,10 @@ extern void add_input_randomness(unsigne
125 extern void add_interrupt_randomness(int irq);
127 +extern void random_input_words(__u32 *buf, size_t wordcount, int ent_count);
128 +extern int random_input_wait(void);
129 +#define HAS_RANDOM_INPUT_WAIT 1
131 extern void get_random_bytes(void *buf, int nbytes);
132 void generate_random_uuid(unsigned char uuid_out[16]);