Refuse attemps to mount root filesystem
This commit is contained in:
parent
16c2bf8bfb
commit
b0aed5267e
@ -68,7 +68,7 @@ devfs_mount(struct mount *mp, struct thread *td)
|
|||||||
|
|
||||||
error = 0;
|
error = 0;
|
||||||
|
|
||||||
if (mp->mnt_flag & (MNT_UPDATE | MNT_NODEV))
|
if (mp->mnt_flag & (MNT_UPDATE | MNT_NODEV | MNT_ROOTFS))
|
||||||
return (EOPNOTSUPP);
|
return (EOPNOTSUPP);
|
||||||
|
|
||||||
MALLOC(fmp, struct devfs_mount *, sizeof(struct devfs_mount),
|
MALLOC(fmp, struct devfs_mount *, sizeof(struct devfs_mount),
|
||||||
|
@ -71,7 +71,7 @@ fdesc_mount(struct mount *mp, struct thread *td)
|
|||||||
/*
|
/*
|
||||||
* Update is a no-op
|
* Update is a no-op
|
||||||
*/
|
*/
|
||||||
if (mp->mnt_flag & MNT_UPDATE)
|
if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS))
|
||||||
return (EOPNOTSUPP);
|
return (EOPNOTSUPP);
|
||||||
|
|
||||||
error = fdesc_allocvp(Froot, FD_ROOT, mp, &rvp, td);
|
error = fdesc_allocvp(Froot, FD_ROOT, mp, &rvp, td);
|
||||||
|
@ -225,6 +225,8 @@ hpfs_mountfs(devvp, mp, argsp, td)
|
|||||||
struct g_consumer *cp;
|
struct g_consumer *cp;
|
||||||
struct bufobj *bo;
|
struct bufobj *bo;
|
||||||
|
|
||||||
|
if (mp->mnt_flag & MNT_ROOTFS)
|
||||||
|
return (EOPNOTSUPP);
|
||||||
dprintf(("hpfs_mountfs():\n"));
|
dprintf(("hpfs_mountfs():\n"));
|
||||||
ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
|
ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
|
||||||
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
|
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
|
||||||
|
@ -364,6 +364,8 @@ mountmsdosfs(devvp, mp, td, argp)
|
|||||||
struct g_consumer *cp;
|
struct g_consumer *cp;
|
||||||
struct bufobj *bo;
|
struct bufobj *bo;
|
||||||
|
|
||||||
|
if (mp->mnt_flag & MNT_ROOTFS)
|
||||||
|
return (EOPNOTSUPP);
|
||||||
ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
|
ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
|
||||||
/* XXX: use VOP_ACCESS to check FS perms */
|
/* XXX: use VOP_ACCESS to check FS perms */
|
||||||
DROP_GIANT();
|
DROP_GIANT();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user