diff options
Diffstat (limited to 'usr/src/uts/common/io/mem.c')
-rw-r--r-- | usr/src/uts/common/io/mem.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/usr/src/uts/common/io/mem.c b/usr/src/uts/common/io/mem.c index cdbeb0d422..8955b3d935 100644 --- a/usr/src/uts/common/io/mem.c +++ b/usr/src/uts/common/io/mem.c @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2015, Joyent, Inc. All rights reserved. + * Copyright 2016, Joyent, Inc. */ /* @@ -221,10 +221,19 @@ mmopen(dev_t *devp, int flag, int typ, struct cred *cred) switch (getminor(*devp)) { case M_NULL: case M_ZERO: + /* standard devices */ + break; + case M_MEM: case M_KMEM: case M_ALLKMEM: - /* standard devices */ + /* + * These devices should never be visible in a zone, but if they + * somehow do get created we refuse to allow the zone to use + * them. + */ + if (crgetzoneid(cred) != GLOBAL_ZONEID) + return (EACCES); break; default: |