diff options
author | Mike Pritchard <mpp@FreeBSD.org> | 1995-09-02 18:28:48 +0000 |
---|---|---|
committer | Mike Pritchard <mpp@FreeBSD.org> | 1995-09-02 18:28:48 +0000 |
commit | efcc7f421867a5d8bc1912d1d01c19169df377da (patch) | |
tree | 5cfe5f667d19715c81403c41894b86bb1c843b75 /sys/fs | |
parent | b406e662aae0392550939831a86e716339771c0f (diff) | |
download | src-efcc7f421867a5d8bc1912d1d01c19169df377da.tar.gz src-efcc7f421867a5d8bc1912d1d01c19169df377da.zip |
Change procfs_lookup to not allow delete/rename operations
to prevent panics when a user tries to remove/rename the
contents of /proc/###/*.
Obtained from: 4.4BSD-lite2
Notes
Notes:
svn path=/head/; revision=10531
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/procfs/procfs_vnops.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/fs/procfs/procfs_vnops.c b/sys/fs/procfs/procfs_vnops.c index e26a270b336d..9bf483644ede 100644 --- a/sys/fs/procfs/procfs_vnops.c +++ b/sys/fs/procfs/procfs_vnops.c @@ -36,7 +36,7 @@ * * @(#)procfs_vnops.c 8.6 (Berkeley) 2/7/94 * - * $Id: procfs_vnops.c,v 1.14 1995/05/30 08:07:13 rgrimes Exp $ + * $Id: procfs_vnops.c,v 1.15 1995/08/11 07:26:26 davidg Exp $ */ /* @@ -536,6 +536,11 @@ procfs_lookup(ap) pfstype pfs_type; int i; + *vpp = NULL; + + if (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME) + return (EROFS); + if (cnp->cn_namelen == 1 && *pname == '.') { *vpp = dvp; VREF(dvp); @@ -543,8 +548,6 @@ procfs_lookup(ap) return (0); } - *vpp = NULL; - pfs = VTOPFS(dvp); switch (pfs->pfs_type) { case Proot: |