diff options
author | dg <dg@FreeBSD.org> | 1995-05-02 08:44:31 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-05-02 08:44:31 +0000 |
commit | 381c266547c444f84f9803c6344d92d858ff6e26 (patch) | |
tree | ffb76bdecb908be8516d3615c9125c621ef67412 /sys | |
parent | c68af9669e0223f4754c2b910ca42b1eb8868205 (diff) | |
download | FreeBSD-src-381c266547c444f84f9803c6344d92d858ff6e26.zip FreeBSD-src-381c266547c444f84f9803c6344d92d858ff6e26.tar.gz |
Fix for sync() to close a potential panic with accessing a mount struct
that had been freed.
Submitted by: John Dyson
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_extattr.c | 5 | ||||
-rw-r--r-- | sys/kern/vfs_syscalls.c | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index 7fe74c3..bdd9aa13 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: vfs_syscalls.c,v 1.20 1995/03/19 11:16:58 davidg Exp $ + * $Id: vfs_syscalls.c,v 1.21 1995/03/29 11:54:02 davidg Exp $ */ #include <sys/param.h> @@ -322,8 +322,7 @@ sync(p, uap, retval) register struct mount *mp, *nmp; int asyncflag; - for (mp = mountlist.tqh_first; mp != NULL; mp = nmp) { - nmp = mp->mnt_list.tqe_next; + for (mp = mountlist.tqh_first; mp != NULL; mp = mp->mnt_list.tqe_next) { /* * The lock check below is to avoid races with mount * and unmount. diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 7fe74c3..bdd9aa13 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: vfs_syscalls.c,v 1.20 1995/03/19 11:16:58 davidg Exp $ + * $Id: vfs_syscalls.c,v 1.21 1995/03/29 11:54:02 davidg Exp $ */ #include <sys/param.h> @@ -322,8 +322,7 @@ sync(p, uap, retval) register struct mount *mp, *nmp; int asyncflag; - for (mp = mountlist.tqh_first; mp != NULL; mp = nmp) { - nmp = mp->mnt_list.tqe_next; + for (mp = mountlist.tqh_first; mp != NULL; mp = mp->mnt_list.tqe_next) { /* * The lock check below is to avoid races with mount * and unmount. |