Assert Giant in the following file descriptor-related functions:

Function             Reason
--------             ------
fdfree()             VFS
setugidsafety()      KQueue
fdcheckstd()         VFS
_fgetvp()            VFS
fgetsock()           Conditional assertion based on debug.mpsafenet
This commit is contained in:
rwatson 2004-08-04 18:35:33 +00:00
parent 124b176fef
commit 243f24944e

View File

@ -1485,6 +1485,8 @@ fdfree(td)
struct vnode *vp;
struct flock lf;
GIANT_REQUIRED; /* VFS */
/* Certain daemons might not have file descriptors. */
fdp = td->td_proc->p_fd;
if (fdp == NULL)
@ -1633,6 +1635,8 @@ setugidsafety(td)
struct filedesc *fdp;
int i;
GIANT_REQUIRED; /* kqueue */
/* Certain daemons might not have file descriptors. */
fdp = td->td_proc->p_fd;
if (fdp == NULL)
@ -1734,6 +1738,8 @@ fdcheckstd(td)
register_t retval;
int fd, i, error, flags, devnull;
GIANT_REQUIRED; /* VFS */
fdp = td->td_proc->p_fd;
if (fdp == NULL)
return (0);
@ -1963,6 +1969,8 @@ _fgetvp(struct thread *td, int fd, struct vnode **vpp, int flags)
struct file *fp;
int error;
GIANT_REQUIRED; /* VFS */
*vpp = NULL;
if ((error = _fget(td, fd, &fp, 0, 0)) != 0)
return (error);
@ -2010,6 +2018,8 @@ fgetsock(struct thread *td, int fd, struct socket **spp, u_int *fflagp)
struct file *fp;
int error;
NET_ASSERT_GIANT();
*spp = NULL;
if (fflagp != NULL)
*fflagp = 0;