Development issues regarding the cerowrt test router project
 help / color / mirror / Atom feed
* [Cerowrt-devel] getting more randomness by improving MIPS get_cycles()
@ 2013-09-08 19:04 Dave Taht
  2013-09-09 15:16 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Taht @ 2013-09-08 19:04 UTC (permalink / raw)
  To: openwrt-devel, cerowrt-devel

In light of the whole nsa hoo-ra (stuff like this)

https://plus.google.com/u/0/117091380454742934025/posts/SDcoemc9V3J

Ted Tso has pointed out to me that apparently mips' does not have a working 
generic get_cycles() call,  but instead returns 0 in all cases.

e.g: In arch/mips/include/asm/timex.h:

typedef unsigned int cycles_t;

static inline cycles_t get_cycles(void)
{
        return 0;
}

Um.....

get_cycles() is used in innumerable places in random.c.

This is double plus ungood... I am REALLY hoping I'm merely misreading 
the code...

An example:

(see drivers/char/random.c for how often it is used)

/*
 * Add device- or boot-specific data to the input and nonblocking
 * pools to help initialize them to unique values.
 *
 * None of this adds any entropy, it is meant to avoid the
 * problem of the nonblocking pool having similar initial state
 * across largely identical devices.
 */

void add_device_randomness(const void *buf, unsigned int size)
{
        unsigned long time = get_cycles() ^ jiffies;

...

So, what blocks having a working get_cycles in common mips architectures?




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Cerowrt-devel] getting more randomness by improving MIPS get_cycles()
  2013-09-08 19:04 [Cerowrt-devel] getting more randomness by improving MIPS get_cycles() Dave Taht
@ 2013-09-09 15:16 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2013-09-09 15:16 UTC (permalink / raw)
  To: Dave Taht; +Cc: openwrt-devel, cerowrt-devel

On Sun, 8 Sep 2013 12:04:27 -0700
Dave Taht <dave.taht@bufferbloat.net> wrote:

> In light of the whole nsa hoo-ra (stuff like this)
> 
> https://plus.google.com/u/0/117091380454742934025/posts/SDcoemc9V3J
> 
> Ted Tso has pointed out to me that apparently mips' does not have a working 
> generic get_cycles() call,  but instead returns 0 in all cases.
> 
> e.g: In arch/mips/include/asm/timex.h:
> 
> typedef unsigned int cycles_t;
> 
> static inline cycles_t get_cycles(void)
> {
>         return 0;
> }
> 
> Um.....
> 
> get_cycles() is used in innumerable places in random.c.
> 
> This is double plus ungood... I am REALLY hoping I'm merely misreading 
> the code...
> 
> An example:
> 
> (see drivers/char/random.c for how often it is used)
> 
> /*
>  * Add device- or boot-specific data to the input and nonblocking
>  * pools to help initialize them to unique values.
>  *
>  * None of this adds any entropy, it is meant to avoid the
>  * problem of the nonblocking pool having similar initial state
>  * across largely identical devices.
>  */
> 
> void add_device_randomness(const void *buf, unsigned int size)
> {
>         unsigned long time = get_cycles() ^ jiffies;
> 
> ...
> 
> So, what blocks having a working get_cycles in common mips architectures?

In order to implement get_cycles() a high resolution hardware counter
with quick access is necessary.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-09 15:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-08 19:04 [Cerowrt-devel] getting more randomness by improving MIPS get_cycles() Dave Taht
2013-09-09 15:16 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox