MFC r286283:
Fix panic triggered by code like this: open("/dev/md0", O_EXEC); Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
43f70df899
commit
e93b464d00
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user