MFC r286283:

Fix panic triggered by code like this:
open("/dev/md0", O_EXEC);

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
trasz 2015-10-18 14:36:04 +00:00
parent 43f70df899
commit e93b464d00

View File

@ -356,6 +356,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