Be careful not to dereference NULL credentials pointers when doing the
getattr function.
This commit is contained in:
parent
90fb65d02e
commit
67d7e54eb1
@ -36,7 +36,7 @@
|
|||||||
*
|
*
|
||||||
* @(#)procfs_vnops.c 8.6 (Berkeley) 2/7/94
|
* @(#)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;
|
struct proc *procp;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
/* first check the process still exists */
|
/*
|
||||||
|
* First make sure that the process and its credentials
|
||||||
|
* still exist.
|
||||||
|
*/
|
||||||
switch (pfs->pfs_type) {
|
switch (pfs->pfs_type) {
|
||||||
case Proot:
|
case Proot:
|
||||||
procp = 0;
|
procp = 0;
|
||||||
@ -319,7 +322,8 @@ procfs_getattr(ap)
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
procp = PFIND(pfs->pfs_pid);
|
procp = PFIND(pfs->pfs_pid);
|
||||||
if (procp == 0)
|
if (procp == 0 || procp->p_cred == NULL ||
|
||||||
|
procp->p_ucred == NULL)
|
||||||
return (ENOENT);
|
return (ENOENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
*
|
*
|
||||||
* @(#)procfs_vnops.c 8.6 (Berkeley) 2/7/94
|
* @(#)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;
|
struct proc *procp;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
/* first check the process still exists */
|
/*
|
||||||
|
* First make sure that the process and its credentials
|
||||||
|
* still exist.
|
||||||
|
*/
|
||||||
switch (pfs->pfs_type) {
|
switch (pfs->pfs_type) {
|
||||||
case Proot:
|
case Proot:
|
||||||
procp = 0;
|
procp = 0;
|
||||||
@ -319,7 +322,8 @@ procfs_getattr(ap)
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
procp = PFIND(pfs->pfs_pid);
|
procp = PFIND(pfs->pfs_pid);
|
||||||
if (procp == 0)
|
if (procp == 0 || procp->p_cred == NULL ||
|
||||||
|
procp->p_ucred == NULL)
|
||||||
return (ENOENT);
|
return (ENOENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user