Print this page
OS-5576 harden random pool for zones
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
*** 18,27 ****
--- 18,29 ----
*
* CDDL HEADER END
*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2016 Joyent, Inc.
*/
/*
* Random number generator pseudo-driver
*** 287,296 ****
--- 289,301 ----
/* See comments in rnd_read() */
uiop->uio_loffset = 0;
if ((error = uiomove(buf, bytes, UIO_WRITE, uiop)) != 0)
return (error);
+ if (crgetzone(credp) != global_zone)
+ continue;
+
switch (devno) {
case DEVRANDOM:
if ((error = random_add_entropy(buf, bytes, 0)) != 0)
return (error);
break;