Apply by doing: cd /usr/src patch -p0 < 014_rnd.patch And then rebuild your kernel. Index: sys/dev/rnd.c =================================================================== RCS file: /cvs/src/sys/dev/rnd.c,v retrieving revision 1.67 retrieving revision 1.67.2.1 diff -u -p -r1.67 -r1.67.2.1 --- sys/dev/rnd.c 15 Mar 2004 14:17:25 -0000 1.67 +++ sys/dev/rnd.c 17 Jul 2004 02:57:54 -0000 1.67.2.1 @@ -264,6 +264,7 @@ int rnd_debug = 0x0000; * For a pool of size 64, try x^64+x^62+x^38+x^10+x^6+x+1. */ #define POOLBITS (POOLWORDS*32) +#define POOLBYTES (POOLWORDS*4) #if POOLWORDS == 2048 #define TAP1 1638 #define TAP2 1231 @@ -964,15 +965,17 @@ randomread(dev, uio, ioflag) struct uio *uio; int ioflag; { - int ret = 0; - int i; + int ret = 0; + int i; + u_int32_t *buf; if (uio->uio_resid == 0) return 0; + MALLOC(buf, u_int32_t *, POOLBYTES, M_TEMP, M_WAITOK); + while (!ret && uio->uio_resid > 0) { - u_int32_t buf[ POOLWORDS ]; - int n = min(sizeof(buf), uio->uio_resid); + int n = min(POOLBYTES, uio->uio_resid); switch(minor(dev)) { case RND_RND: @@ -1033,6 +1036,8 @@ randomread(dev, uio, ioflag) if (n != 0 && ret == 0) ret = uiomove((caddr_t)buf, n, uio); } + + FREE(buf, M_TEMP); return ret; } @@ -1126,7 +1131,8 @@ randomwrite(dev, uio, flags) struct uio *uio; int flags; { - int ret = 0; + int ret = 0; + u_int32_t *buf; if (minor(dev) == RND_RND || minor(dev) == RND_PRND) return ENXIO; @@ -1134,9 +1140,10 @@ randomwrite(dev, uio, flags) if (uio->uio_resid == 0) return 0; + MALLOC(buf, u_int32_t *, POOLBYTES, M_TEMP, M_WAITOK); + while (!ret && uio->uio_resid > 0) { - u_int32_t buf[ POOLWORDS ]; - u_short n = min(sizeof(buf),uio->uio_resid); + u_short n = min(POOLBYTES, uio->uio_resid); ret = uiomove((caddr_t)buf, n, uio); if (!ret) { @@ -1149,6 +1156,7 @@ randomwrite(dev, uio, flags) if (minor(dev) == RND_ARND && !ret) arc4random_initialized = 0; + FREE(buf, M_TEMP); return ret; }