diff options
author | dg <dg@FreeBSD.org> | 1995-08-11 07:26:26 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-08-11 07:26:26 +0000 |
commit | 3a38ab962539cccfc54845f871e47ef4951d07c0 (patch) | |
tree | 7d44c15da1a270fccf4b2f0584afd1ab835333bf /sys/fs | |
parent | 8f234b4c8d7c4dbc4141b4bbaf8587696201910d (diff) | |
download | FreeBSD-src-3a38ab962539cccfc54845f871e47ef4951d07c0.zip FreeBSD-src-3a38ab962539cccfc54845f871e47ef4951d07c0.tar.gz |
Be careful not to dereference NULL credentials pointers when doing the
getattr function.
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/procfs/procfs_vnops.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/fs/procfs/procfs_vnops.c b/sys/fs/procfs/procfs_vnops.c index 738df27..e26a270 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); } |