diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2016-08-10 20:18:33 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2016-08-10 20:18:33 +0000 |
commit | 0fabc2be10a12b10f37299c4442814af0d668b7f (patch) | |
tree | 3959ceefd3c506f4e2c128f8a582fe762d3cac68 | |
parent | d11efe0e35e7310c2ca8e3792d16611410d90219 (diff) | |
download | illumos-joyent-0fabc2be10a12b10f37299c4442814af0d668b7f.tar.gz |
OS-5576 harden random pool for zones
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
-rw-r--r-- | usr/src/uts/common/io/random.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/usr/src/uts/common/io/random.c b/usr/src/uts/common/io/random.c index c4984e956f..b5401b17cd 100644 --- a/usr/src/uts/common/io/random.c +++ b/usr/src/uts/common/io/random.c @@ -20,6 +20,8 @@ * * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2016 Joyent, Inc. */ @@ -289,6 +291,9 @@ rnd_write(dev_t dev, struct uio *uiop, cred_t *credp) 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) |