Add back securelevel check for disks.
XXX: This should live in geom_dev.c but we don't have access to the cred there. XXX: XXX: This may not matter anymore since filesystems use geom_vfs.
This commit is contained in:
parent
40c340aa5d
commit
ecc14aae12
@ -710,6 +710,18 @@ devfs_open(ap)
|
||||
if (dev->si_iosize_max == 0)
|
||||
dev->si_iosize_max = DFLTPHYS;
|
||||
|
||||
if (vn_isdisk(vp, NULL) &&
|
||||
ap->a_cred != FSCRED && (ap->a_mode & FWRITE)) {
|
||||
/*
|
||||
* When running in very secure mode, do not allow
|
||||
* opens for writing of any disks.
|
||||
* XXX: should be in geom_dev.c, but we lack the cred there.
|
||||
*/
|
||||
error = securelevel_ge(td->td_ucred, 2);
|
||||
if (error)
|
||||
return (error);
|
||||
}
|
||||
|
||||
dsw = dev_refthread(dev);
|
||||
if (dsw == NULL)
|
||||
return (ENXIO);
|
||||
|
Loading…
x
Reference in New Issue
Block a user