Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Check if the type of device node isn't VBAD before touch...
details: https://anonhg.NetBSD.org/src/rev/5fb516153699
branches: trunk
changeset: 477540:5fb516153699
user: enami <enami%NetBSD.org@localhost>
date: Wed Oct 20 14:32:09 1999 +0000
description:
Check if the type of device node isn't VBAD before touching v_specinfo. If
the device vnode is revoked, the field is NULL and touching it causes null
pointer derefercence.
diffstat:
sys/adosfs/advfsops.c | 5 +++--
sys/filecorefs/filecore_vfsops.c | 5 +++--
sys/isofs/cd9660/cd9660_vfsops.c | 5 +++--
sys/msdosfs/msdosfs_vfsops.c | 5 +++--
sys/ntfs/ntfs_vfsops.c | 5 +++--
sys/ufs/ext2fs/ext2fs_vfsops.c | 5 +++--
sys/ufs/ffs/ffs_vfsops.c | 5 +++--
sys/ufs/lfs/lfs_vfsops.c | 5 +++--
8 files changed, 24 insertions(+), 16 deletions(-)
diffs (152 lines):
diff -r c2d64c2611e6 -r 5fb516153699 sys/adosfs/advfsops.c
--- a/sys/adosfs/advfsops.c Wed Oct 20 14:27:32 1999 +0000
+++ b/sys/adosfs/advfsops.c Wed Oct 20 14:32:09 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: advfsops.c,v 1.38 1999/10/18 19:52:24 wrstuden Exp $ */
+/* $NetBSD: advfsops.c,v 1.39 1999/10/20 14:32:09 enami Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@@ -300,7 +300,8 @@
if ((error = vflush(mp, NULLVP, flags)) != 0)
return (error);
amp = VFSTOADOSFS(mp);
- amp->devvp->v_specflags &= ~SI_MOUNTEDON;
+ if (amp->devvp->v_type != VBAD)
+ amp->devvp->v_specflags &= ~SI_MOUNTEDON;
vn_lock(amp->devvp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_CLOSE(amp->devvp, FREAD, NOCRED, p);
vput(amp->devvp);
diff -r c2d64c2611e6 -r 5fb516153699 sys/filecorefs/filecore_vfsops.c
--- a/sys/filecorefs/filecore_vfsops.c Wed Oct 20 14:27:32 1999 +0000
+++ b/sys/filecorefs/filecore_vfsops.c Wed Oct 20 14:32:09 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: filecore_vfsops.c,v 1.8 1999/10/16 23:53:27 wrstuden Exp $ */
+/* $NetBSD: filecore_vfsops.c,v 1.9 1999/10/20 14:32:10 enami Exp $ */
/*-
* Copyright (c) 1998 Andrew McMurry
@@ -393,7 +393,8 @@
fcmp = VFSTOFILECORE(mp);
- fcmp->fc_devvp->v_specflags &= ~SI_MOUNTEDON;
+ if (fcmp->fc_devvp->v_type != VBAD)
+ fcmp->fc_devvp->v_specflags &= ~SI_MOUNTEDON;
vn_lock(fcmp->fc_devvp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_CLOSE(fcmp->fc_devvp, FREAD, NOCRED, p);
vput(fcmp->fc_devvp);
diff -r c2d64c2611e6 -r 5fb516153699 sys/isofs/cd9660/cd9660_vfsops.c
--- a/sys/isofs/cd9660/cd9660_vfsops.c Wed Oct 20 14:27:32 1999 +0000
+++ b/sys/isofs/cd9660/cd9660_vfsops.c Wed Oct 20 14:32:09 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cd9660_vfsops.c,v 1.40 1999/10/16 23:53:27 wrstuden Exp $ */
+/* $NetBSD: cd9660_vfsops.c,v 1.41 1999/10/20 14:32:10 enami Exp $ */
/*-
* Copyright (c) 1994
@@ -510,7 +510,8 @@
iso_dunmap(isomp->im_dev);
#endif
- isomp->im_devvp->v_specflags &= ~SI_MOUNTEDON;
+ if (isomp->im_devvp->v_type != VBAD)
+ isomp->im_devvp->v_specflags &= ~SI_MOUNTEDON;
vn_lock(isomp->im_devvp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_CLOSE(isomp->im_devvp, FREAD, NOCRED, p);
vput(isomp->im_devvp);
diff -r c2d64c2611e6 -r 5fb516153699 sys/msdosfs/msdosfs_vfsops.c
--- a/sys/msdosfs/msdosfs_vfsops.c Wed Oct 20 14:27:32 1999 +0000
+++ b/sys/msdosfs/msdosfs_vfsops.c Wed Oct 20 14:32:09 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_vfsops.c,v 1.63 1999/10/16 23:53:28 wrstuden Exp $ */
+/* $NetBSD: msdosfs_vfsops.c,v 1.64 1999/10/20 14:32:10 enami Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -756,7 +756,8 @@
if ((error = vflush(mp, NULLVP, flags)) != 0)
return (error);
pmp = VFSTOMSDOSFS(mp);
- pmp->pm_devvp->v_specflags &= ~SI_MOUNTEDON;
+ if (pmp->pm_devvp->v_type != VBAD)
+ pmp->pm_devvp->v_specflags &= ~SI_MOUNTEDON;
#ifdef MSDOSFS_DEBUG
{
struct vnode *vp = pmp->pm_devvp;
diff -r c2d64c2611e6 -r 5fb516153699 sys/ntfs/ntfs_vfsops.c
--- a/sys/ntfs/ntfs_vfsops.c Wed Oct 20 14:27:32 1999 +0000
+++ b/sys/ntfs/ntfs_vfsops.c Wed Oct 20 14:32:09 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ntfs_vfsops.c,v 1.19 1999/10/20 14:25:42 enami Exp $ */
+/* $NetBSD: ntfs_vfsops.c,v 1.20 1999/10/20 14:32:10 enami Exp $ */
/*-
* Copyright (c) 1998, 1999 Semen Ustimenko
@@ -670,7 +670,8 @@
vnode_pager_uncache(ntmp->ntm_devvp);
VOP_UNLOCK(ntmp->ntm_devvp);
#else
- ntmp->ntm_devvp->v_specflags &= ~SI_MOUNTEDON;
+ if (ntmp->ntm_devvp->v_type != VBAD)
+ ntmp->ntm_devvp->v_specflags &= ~SI_MOUNTEDON;
#endif
vinvalbuf(ntmp->ntm_devvp, V_SAVE, NOCRED, p, 0, 0);
diff -r c2d64c2611e6 -r 5fb516153699 sys/ufs/ext2fs/ext2fs_vfsops.c
--- a/sys/ufs/ext2fs/ext2fs_vfsops.c Wed Oct 20 14:27:32 1999 +0000
+++ b/sys/ufs/ext2fs/ext2fs_vfsops.c Wed Oct 20 14:32:09 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ext2fs_vfsops.c,v 1.28 1999/10/16 23:53:28 wrstuden Exp $ */
+/* $NetBSD: ext2fs_vfsops.c,v 1.29 1999/10/20 14:32:11 enami Exp $ */
/*
* Copyright (c) 1997 Manuel Bouyer.
@@ -649,7 +649,8 @@
fs->e2fs.e2fs_state = E2FS_ISCLEAN;
(void) ext2fs_sbupdate(ump, MNT_WAIT);
}
- ump->um_devvp->v_specflags &= ~SI_MOUNTEDON;
+ if (ump->um_devvp->v_type != VBAD)
+ ump->um_devvp->v_specflags &= ~SI_MOUNTEDON;
vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_CLOSE(ump->um_devvp, fs->e2fs_ronly ? FREAD : FREAD|FWRITE,
NOCRED, p);
diff -r c2d64c2611e6 -r 5fb516153699 sys/ufs/ffs/ffs_vfsops.c
--- a/sys/ufs/ffs/ffs_vfsops.c Wed Oct 20 14:27:32 1999 +0000
+++ b/sys/ufs/ffs/ffs_vfsops.c Wed Oct 20 14:32:09 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_vfsops.c,v 1.53 1999/10/16 23:53:29 wrstuden Exp $ */
+/* $NetBSD: ffs_vfsops.c,v 1.54 1999/10/20 14:32:11 enami Exp $ */
/*
* Copyright (c) 1989, 1991, 1993, 1994
@@ -692,7 +692,8 @@
fs->fs_clean = FS_ISCLEAN;
(void) ffs_sbupdate(ump, MNT_WAIT);
}
- ump->um_devvp->v_specflags &= ~SI_MOUNTEDON;
+ if (ump->um_devvp->v_type != VBAD)
+ ump->um_devvp->v_specflags &= ~SI_MOUNTEDON;
vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_CLOSE(ump->um_devvp, fs->fs_ronly ? FREAD : FREAD|FWRITE,
NOCRED, p);
diff -r c2d64c2611e6 -r 5fb516153699 sys/ufs/lfs/lfs_vfsops.c
--- a/sys/ufs/lfs/lfs_vfsops.c Wed Oct 20 14:27:32 1999 +0000
+++ b/sys/ufs/lfs/lfs_vfsops.c Wed Oct 20 14:32:09 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_vfsops.c,v 1.39 1999/10/18 19:52:25 wrstuden Exp $ */
+/* $NetBSD: lfs_vfsops.c,v 1.40 1999/10/20 14:32:11 enami Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -527,7 +527,8 @@
vgone(fs->lfs_ivnode);
ronly = !fs->lfs_ronly;
- ump->um_devvp->v_specflags &= ~SI_MOUNTEDON;
+ if (ump->um_devvp->v_type != VBAD)
+ ump->um_devvp->v_specflags &= ~SI_MOUNTEDON;
vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_CLOSE(ump->um_devvp,
ronly ? FREAD : FREAD|FWRITE, NOCRED, p);
Home |
Main Index |
Thread Index |
Old Index