diff options
Diffstat (limited to 'usr/src/uts/common/io/random.c')
| -rw-r--r-- | usr/src/uts/common/io/random.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr/src/uts/common/io/random.c b/usr/src/uts/common/io/random.c index c4984e956f..a50bbcceec 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 2017 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) @@ -329,7 +334,7 @@ rnd_chpoll(dev_t dev, short events, int anyyet, short *reventsp, * A non NULL pollhead pointer should be returned in case * user polls for 0 events. */ - if (*reventsp == 0 && !anyyet) + if ((*reventsp == 0 && !anyyet) || (events & POLLET)) *phpp = &urnd_pollhd; break; |
