mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-17 08:00:48 +01:00
Fix for sync() to close a potential panic with accessing a mount struct
that had been freed. Submitted by: John Dyson
This commit is contained in:
parent
c9c23c03fa
commit
beef0195c9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8219
@ -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.
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user