summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-08-04 18:35:33 +0000
committerrwatson <rwatson@FreeBSD.org>2004-08-04 18:35:33 +0000
commit243f24944e31bf8264984db84728ef9b479c4a91 (patch)
treeb8828f0b938c8967c4fe0ae60b78d734745ae8c2 /sys
parent124b176fef5130ca995d2b9f839ccf690a880eef (diff)
downloadFreeBSD-src-243f24944e31bf8264984db84728ef9b479c4a91.zip
FreeBSD-src-243f24944e31bf8264984db84728ef9b479c4a91.tar.gz
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
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_descrip.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 43fc68e..46522fe 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -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;
OpenPOWER on IntegriCloud