> Date: Sat, 2 Oct 2010 11:54:13 -0400 (EDT)
> From: Ted Unangst <[email protected]>
> 
> Speaking of the entropy pool, it should be difficult for a user to 
> influence, right?  So it's not the greatest idea to allow anyone who opens 
> the device to feed ioctls with fairly well known parameters and stir the 
> pot?

The add_timer_randomness() calls stir the pot, but we don't count the
entropy.  So no harm is done if a malicious users tries to attack the
pool with well-timed ioctls.

> Index: rnd.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/rnd.c,v
> retrieving revision 1.103
> diff -u -r1.103 rnd.c
> --- rnd.c     2 Oct 2010 15:49:17 -0000       1.103
> +++ rnd.c     2 Oct 2010 15:51:43 -0000
> @@ -1140,8 +1140,6 @@
>       int     ret = 0;
>       u_int   cnt;
>  
> -     add_timer_randomness((u_long)p ^ (u_long)data ^ cmd);
> -
>       switch (cmd) {
>       case FIOASYNC:
>               /* rnd has no async flag in softc so this is really a no-op. */
> @@ -1201,6 +1199,5 @@
>               ret = ENOTTY;
>       }
>  
> -     add_timer_randomness((u_long)p ^ (u_long)data ^ cmd);
>       return ret;
>  }

Reply via email to