search for: add_early_random

Displaying 20 results from an estimated 61 matches for "add_early_random".

2014 Jul 14
2
[RFC PATCH 1/3] hw_random: allow RNG devices to give early randomness after a delay
...rivers/char/hw_random/core.c > index c4419ea..2a765fd 100644 > --- a/drivers/char/hw_random/core.c > +++ b/drivers/char/hw_random/core.c > @@ -63,7 +63,7 @@ static size_t rng_buffer_size(void) > return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; > } > > -static void add_early_randomness(struct hwrng *rng) > +static void get_early_randomness(struct hwrng *rng) > { > unsigned char bytes[16]; > int bytes_read; > @@ -79,6 +79,21 @@ static void add_early_randomness(struct hwrng *rng) > add_device_randomness(bytes, bytes_read); > } > > +static v...
2014 Jul 14
2
[RFC PATCH 1/3] hw_random: allow RNG devices to give early randomness after a delay
...rivers/char/hw_random/core.c > index c4419ea..2a765fd 100644 > --- a/drivers/char/hw_random/core.c > +++ b/drivers/char/hw_random/core.c > @@ -63,7 +63,7 @@ static size_t rng_buffer_size(void) > return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; > } > > -static void add_early_randomness(struct hwrng *rng) > +static void get_early_randomness(struct hwrng *rng) > { > unsigned char bytes[16]; > int bytes_read; > @@ -79,6 +79,21 @@ static void add_early_randomness(struct hwrng *rng) > add_device_randomness(bytes, bytes_read); > } > > +static v...
2014 Jul 09
2
[PATCH v2 1/2] hwrng: fetch randomness only after device init
On Wed, Jul 09, 2014 at 06:38:22PM +0530, Amit Shah wrote: > On (Wed) 09 Jul 2014 [07:53:17], Jason Cooper wrote: > > On Sat, Jul 05, 2014 at 11:04:52AM +0530, Amit Shah wrote: > > > Commit d9e7972619334 "hwrng: add randomness to system from rng sources" > > > added a call to rng_get_data() from the hwrng_register() function. > > > However, some rng
2014 Jul 09
2
[PATCH v2 1/2] hwrng: fetch randomness only after device init
On Wed, Jul 09, 2014 at 06:38:22PM +0530, Amit Shah wrote: > On (Wed) 09 Jul 2014 [07:53:17], Jason Cooper wrote: > > On Sat, Jul 05, 2014 at 11:04:52AM +0530, Amit Shah wrote: > > > Commit d9e7972619334 "hwrng: add randomness to system from rng sources" > > > added a call to rng_get_data() from the hwrng_register() function. > > > However, some rng
2014 Jul 09
2
[RFC PATCH] hwrng: sysfs entry rng_seed_kernel, was: "Re: [PATCH v2 1/2] hwrng: fetch randomness only after device init"
...rs/char/hw_random/core.c b/drivers/char/hw_random/core.c index df95e2ff9d48..b54af066d075 100644 --- a/drivers/char/hw_random/core.c +++ b/drivers/char/hw_random/core.c @@ -63,14 +63,25 @@ static size_t rng_buffer_size(void) return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; } -static void add_early_randomness(struct hwrng *rng) +static void add_early_randomness(struct hwrng *rng, u8 size) { - unsigned char bytes[16]; + unsigned char *bytes; int bytes_read; + /* size can come from the user, sanitize */ + size = size > 256 ? 256 : size; + + size = size == 0 ? 16 : size; + + bytes = kmalloc(siz...
2014 Jul 09
2
[RFC PATCH] hwrng: sysfs entry rng_seed_kernel, was: "Re: [PATCH v2 1/2] hwrng: fetch randomness only after device init"
...rs/char/hw_random/core.c b/drivers/char/hw_random/core.c index df95e2ff9d48..b54af066d075 100644 --- a/drivers/char/hw_random/core.c +++ b/drivers/char/hw_random/core.c @@ -63,14 +63,25 @@ static size_t rng_buffer_size(void) return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; } -static void add_early_randomness(struct hwrng *rng) +static void add_early_randomness(struct hwrng *rng, u8 size) { - unsigned char bytes[16]; + unsigned char *bytes; int bytes_read; + /* size can come from the user, sanitize */ + size = size > 256 ? 256 : size; + + size = size == 0 ? 16 : size; + + bytes = kmalloc(siz...
2014 Jul 05
6
[PATCH v2 0/2] hwrng, virtio-rng: init-time fixes
v2: - this now separates both the patches; the virtio-rng fix is self-contained - re-work hwrng core to fetch randomness at device init time if ->init() is registered by the device, instead of not calling it at all. - virtio-rng: introduce a probe_done bool to ensure we don't ask host for data before successful probe Hi, When booting a recent kernel under KVM with the virtio-rng
2014 Jul 05
6
[PATCH v2 0/2] hwrng, virtio-rng: init-time fixes
v2: - this now separates both the patches; the virtio-rng fix is self-contained - re-work hwrng core to fetch randomness at device init time if ->init() is registered by the device, instead of not calling it at all. - virtio-rng: introduce a probe_done bool to ensure we don't ask host for data before successful probe Hi, When booting a recent kernel under KVM with the virtio-rng
2014 Jul 14
4
[RFC PATCH 0/3] hw_random: support for delayed init randomness requests
Hello, This series introduces a way to allow devices to contribute to initial system randomness after a certain delay. Specifically, the virtio-rng device can contribute initial randomness only after a successful probe(). A delayed workqueue item is queued in the system queue to fetch this randomness if the device indicates it's capable of contributing only after a delay, via the new
2014 Jul 14
4
[RFC PATCH 0/3] hw_random: support for delayed init randomness requests
Hello, This series introduces a way to allow devices to contribute to initial system randomness after a certain delay. Specifically, the virtio-rng device can contribute initial randomness only after a successful probe(). A delayed workqueue item is queued in the system queue to fetch this randomness if the device indicates it's capable of contributing only after a delay, via the new
2014 Jul 05
0
[PATCH v2 1/2] hwrng: fetch randomness only after device init
...@@ static DEFINE_MUTEX(rng_mutex); static int data_avail; static u8 *rng_buffer; +static inline int rng_get_data(struct hwrng *rng, u8 *buffer, size_t size, + int wait); + static size_t rng_buffer_size(void) { return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; } +static void add_early_randomness(struct hwrng *rng) +{ + unsigned char bytes[16]; + int bytes_read; + + bytes_read = rng_get_data(rng, bytes, sizeof(bytes), 1); + if (bytes_read > 0) + add_device_randomness(bytes, bytes_read); +} + static inline int hwrng_init(struct hwrng *rng) { + int ret; + if (!rng->init) ret...
2014 Jul 10
0
[PATCH v3 1/2] hwrng: fetch randomness only after device init
...@@ static DEFINE_MUTEX(rng_mutex); static int data_avail; static u8 *rng_buffer; +static inline int rng_get_data(struct hwrng *rng, u8 *buffer, size_t size, + int wait); + static size_t rng_buffer_size(void) { return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; } +static void add_early_randomness(struct hwrng *rng) +{ + unsigned char bytes[16]; + int bytes_read; + + bytes_read = rng_get_data(rng, bytes, sizeof(bytes), 1); + if (bytes_read > 0) + add_device_randomness(bytes, bytes_read); +} + static inline int hwrng_init(struct hwrng *rng) { - if (!rng->init) - return 0; - retu...
2014 Jul 14
0
[RFC PATCH 1/3] hw_random: allow RNG devices to give early randomness after a delay
...ndex c4419ea..2a765fd 100644 > > --- a/drivers/char/hw_random/core.c > > +++ b/drivers/char/hw_random/core.c > > @@ -63,7 +63,7 @@ static size_t rng_buffer_size(void) > > return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; > > } > > > > -static void add_early_randomness(struct hwrng *rng) > > +static void get_early_randomness(struct hwrng *rng) > > { > > unsigned char bytes[16]; > > int bytes_read; > > @@ -79,6 +79,21 @@ static void add_early_randomness(struct hwrng *rng) > > add_device_randomness(bytes, bytes_read);...
2014 Jul 14
0
[RFC PATCH 1/3] hw_random: allow RNG devices to give early randomness after a delay
...-git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index c4419ea..2a765fd 100644 --- a/drivers/char/hw_random/core.c +++ b/drivers/char/hw_random/core.c @@ -63,7 +63,7 @@ static size_t rng_buffer_size(void) return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; } -static void add_early_randomness(struct hwrng *rng) +static void get_early_randomness(struct hwrng *rng) { unsigned char bytes[16]; int bytes_read; @@ -79,6 +79,21 @@ static void add_early_randomness(struct hwrng *rng) add_device_randomness(bytes, bytes_read); } +static void sched_init_random(struct work_struct *wor...
2014 Jul 07
1
[PATCH v2 1/2] hwrng: fetch randomness only after device init
On (Mon) 07 Jul 2014 [11:23:52], Amit Shah wrote: > On (Sun) 06 Jul 2014 [21:41:47], Kees Cook wrote: > > On Fri, Jul 4, 2014 at 10:34 PM, Amit Shah <amit.shah at redhat.com> wrote: > > > Commit d9e7972619334 "hwrng: add randomness to system from rng sources" > > > added a call to rng_get_data() from the hwrng_register() function. > > > However,
2014 Jul 07
1
[PATCH v2 1/2] hwrng: fetch randomness only after device init
On (Mon) 07 Jul 2014 [11:23:52], Amit Shah wrote: > On (Sun) 06 Jul 2014 [21:41:47], Kees Cook wrote: > > On Fri, Jul 4, 2014 at 10:34 PM, Amit Shah <amit.shah at redhat.com> wrote: > > > Commit d9e7972619334 "hwrng: add randomness to system from rng sources" > > > added a call to rng_get_data() from the hwrng_register() function. > > > However,
2014 Jul 18
2
[RFC PATCH 1/3] hw_random: allow RNG devices to give early randomness after a delay
...gt; > --- a/drivers/char/hw_random/core.c > > > +++ b/drivers/char/hw_random/core.c > > > @@ -63,7 +63,7 @@ static size_t rng_buffer_size(void) > > > return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; > > > } > > > > > > -static void add_early_randomness(struct hwrng *rng) > > > +static void get_early_randomness(struct hwrng *rng) > > > { > > > unsigned char bytes[16]; > > > int bytes_read; > > > @@ -79,6 +79,21 @@ static void add_early_randomness(struct hwrng *rng) > > > add_device_...
2014 Jul 18
2
[RFC PATCH 1/3] hw_random: allow RNG devices to give early randomness after a delay
...gt; > --- a/drivers/char/hw_random/core.c > > > +++ b/drivers/char/hw_random/core.c > > > @@ -63,7 +63,7 @@ static size_t rng_buffer_size(void) > > > return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; > > > } > > > > > > -static void add_early_randomness(struct hwrng *rng) > > > +static void get_early_randomness(struct hwrng *rng) > > > { > > > unsigned char bytes[16]; > > > int bytes_read; > > > @@ -79,6 +79,21 @@ static void add_early_randomness(struct hwrng *rng) > > > add_device_...
2014 Jul 07
2
[PATCH v2 1/2] hwrng: fetch randomness only after device init
...ng_buffer; > > +static inline int rng_get_data(struct hwrng *rng, u8 *buffer, size_t size, > + int wait); > + > static size_t rng_buffer_size(void) > { > return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; > } > > +static void add_early_randomness(struct hwrng *rng) > +{ > + unsigned char bytes[16]; > + int bytes_read; > + > + bytes_read = rng_get_data(rng, bytes, sizeof(bytes), 1); > + if (bytes_read > 0) > + add_device_randomness(bytes, bytes_read); > +} > + > stat...
2014 Jul 07
2
[PATCH v2 1/2] hwrng: fetch randomness only after device init
...ng_buffer; > > +static inline int rng_get_data(struct hwrng *rng, u8 *buffer, size_t size, > + int wait); > + > static size_t rng_buffer_size(void) > { > return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; > } > > +static void add_early_randomness(struct hwrng *rng) > +{ > + unsigned char bytes[16]; > + int bytes_read; > + > + bytes_read = rng_get_data(rng, bytes, sizeof(bytes), 1); > + if (bytes_read > 0) > + add_device_randomness(bytes, bytes_read); > +} > + > stat...