diff options
Diffstat (limited to 'sys/geom/geom_dev.c')
-rw-r--r-- | sys/geom/geom_dev.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c index 3df7f3e..0d34ef5 100644 --- a/sys/geom/geom_dev.c +++ b/sys/geom/geom_dev.c @@ -358,6 +358,13 @@ g_dev_open(struct cdev *dev, int flags, int fmt, struct thread *td) #else e = 0; #endif + + /* + * This happens on attempt to open a device node with O_EXEC. + */ + if (r + w + e == 0) + return (EINVAL); + if (w) { /* * When running in very secure mode, do not allow |