diff options
author | mpp <mpp@FreeBSD.org> | 1995-09-02 18:28:48 +0000 |
---|---|---|
committer | mpp <mpp@FreeBSD.org> | 1995-09-02 18:28:48 +0000 |
commit | 325b31878368cd60bc9d5ece2d23043531bf1524 (patch) | |
tree | 5cfe5f667d19715c81403c41894b86bb1c843b75 /sys/fs/procfs | |
parent | 2f44cdc7e1a2b2a57c4ddfb6e937304a6baac01f (diff) | |
download | FreeBSD-src-325b31878368cd60bc9d5ece2d23043531bf1524.zip FreeBSD-src-325b31878368cd60bc9d5ece2d23043531bf1524.tar.gz |
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
Diffstat (limited to 'sys/fs/procfs')
-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 e26a270..9bf4836 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: |