summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1997-03-05 01:42:14 +0000
committermsmith <msmith@FreeBSD.org>1997-03-05 01:42:14 +0000
commit7b27305852f56dfee31375df9ad131e96d315858 (patch)
tree0e05bcb5b3fd25e8c6b2e0e43504af3855f2b542
parent5d25456e482ebdc22cd737ff6542b59b33672ce0 (diff)
downloadFreeBSD-src-7b27305852f56dfee31375df9ad131e96d315858.zip
FreeBSD-src-7b27305852f56dfee31375df9ad131e96d315858.tar.gz
Check that vp->v_mount is non-null in fsync() before dereferencing it to
obtain the mountpoint's MNT_ASYNC flag. This is a Very Definite Last-Minute 2.2 Bugfix Candidate. Reviewed by: sef
-rw-r--r--sys/kern/vfs_extattr.c5
-rw-r--r--sys/kern/vfs_syscalls.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index ee04b8c..26e9867 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
- * $Id$
+ * $Id: vfs_syscalls.c,v 1.58 1997/02/22 09:39:35 peter Exp $
*/
/*
@@ -2175,7 +2175,8 @@ fsync(p, uap, retval)
vm_object_page_clean(vp->v_object, 0, 0 ,0, FALSE);
}
error = VOP_FSYNC(vp, fp->f_cred,
- (vp->v_mount->mnt_flag & MNT_ASYNC) ? MNT_NOWAIT : MNT_WAIT, p);
+ (vp->v_mount && (vp->v_mount->mnt_flag & MNT_ASYNC)) ?
+ MNT_NOWAIT : MNT_WAIT, p);
VOP_UNLOCK(vp, 0, p);
return (error);
}
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index ee04b8c..26e9867 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
- * $Id$
+ * $Id: vfs_syscalls.c,v 1.58 1997/02/22 09:39:35 peter Exp $
*/
/*
@@ -2175,7 +2175,8 @@ fsync(p, uap, retval)
vm_object_page_clean(vp->v_object, 0, 0 ,0, FALSE);
}
error = VOP_FSYNC(vp, fp->f_cred,
- (vp->v_mount->mnt_flag & MNT_ASYNC) ? MNT_NOWAIT : MNT_WAIT, p);
+ (vp->v_mount && (vp->v_mount->mnt_flag & MNT_ASYNC)) ?
+ MNT_NOWAIT : MNT_WAIT, p);
VOP_UNLOCK(vp, 0, p);
return (error);
}
OpenPOWER on IntegriCloud