aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Greenman <dg@FreeBSD.org>1995-08-11 07:26:26 +0000
committerDavid Greenman <dg@FreeBSD.org>1995-08-11 07:26:26 +0000
commit67d7e54eb1248779a84d10958037e90414375382 (patch)
tree7d44c15da1a270fccf4b2f0584afd1ab835333bf
parent90fb65d02e96d6731dc705d90c3d746daf781d9e (diff)
downloadsrc-67d7e54eb1248779a84d10958037e90414375382.tar.gz
src-67d7e54eb1248779a84d10958037e90414375382.zip
Be careful not to dereference NULL credentials pointers when doing the
getattr function.
Notes
Notes: svn path=/head/; revision=10024
-rw-r--r--sys/fs/procfs/procfs_vnops.c10
-rw-r--r--sys/miscfs/procfs/procfs_vnops.c10
2 files changed, 14 insertions, 6 deletions
diff --git a/sys/fs/procfs/procfs_vnops.c b/sys/fs/procfs/procfs_vnops.c
index 738df27cadf9..e26a270b336d 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.13 1995/05/25 01:35:24 davidg Exp $
+ * $Id: procfs_vnops.c,v 1.14 1995/05/30 08:07:13 rgrimes Exp $
*/
/*
@@ -311,7 +311,10 @@ procfs_getattr(ap)
struct proc *procp;
int error;
- /* first check the process still exists */
+ /*
+ * First make sure that the process and its credentials
+ * still exist.
+ */
switch (pfs->pfs_type) {
case Proot:
procp = 0;
@@ -319,7 +322,8 @@ procfs_getattr(ap)
default:
procp = PFIND(pfs->pfs_pid);
- if (procp == 0)
+ if (procp == 0 || procp->p_cred == NULL ||
+ procp->p_ucred == NULL)
return (ENOENT);
}
diff --git a/sys/miscfs/procfs/procfs_vnops.c b/sys/miscfs/procfs/procfs_vnops.c
index 738df27cadf9..e26a270b336d 100644
--- a/sys/miscfs/procfs/procfs_vnops.c
+++ b/sys/miscfs/procfs/procfs_vnops.c
@@ -36,7 +36,7 @@
*
* @(#)procfs_vnops.c 8.6 (Berkeley) 2/7/94
*
- * $Id: procfs_vnops.c,v 1.13 1995/05/25 01:35:24 davidg Exp $
+ * $Id: procfs_vnops.c,v 1.14 1995/05/30 08:07:13 rgrimes Exp $
*/
/*
@@ -311,7 +311,10 @@ procfs_getattr(ap)
struct proc *procp;
int error;
- /* first check the process still exists */
+ /*
+ * First make sure that the process and its credentials
+ * still exist.
+ */
switch (pfs->pfs_type) {
case Proot:
procp = 0;
@@ -319,7 +322,8 @@ procfs_getattr(ap)
default:
procp = PFIND(pfs->pfs_pid);
- if (procp == 0)
+ if (procp == 0 || procp->p_cred == NULL ||
+ procp->p_ucred == NULL)
return (ENOENT);
}